/* ==========================================================================
   CastPack — style.css
   Mic & cast management for live musical theatre
   Industrial / utilitarian aesthetic — console, not consumer.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ─── Custom Properties ────────────────────────────────────────────────── */
:root {
  --bg-primary:    #0a0a0a;
  --bg-surface:    #111111;
  --bg-elevated:   #1a1a1a;
  --border:        #2a2a2a;
  --border-active: #3a3a3a;
  --text-primary:  #e8e8e8;
  --text-secondary:#888888;
  --text-muted:    #444444;
  --accent:        #f59e0b;
  --accent-dim:    #92400e;
  --danger:        #ef4444;
  --success:       #22c55e;

  --font-display: 'Bebas Neue', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --transition: 120ms ease;
}

/* ─── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-family: var(--font-mono);
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* ─── Utility ───────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border-active);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  background: var(--border);
  border-color: var(--border-active);
}

.btn:active {
  background: var(--border-active);
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
  font-weight: 600;
}

.btn--accent:hover {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #0a0a0a;
}

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

.btn--danger:hover {
  background: var(--danger);
  color: #0a0a0a;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn--sm {
  height: 28px;
  padding: 0 10px;
  font-size: 0.65rem;
}

.btn--icon {
  width: 36px;
  padding: 0;
  flex-shrink: 0;
}

.btn--icon.btn--sm {
  width: 28px;
}

.btn--full {
  width: 100%;
}

/* ─── Form Fields ───────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.field label,
.field-label {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.input,
.textarea,
.select {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  line-height: 1.4;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.textarea {
  resize: vertical;
  min-height: 70px;
}

.select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888888' stroke-width='1.5' fill='none' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ─── Flash / Alert Messages ────────────────────────────────────────────── */
.flash {
  padding: 9px 14px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  border-left: 2px solid;
  margin-bottom: 16px;
  font-weight: 400;
}

.flash--success {
  background: rgba(34, 197, 94, 0.08);
  border-color: var(--success);
  color: var(--success);
}

.flash--error {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
  color: var(--danger);
}

/* ─── ================================================================== ─── */
/* ─── LOGIN PAGE ─────────────────────────────────────────────────────── ─── */
/* ─── ================================================================== ─── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle, #1d1d1d 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.login-card__header {
  padding: 28px 28px 22px;
  border-bottom: 1px solid var(--border);
}

.login-wordmark {
  font-family: var(--font-display);
  font-size: 2.8rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1;
  display: block;
}

.login-tagline {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

.login-card__body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-error {
  font-size: 0.7rem;
  color: var(--danger);
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.25);
  letter-spacing: 0.04em;
}

.login-submit {
  margin-top: 4px;
  height: 42px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.login-footer {
  padding: 12px 28px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
}

/* ─── ================================================================== ─── */
/* ─── TOP BAR ────────────────────────────────────────────────────────── ─── */
/* ─── ================================================================== ─── */

.topbar {
  height: 44px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1;
}

