@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --font: 'Outfit', system-ui, -apple-system, sans-serif;

  --bg:        #f7f7f9;
  --surface:   #ffffff;
  --surface-2: #f3f3f6;

  --accent:       #d63a3a;
  --accent-hover: #b52e2e;
  --accent-muted: rgba(214, 58, 58, 0.07);

  --text:   #15151a;
  --text-2: #55555e;
  --text-3: #9696a2;

  --border:     #e2e2e8;
  --border-mid: #ceceda;

  --success:        #15803d;
  --success-bg:     #f0fdf4;
  --success-border: #bbf7d0;

  --r:    9px;
  --r-lg: 13px;
  --r-xl: 18px;

  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 54px;
  background: rgba(247, 247, 249, 0.84);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(214, 58, 58, 0.35);
}

.nav-logo svg { width: 14px; height: 14px; fill: #fff; }

.nav-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ─── Nav Tabs ───────────────────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 2px;
}

.nav-tab {
  padding: 4px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: color 150ms var(--ease-std), background 150ms var(--ease-std);
  font-family: var(--font);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1.8;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .nav-tab:hover { color: var(--text); background: rgba(0,0,0,0.03); }
}

.nav-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 140ms var(--ease), opacity 140ms, background 150ms var(--ease-std), border-color 150ms var(--ease-std);
  -webkit-user-select: none;
  user-select: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* Primary — directional left-to-right sweep on hover */
.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.13);
  transform: translateX(-101%);
  transition: transform 220ms var(--ease);
  border-radius: inherit;
  z-index: -1;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled)::before { transform: translateX(0); }
}

/* Secondary */
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover:not(:disabled) { background: var(--border); border-color: var(--border-mid); }
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
}

.btn-lg { padding: 11px 22px; font-size: 14.5px; border-radius: var(--r-lg); font-weight: 700; }
.btn-block { width: 100%; }

/* ─── Page Layout ────────────────────────────────────────────────────────── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 48px;
}

.page-narrow { max-width: 660px; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 3px;
}

/* ─── Stats Strip (asymmetric: first item has accent border-left) ─────────── */
.stats-strip {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  overflow: hidden;
}

.stat-item {
  flex: 1;
  padding: 24px 30px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Intentional asymmetry: first item gets accent left-edge */
.stat-item:first-child {
  border-left: 4px solid var(--accent);
  padding-left: 26px;
  flex: 1.2;
}

.stat-item:last-child { border-right: none; }

.stat-num {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ─── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 6px 11px;
  flex: 1;
  max-width: 280px;
  transition: border-color 180ms var(--ease-std), box-shadow 180ms var(--ease-std);
}

.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.search-wrap svg { color: var(--text-3); flex-shrink: 0; }

.search-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--text);
  width: 100%;
  font-family: var(--font);
}

.search-wrap input::placeholder { color: var(--text-3); }

/* ─── Table ──────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 9px 20px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  animation: rowSlideUp 280ms var(--ease) both;
  transition: background 110ms;
}

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

@media (hover: hover) and (pointer: fine) {
  tbody tr:hover { background: var(--bg); }
}

tbody td {
  padding: 13px 20px;
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

.td-dim { color: var(--text-2); }

/* Staggered row entrance */
tbody tr:nth-child(1)  { animation-delay: 0ms;   }
tbody tr:nth-child(2)  { animation-delay: 30ms;  }
tbody tr:nth-child(3)  { animation-delay: 60ms;  }
tbody tr:nth-child(4)  { animation-delay: 90ms;  }
tbody tr:nth-child(5)  { animation-delay: 120ms; }
tbody tr:nth-child(6)  { animation-delay: 150ms; }
tbody tr:nth-child(7)  { animation-delay: 180ms; }
tbody tr:nth-child(8)  { animation-delay: 210ms; }
tbody tr:nth-child(9)  { animation-delay: 240ms; }
tbody tr:nth-child(10) { animation-delay: 270ms; }
tbody tr:nth-child(n+11) { animation-delay: 300ms; }

/* ─── Badge ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 500;
}

.badge-draft {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.badge-sent {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-draft .badge-dot { background: var(--text-3); }

.badge-sent .badge-dot {
  background: var(--success);
  animation: pulseDot 2.2s ease-in-out infinite;
}

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 72px 40px;
  animation: fadeIn 300ms var(--ease);
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-3);
  max-width: 260px;
  margin: 0 auto;
}

/* ─── Skeleton shimmer ───────────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 5px;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  margin-bottom: 12px;
  animation: fadeIn 250ms var(--ease);
}

.form-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 16px;
}

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

.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }

.form-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.form-label .req { color: var(--accent); margin-left: 2px; }

.form-input {
  padding: 8px 11px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  width: 100%;
  font-family: var(--font);
  transition: border-color 150ms var(--ease-std), box-shadow 150ms var(--ease-std);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input::placeholder { color: var(--text-3); }

/* ─── Autocomplete ───────────────────────────────────────────────────────── */
.ac-wrap { position: relative; }

.ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
  z-index: 50;
  max-height: 210px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transform-origin: top center;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease), visibility 0ms 150ms;
}

.ac-list.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease), visibility 0ms 0ms;
}

.ac-item { padding: 9px 13px; cursor: pointer; transition: background 100ms; }

@media (hover: hover) and (pointer: fine) {
  .ac-item:hover { background: var(--bg); }
}
.ac-name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.ac-email { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* ─── Video Tabs ─────────────────────────────────────────────────────────── */
.video-tabs {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 3px;
  gap: 2px;
  margin-bottom: 14px;
}

.vtab {
  padding: 5px 13px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: background 180ms var(--ease-std), color 180ms var(--ease-std), box-shadow 180ms var(--ease-std);
  font-family: var(--font);
}

.vtab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

/* ─── Upload Zone ────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-mid);
  border-radius: var(--r-lg);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 200ms var(--ease-std), background 200ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .upload-zone:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
  }
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-muted);
}

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

.upload-icon-wrap {
  width: 40px; height: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--text-3);
}

.upload-title { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.upload-hint  { font-size: 12.5px; color: var(--text-3); }
.upload-hint strong { color: var(--accent); }

.file-chosen {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--accent-muted);
  border: 1px solid rgba(214, 58, 58, 0.14);
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--accent);
  display: none;
  text-align: left;
  word-break: break-word;
}

/* ─── Alert ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13.5px;
  margin-bottom: 14px;
  line-height: 1.5;
  animation: slideDown 220ms var(--ease);
}

.alert-error {
  background: rgba(214, 58, 58, 0.07);
  color: #9e2020;
  border: 1px solid rgba(214, 58, 58, 0.18);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

/* ─── Loading Overlay ────────────────────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(247, 247, 249, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  animation: fadeIn 200ms;
}

.loading-overlay.show { display: flex; }

.loading-ring {
  width: 34px; height: 34px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.loading-label { font-size: 14px; color: var(--text-2); font-weight: 500; }

/* ─── Preview / Spot Hero ────────────────────────────────────────────────── */
.spot-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px 36px;
  margin-bottom: 12px;
  animation: fadeIn 280ms var(--ease);
}

.spot-hero-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 5px;
}

.spot-hero-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0;
  line-height: 1.1;
}

.spot-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.spot-meta-item { display: flex; flex-direction: column; gap: 2px; }

.spot-meta-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  font-weight: 600;
}

.spot-meta-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ─── Link Cards ─────────────────────────────────────────────────────────── */
.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 19px 21px;
  margin-bottom: 10px;
  transition: border-color 180ms var(--ease-std);
}

@media (hover: hover) and (pointer: fine) {
  .link-card:hover { border-color: var(--border-mid); }
}

.link-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.link-card-title { font-size: 13.5px; font-weight: 600; color: var(--text); }

.link-pill {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-pill-customer {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.14);
}

.link-pill-share {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.link-url {
  font-size: 11.5px;
  color: var(--text-2);
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', ui-monospace, monospace;
  background: var(--bg);
  padding: 9px 12px;
  border-radius: var(--r);
  word-break: break-all;
  line-height: 1.65;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.link-actions { display: flex; gap: 7px; }

/* ─── Action Bar ─────────────────────────────────────────────────────────── */
.action-bar {
  position: sticky;
  bottom: 0;
  background: rgba(247, 247, 249, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
  padding: 13px 48px;
}

.action-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ─── Toast — centered pill ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: #f8f8fa;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Keyframes ──────────────────────────────────────────────────────────── */
@keyframes rowSlideUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.2); }
  50%       { box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.08); }
}

/* ─── Incomplete badge ───────────────────────────────────────────────────── */
.badge-incomplete {
  background: #fff8ec;
  color: #92400e;
  border: 1px solid #fed7aa;
}
.badge-incomplete .badge-dot { background: #d97706; }

/* ─── Inline edit form (preview page) ───────────────────────────────────── */
.spot-edit-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-top: 14px;
  animation: slideDown 200ms var(--ease);
}

.spot-edit-section .form-grid { grid-template-columns: 1fr 1fr 1fr; }

/* ─── Import Step 1 ─────────────────────────────────────────────────────── */
.import-file-zone {
  border: 2px dashed var(--border-mid);
  border-radius: var(--r-xl);
  padding: 52px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms var(--ease-std), background 200ms var(--ease-std), transform 200ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .import-file-zone:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
  }
}

.import-file-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-muted);
  transform: scale(1.01);
}

.col-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.col-chip {
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
  font-family: var(--font);
}
.col-chip.req {
  background: var(--accent-muted);
  border-color: rgba(214,58,58,0.2);
  color: var(--accent);
}
.col-chip.req::after { content: ' *'; font-weight:700; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.step-in { animation: stepIn 240ms var(--ease) both; }

/* ─── Import Modal ───────────────────────────────────────────────────────── */
.import-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 160ms;
}

