@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;0,700;1,600&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light dark;

  /* Light — warm parchment */
  --page: #f5f1ea;
  --panel: #fefcf8;
  --ink: #1c1a16;
  --ink-secondary: #4a4540;
  --muted: #9a9088;
  --line: #e0d9d0;
  --header: #f0ece4;
  --accent: #b87a10;
  --accent-hover: #9a6508;
  --accent-light: rgba(184, 122, 16, 0.12);
  --success: #2d7a4a;
  --success-bg: rgba(45, 122, 74, 0.12);
  --success-light: #4aad6e;
  --warning: #a05c10;
  --warning-bg: rgba(160, 92, 16, 0.12);
  --warning-light: #d47c20;
  --danger: #b52828;
  --danger-bg: rgba(181, 40, 40, 0.1);
  --danger-light: #d94040;
  --info: #1a6a8a;
  --info-bg: rgba(26, 106, 138, 0.1);
  --info-light: #2a8fb0;
  --highlight: rgba(160, 92, 16, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark — cinematic midnight */
    --page: #0e0e12;
    --panel: #15151b;
    --ink: #f0ede6;
    --ink-secondary: #b0aca5;
    --muted: #6a6660;
    --line: #26262f;
    --header: #1a1a22;
    --accent: #d4911e;
    --accent-hover: #e8a428;
    --accent-light: rgba(212, 145, 30, 0.14);
    --success: #3aad68;
    --success-bg: rgba(58, 173, 104, 0.12);
    --success-light: #4acd7e;
    --warning: #d4821e;
    --warning-bg: rgba(212, 130, 30, 0.12);
    --warning-light: #e89c38;
    --danger: #e04848;
    --danger-bg: rgba(224, 72, 72, 0.1);
    --danger-light: #f06060;
    --info: #2aacce;
    --info-bg: rgba(42, 172, 206, 0.1);
    --info-light: #3ac0e0;
    --highlight: rgba(212, 145, 30, 0.07);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
  }

  tr:hover td {
    background: rgba(212, 145, 30, 0.07) !important;
  }

  tr.highlight-first-seen td {
    background: rgba(224, 72, 72, 0.09) !important;
    border-left: 2px solid var(--danger);
  }

  tr.highlight-first-seen:hover td {
    background: rgba(224, 72, 72, 0.15) !important;
  }
}

* {
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  margin: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-size: 14px;
}

/* ─── App shell ────────────────────────────────────────────── */

#appShell {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  grid-row: 1 / -1;
  width: 220px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease, opacity 0.25s ease;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--muted);
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.hamburger-btn:hover {
  background: var(--line);
  color: var(--ink);
}

.hamburger-btn svg {
  width: 16px;
  height: 16px;
}

.nav-section {
  border-bottom: 1px solid var(--line);
}

.nav-section summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.15s;
}

.nav-section summary::-webkit-details-marker { display: none; }

.nav-section summary::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-section[open] summary::before {
  transform: rotate(45deg);
}

.nav-section summary:hover {
  color: var(--ink);
}

.nav-link {
  display: block;
  padding: 8px 16px 8px 30px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--accent-light);
  color: var(--ink-secondary);
}

.nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-links {
  padding-bottom: 8px;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.nav-link-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-left: 2px solid transparent;
}

.nav-link-icon svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ─── Content area ────────────────────────────────────────── */