.topbar__context {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 2px 6px;
  border: 1px solid var(--border);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__meta {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulseGlow 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ─── ================================================================== ─── */
/* ─── PRODUCTION VIEW (/index.php) ───────────────────────────────────── ─── */
/* ─── ================================================================== ─── */

/* Lock the production view to the viewport — no page scroll */
body.production-view-page {
  overflow: hidden;
  height: 100vh;
}

.production-view {
  padding: 8px 10px;
  height: calc(100vh - 44px); /* 44px = topbar */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.production-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.production-title {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.production-title span {
  color: var(--text-secondary);
}

.production-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.production-select {
  font-size: 0.7rem;
  height: 30px;
  padding: 0 28px 0 8px;
}

/* Auto-refresh progress bar */
.refresh-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.refresh-bar__track {
  width: 48px;
  height: 2px;
  background: var(--border);
  overflow: hidden;
}

.refresh-bar__fill {
  height: 100%;
  background: var(--accent-dim);
  transform-origin: left;
  animation: drainProgress 30s linear forwards;
}

@keyframes drainProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ─── Cast Grid ──────────────────────────────────────────────────────────── */
.cast-grid {
  flex: 1;           /* fill remaining height inside .production-view */
  min-height: 0;     /* allow flex child to shrink below content size */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr; /* every row gets an equal share of the grid height */
  gap: 6px;
  overflow: hidden;
}

@media (min-width: 600px)  { .cast-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .cast-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } }
@media (min-width: 1200px) { .cast-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1400px) { .cast-grid { grid-template-columns: repeat(6, 1fr); } }

/* ─── Cast Card ──────────────────────────────────────────────────────────── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.cast-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  position: relative;
  animation: cardIn 0.25s ease forwards;
  opacity: 0;
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* prevent content from bursting out of its grid cell */
  min-height: 0;
}

.cast-card:hover {
  border-color: var(--accent-dim);
}

/* RF Channel badge — overlaid top-right of photo */
.cast-card__rf {
  position: absolute;
  top: 7px;
  right: 7px;
  background: rgba(8, 8, 8, 0.88);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 2px 5px;
  text-transform: uppercase;
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  line-height: 1.4;
}

/* Photo area — flex: 1 so it takes all available space above the data strip */
.cast-card__photo-wrap {
  width: 100%;
  flex: 1;       /* stretch to fill card height, pushing data to the bottom */
  min-height: 0; /* allow it to shrink when the card is small */
  overflow: hidden;
  background: var(--bg-elevated);
  position: relative;
}

.cast-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.cast-card__photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
}

.cast-card__photo-placeholder svg {
  width: 38%;
  max-width: 56px;
  opacity: 0.1;
  fill: var(--text-primary);
}

/* Amber channel strip divider */
.cast-card__strip {
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Data section — sits at natural height at the bottom of the card */
.cast-card__data {
  padding: 6px 9px 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cast-card__pack {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.cast-card__character {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cast-card__actor {
  font-size: 0.67rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.cast-card__notes {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.cast-card__note {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.4;
}

.cast-card__note-icon {
  flex-shrink: 0;
  color: var(--accent-dim);
  margin-top: 0.05em;
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.empty-state__body {
  font-size: 0.72rem;
  line-height: 1.6;
}

/* ─── ================================================================== ─── */
/* ─── ADMIN PANEL (/admin/index.php) ─────────────────────────────────── ─── */
/* ─── ================================================================== ─── */

/* Full-height flex layout */
.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.admin-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.admin-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-head__label {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-prod-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.sidebar-prod-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
  border-left: 2px solid transparent;
  cursor: pointer;
  line-height: 1.3;
}

.sidebar-prod-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-left-color: var(--border-active);
}

.sidebar-prod-link.active {
  border-left-color: var(--accent);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-prod-link__name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-prod-link__count {
  font-size: 0.58rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 400;
}

.sidebar-prod-link.active .sidebar-prod-link__count {
  color: var(--accent-dim);
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── Admin main ──────────────────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
  position: relative;
}

.admin-content {
  padding: 20px;
  max-width: 860px;
}

.admin-content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.admin-prod-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1;
}

.admin-prod-venue {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.admin-content-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Section header */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.section-head__title {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.section-head__count {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ─── Cast List (admin) ───────────────────────────────────────────────────── */
.cast-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cast-row {
  display: grid;
  grid-template-columns: 32px 44px 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: background var(--transition);
  min-height: 52px;
}

.cast-row:hover {
  background: var(--bg-elevated);
}

/* Drag handle */
.cast-row__drag {
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  flex-shrink: 0;
  font-size: 0.9rem;
  transition: color var(--transition);
  user-select: none;
}

.cast-row__drag:active  { cursor: grabbing; }
.cast-row:hover .cast-row__drag { color: var(--text-secondary); }

/* Thumbnail */
.cast-row__thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cast-row__thumb-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
  letter-spacing: 0;
}

/* Info */
.cast-row__info {
  min-width: 0;
}

.cast-row__actor-name {
  font-size: 0.78rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cast-row__character-name {
  font-size: 0.67rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pack number */
.cast-row__pack {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

/* Placement (hidden on small screens) */
.cast-row__placement {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  display: none;
}

@media (min-width: 600px) { .cast-row__placement { display: block; } }

/* Actions */
.cast-row__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Sortable states */
.sortable-ghost {
  opacity: 0.25;
  background: var(--bg-elevated) !important;
}

.sortable-drag {
  opacity: 0.9;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  border-color: var(--accent-dim) !important;
}

/* ─── FAB — Floating Add Button ───────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 150;
  height: 46px;
  padding: 0 18px;
  background: var(--accent);
  border: none;
  color: #0a0a0a;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  border-radius: 0;
}

.fab:hover    { background: #fbbf24; }
.fab:active   { background: #d97706; }

/* ─── Edit Panel (slide-in) ───────────────────────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.panel-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 200ms ease;
  overflow: hidden;
}

.edit-panel.open {
  transform: translateX(0);
}

@media (max-width: 480px) {
  .edit-panel {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 92vh;
    border-left: none;
    border-top: 1px solid var(--border);
    transform: translateY(100%);
  }
  .edit-panel.open { transform: translateY(0); }
}

.edit-panel__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.edit-panel__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1;
}

.edit-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.edit-panel__footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

/* Photo upload zone */
.photo-zone {
  border: 1px dashed var(--accent-dim);
  position: relative;
  transition: border-color var(--transition), background var(--transition);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px;
  cursor: pointer;
  text-align: center;
}

.photo-zone:hover,
.photo-zone.drag-over {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.04);
}

.photo-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  font-size: 0;
}

.photo-zone__label {
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

.photo-zone__hint {
  font-size: 0.58rem;
  color: var(--text-muted);
  pointer-events: none;
}

.photo-zone__preview {
  display: none;
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--border);
  pointer-events: none;
  margin-bottom: 4px;
}

.photo-zone.has-preview .photo-zone__preview {
  display: block;
}

.photo-zone.has-preview .photo-zone__label {
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* ─── Production Modal ────────────────────────────────────────────────────── */
.modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.modal-wrap.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 420px;
  transform: translateY(-6px);
  transition: transform 200ms ease;
}

.modal-wrap.open .modal { transform: translateY(0); }

.modal__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1;
}

.modal__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal__footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--bg-elevated);
}

/* ─── No-production empty view ────────────────────────────────────────────── */
.admin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  text-align: center;
  gap: 14px;
  padding: 40px;
}

.admin-empty__icon {
  font-size: 2.5rem;
  opacity: 0.12;
  margin-bottom: 4px;
  line-height: 1;
}

.admin-empty__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.admin-empty__text {
  font-size: 0.72rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.6;
}

/* ─── Badge ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  line-height: 1.6;
}

.badge--amber  { border-color: var(--accent);  color: var(--accent);  }
.badge--green  { border-color: var(--success); color: var(--success); }
.badge--red    { border-color: var(--danger);  color: var(--danger);  }
.badge--muted  { border-color: var(--border);  color: var(--text-muted); }

/* ─── Divider ─────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
}

/* ─── Responsive — mobile sidebar collapses to top tabs ───────────────────── */
@media (max-width: 767px) {
  .admin-layout {
    flex-direction: column;
    overflow: visible;
  }

  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .admin-sidebar::-webkit-scrollbar { height: 0; }

  .sidebar-head { display: none; }

  .sidebar-prod-list {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
  }

  .sidebar-prod-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 10px 14px;
    flex-shrink: 0;
    height: 44px;
    align-items: center;
  }

  .sidebar-prod-link:hover     { border-left: none; border-bottom-color: var(--border-active); }
  .sidebar-prod-link.active    { border-left: none; border-bottom-color: var(--accent); }

  .sidebar-prod-link__count    { display: none; }

  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    padding: 6px 8px;
    border-top: none;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
    gap: 4px;
  }

  .admin-main {
    overflow: visible;
  }

  .admin-content {
    padding: 14px;
  }
}

/* Touch targets — ensure minimum 44px hit areas */
@media (hover: none) and (pointer: coarse) {
  .btn  { min-height: 44px; }
  .btn--sm { min-height: 36px; }
  .sidebar-prod-link { min-height: 44px; }
  .cast-row__drag    { min-height: 44px; }
}