.import-modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 1000px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 72px rgba(0,0,0,0.18), 0 0 0 1px var(--border);
  animation: modalIn 240ms var(--ease) both;
}

.import-modal-head {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.import-modal-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.import-modal-hint {
  font-size: 12.5px;
  color: var(--text-3);
  margin-left: auto;
}

.import-modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  flex-shrink: 0;
  transition: background 120ms;
}
@media (hover: hover) and (pointer: fine) {
  .import-modal-close:hover { background: var(--bg); }
}

.import-table-wrap {
  overflow: auto;
  flex: 1;
}

.import-table {
  width: 100%;
  border-collapse: collapse;
}

.import-table thead th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}

.import-table tbody tr {
  border-bottom: 1px solid var(--border);
  animation: none;
  transition: background 100ms;
}
.import-table tbody tr:last-child { border-bottom: none; }

@media (hover: hover) and (pointer: fine) {
  .import-table tbody tr:hover { background: var(--bg); }
}
.import-table tbody tr.irow-done  { background: #f0fdf4; }
.import-table tbody tr.irow-error { background: #fff1f1; }

.import-table td { padding: 8px 10px; vertical-align: middle; }

.import-input {
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: var(--font);
  transition: border-color 150ms;
}
.import-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.import-input.narrow { width: 80px; }

.import-video-zone {
  border: 1.5px dashed var(--border-mid);
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  min-width: 130px;
  transition: border-color 150ms, background 150ms;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .import-video-zone:hover { border-color: var(--accent); color: var(--accent); }
}
.import-video-zone.has-video {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
  border-style: solid;
}
.import-video-zone.dragging { border-color: var(--accent); background: var(--accent-muted); }

.irow-stat {
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.irow-stat.done  { color: var(--success); }
.irow-stat.error { color: var(--accent); }
.irow-stat.draft { color: #d97706; }

.import-modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.import-video-count {
  font-size: 13px;
  color: var(--text-3);
  margin-right: auto;
}

/* ─── Table scroll wrapper ───────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }

/* ─── Checkbox column ────────────────────────────────────────────────────── */
.cb-th {
  width: 40px;
  padding: 9px 0 9px 18px !important;
}
.cb-td {
  padding: 0 0 0 18px !important;
  width: 40px;
}
.cb-th input[type="checkbox"],
.cb-td input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  display: block;
}

/* ─── Bulk action bar ────────────────────────────────────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(214, 58, 58, 0.04);
  border-bottom: 1px solid rgba(214, 58, 58, 0.12);
  flex: 1;
  animation: slideDown 150ms var(--ease);
}
.bulk-bar-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.bulk-edit-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-left: 1px solid rgba(214, 58, 58, 0.15);
  border-right: 1px solid rgba(214, 58, 58, 0.15);
  flex-wrap: wrap;
  margin-right: auto;
}
.btn-danger {
  background: #fff1f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover:not(:disabled) { background: #fee2e2; }
}

/* ─── Column Mapping Step (Step 1.5) ────────────────────────────────────── */
.map-table { width: 100%; border-collapse: collapse; }

.map-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}

.map-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

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

.map-col-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.map-preview {
  font-size: 11.5px;
  color: var(--text-3);
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.map-select {
  padding: 5px 8px;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
  min-width: 170px;
}

.map-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.map-select.field-required { border-color: rgba(214,58,58,0.35); background: var(--accent-muted); color: var(--accent); font-weight: 600; }
.map-select.field-skip { color: var(--text-3); }

/* ─── Customer Avatar ────────────────────────────────────────────────────── */
.cust-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 1px solid rgba(214,58,58,0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* ─── Customer profile CRM fields ───────────────────────────────────────── */
.crm-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.crm-row:last-child { border-bottom: none; }
.crm-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  min-width: 110px;
}
.crm-value { color: var(--text-2); flex: 1; }
.crm-value.empty { color: var(--text-3); font-style: italic; }

/* ─── Reduced Motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  tbody tr             { animation: none; opacity: 1; transform: none; }
  .empty               { animation: none; opacity: 1; }
  .alert, .form-section { animation: none; opacity: 1; transform: none; }
  .import-modal        { animation: none; }
  .step-in             { animation: none; opacity: 1; transform: none; }
  .badge-sent .badge-dot { animation: none; }
  .import-file-zone.dragging { transform: none; }
  .ac-list, .ac-list.open { transition: none; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page { padding: 20px; }
  .nav { padding: 0 20px; }
  .action-bar { padding: 12px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-strip { flex-direction: column; }
  .stat-num { font-size: 36px; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); padding: 20px 24px; }
  .stat-item:first-child { flex: 1; padding-left: 20px; }
  .stat-item:last-child { border-bottom: none; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-title { font-size: 24px; }
  .spot-hero-name { font-size: 26px; }
  .spot-hero { padding: 24px; }
  .spot-meta { gap: 16px; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { max-width: none; }
  .nav-title { display: none; }
}