.content-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.title-bar {
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

h1 {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  line-height: 1;
}

.logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* ─── Account menu ────────────────────────────────────────── */

.account-menu {
  position: relative;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.account-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.account-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 196px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 6px 0;
}

.account-dropdown.open {
  display: block;
}

.account-dropdown-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.account-dropdown-header .account-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.account-dropdown-header .account-email {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.account-dropdown-item:hover {
  background: var(--accent-light);
}

.account-dropdown-item svg {
  width: 15px;
  height: 15px;
  opacity: 0.5;
}

.account-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

/* ─── Report header ───────────────────────────────────────── */

header {
  padding: 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

/* ─── Sidebar overlay (mobile backdrop) ──────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(1px);
}

.sidebar-overlay.visible {
  display: block;
}

/* ─── Responsive: tablet / large phone ───────────────────── */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
  }
  .sidebar.open {
    width: 240px;
    opacity: 1;
    pointer-events: auto;
  }
  .title-bar { padding: 12px 16px; }
  header { padding: 10px 16px; }
  .toolbar { padding: 8px 16px; }
  main { padding: 16px 16px 48px; }
  .page-panel { padding: 20px 16px; }
  .movie-detail-header { padding: 16px 16px 18px; }
}

/* ─── Responsive: medium mobile ──────────────────────────── */

@media (max-width: 640px) {
  .title-text { display: none; }

  #accountLabel,
  .account-btn > svg:last-child { display: none; }
  .account-btn { padding: 4px; border-radius: 50%; gap: 0; }

  .controls button { padding: 6px 12px; font-size: 12px; }
  .date-range-display { font-size: 11px; padding: 5px 10px; }

  .toolbar-filters .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .toolbar-filters .controls label { width: 100%; }
  .toolbar-filters .controls select { width: 100%; }

  table { min-width: 560px; font-size: 11.5px; }
  th, td { padding: 8px 10px; }

  .movie-detail-hero { flex-direction: column; gap: 16px; }
  .movie-poster { width: 80px; }
  .movie-detail-header h2 { font-size: 24px; }

  .settings-toolbar { flex-wrap: wrap; gap: 10px; }
  .status-card { max-width: 100%; }

  .title-bar { padding: 10px 12px; }
  header { padding: 8px 12px; }
  .toolbar { padding: 8px 12px; }
  main { padding: 12px 12px 48px; }
  .page-panel { padding: 16px 12px; }
  .movie-detail-header { padding: 12px 12px 14px; }
}

/* ─── Responsive: small phone ────────────────────────────── */

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .modal-content { padding: 18px 16px 22px; margin: 0 12px; width: auto; }

  .toolbar-filters .controls { grid-template-columns: 1fr; }

  table { min-width: 480px; font-size: 11px; }
  th, td { padding: 7px 8px; }

  .controls button { padding: 5px 10px; font-size: 11.5px; }
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

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

.date-range-display {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 12px;
  color: var(--accent);
  padding: 6px 14px;
  background: var(--accent-light);
  border-radius: 6px;
  border: 1px solid rgba(184, 122, 16, 0.2);
  letter-spacing: 0.03em;
}

.controls label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.controls select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.15s;
}

.controls select:hover {
  border-color: var(--accent);
}

.controls select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.controls button {
  padding: 7px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  letter-spacing: 0.01em;
}

.controls button:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.controls button:active {
  opacity: 0.85;
}

.controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ─── Toolbar ─────────────────────────────────────────────── */

.status {
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--page);
}

.toolbar .status {
  white-space: nowrap;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── Pages ───────────────────────────────────────────────── */

.page {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.page-panel {
  padding: 28px;
}

.page-panel h2 {
  margin: 0 0 20px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.page-panel h3 {
  margin: 28px 0 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ─── Status card ─────────────────────────────────────────── */

.status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 24px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ─── Primary button ──────────────────────────────────────── */

.scan-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}

.scan-btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.scan-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.scan-btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.scan-btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

.scan-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ─── Main content ────────────────────────────────────────── */

main {
  padding: 20px 28px 48px;
}

/* ─── Filter pills ────────────────────────────────────────── */

#filterSummary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--accent-light);
  border: 1px solid rgba(184, 122, 16, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.filter-pill button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.55;
  font-family: inherit;
  transition: opacity 0.15s;
}

.filter-pill button:hover {
  opacity: 1;
}

.filter-clear-all {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.filter-clear-all:hover {
  color: var(--danger);
}

/* ─── Table ───────────────────────────────────────────────── */

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  box-shadow: var(--shadow-lg);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 920px;
  font-size: 12.5px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

th {
  cursor: pointer;
  position: sticky;
  top: 0;
  background: var(--header);
  z-index: 10;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  transition: color 0.15s;
}

th:hover {
  color: var(--accent);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

tr:hover td {
  background: var(--accent-light) !important;
}

tr.highlight-first-seen td {
  background: var(--danger-bg) !important;
  border-left: 2px solid var(--danger);
}

tr.highlight-first-seen:hover td {
  background: rgba(181, 40, 40, 0.15) !important;
}

th.sort-asc::after {
  content: " ↑";
  color: var(--accent);
}

th.sort-desc::after {
  content: " ↓";
  color: var(--accent);
}

/* ─── Badges ──────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ─── Offer types ─────────────────────────────────────────── */

.offer-type-pest {
  color: #7c3aed;
  font-weight: 600;
}

.offer-type-pvod {
  color: #2563eb;
  font-weight: 600;
}

.offer-type-vod {
  color: #0891b2;
  font-weight: 600;
}

.offer-type-est {
  color: #059669;
  font-weight: 600;
}

.offer-type-svod {
  color: #e11d48;
  font-weight: 600;
}

.offer-type-theatrical {
  color: #d97706;
  font-weight: 600;
}

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

/* ─── Login splash ────────────────────────────────────────── */

.login-splash {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--page);
  position: relative;
  overflow: hidden;
}

.login-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 25%, rgba(184, 122, 16, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 75%, rgba(184, 122, 16, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.login-splash-content {
  text-align: center;
  max-width: 340px;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
}

.login-splash-logo {
  width: 56px;
  height: 56px;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.login-splash-title {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.5rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.login-splash-subtitle {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 0.8125rem;
}

.login-splash-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 2.5rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-splash-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(184, 122, 16, 0.3);
  transform: translateY(-1px);
}

/* ─── Settings toolbar ────────────────────────────────────── */

.settings-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

/* ─── Modal ───────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 28px 28px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 {
  margin: 0 0 20px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

/* ─── Form grid ───────────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.form-grid input,
.form-grid select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--page);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.form-actions button[type="button"] {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.form-actions button[type="button"]:hover {
  background: var(--header);
  border-color: var(--muted);
}

/* ─── Action buttons ──────────────────────────────────────── */

.action-btn {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--ink-secondary);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  margin-right: 4px;
}

.action-btn:hover:not(:disabled) {
  border-color: var(--muted);
  background: var(--header);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.action-btn-scan {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(184, 122, 16, 0.25);
}

.action-btn-scan:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.action-btn-edit {
  background: rgba(34, 139, 70, 0.12);
  color: #228b46;
  border-color: rgba(34, 139, 70, 0.25);
}

.action-btn-edit:hover {
  background: #14532d;
  color: #fff;
  border-color: #14532d;
}

.action-btn-delete {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(181, 40, 40, 0.2);
}

.action-btn-delete:hover {
  background: #991b1b;
  color: #fff;
  border-color: #991b1b;
}

/* ─── Go button (deeplink) ────────────────────────────────── */

.btn.btn-sm {
  padding: 3px 10px;
  border: 1px solid rgba(184, 122, 16, 0.3);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn.btn-sm:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Pagination ──────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ─── Tooltips ────────────────────────────────────────────── */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--page);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Movie title link (in table) ────────────────────────── */

.movie-title-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  white-space: normal;
  transition: opacity 0.15s;
}

.movie-title-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* ─── Movie detail page ───────────────────────────────────── */

.movie-detail-header {
  padding: 20px 28px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  letter-spacing: 0.02em;
}

.back-btn:hover {
  background: var(--header);
  border-color: var(--muted);
  color: var(--ink);
}

.movie-detail-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.movie-poster-wrap {
  flex-shrink: 0;
}

.movie-poster {
  width: 110px;
  border-radius: 6px;
  display: block;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.movie-detail-info {
  flex: 1;
  min-width: 0;
}

.movie-overview {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.65;
  max-width: 620px;
}

.movie-detail-header h2 {
  margin: 0 0 18px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.movie-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.movie-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 110px;
}

.movie-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.movie-meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
}

.movie-detail-body {
  flex: 1;
}

/* ─── Export bar ──────────────────────────────────────────── */

#exportBar {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
