/* =============================================================================
   RSP Retouching SAMS — Design System
   Dark sidebar, warm neutral content, photography-industry aesthetic
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Custom Properties
   ----------------------------------------------------------------------------- */
:root {
  /* Sidebar */
  --sidebar-width: 220px;
  --sidebar-bg: #0d0d0d;
  --sidebar-border: #1f1f1f;
  --sidebar-text: #8a8a8a;
  --sidebar-text-hover: #e8e8e8;
  --sidebar-active-bg: #1a1a1a;
  --sidebar-active-text: #ffffff;
  --sidebar-section-label: #3d3d3d;
  --sidebar-accent: #c9a55a;

  /* Content */
  --content-bg: #f5f4f1;
  --topbar-bg: #ffffff;
  --topbar-border: #ebebeb;

  /* Cards */
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --card-radius: 8px;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --text-primary: #111111;
  --text-secondary: #5c5c5c;
  --text-tertiary: #9a9a9a;

  /* Borders */
  --border: #e3e3e0;
  --border-light: #f0efed;

  /* Accent */
  --accent: #c9a55a;
  --accent-hover: #b89248;
  --accent-light: #fdf6e8;

  /* Status badges */
  --badge-studio-bg: #e8effe;
  --badge-studio-text: #2553c0;
  --badge-natural-bg: #e3f5ec;
  --badge-natural-text: #166634;
  --badge-mixed-bg: #fef5e0;
  --badge-mixed-text: #92580a;
  --badge-flat-bg: #f0f0f0;
  --badge-flat-text: #555553;
  --badge-dynamic-bg: #fde8f5;
  --badge-dynamic-text: #8b1a6b;

  /* Inputs */
  --input-border: #d4d3d0;
  --input-focus: #c9a55a;
  --input-bg: #ffffff;

  /* Danger */
  --danger: #dc2626;
  --danger-bg: #fef2f2;

  /* Success */
  --success: #16a34a;
  --success-bg: #f0fdf4;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--content-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* -----------------------------------------------------------------------------
   Login Page
   ----------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,165,90,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.02) 0%, transparent 50%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 12px;
  padding: 48px 40px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.login-brand-sub {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-brand-divider {
  width: 32px;
  height: 2px;
  background: var(--accent);
  margin: 16px auto 0;
}

.login-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-align: center;
}

.login-error {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger);
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.login-form .form-group { margin-bottom: 16px; }

.login-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: border-color 0.15s;
  outline: none;
}

.login-form input:focus {
  border-color: var(--input-focus);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s;
  text-decoration: none;
}

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

.btn-primary.full-width { width: 100%; margin-top: 8px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--danger);
  border: 1.5px solid #fecaca;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-danger:hover { background: var(--danger-bg); }

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid #e8d4a8;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-accent:hover { background: #f5e9cc; }

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  white-space: nowrap;
}

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

/* -----------------------------------------------------------------------------
   Admin Layout — Sidebar + Content
   ----------------------------------------------------------------------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e8e8e8;
}

.sidebar-brand-sub {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sidebar-section-label);
  margin-top: 3px;
}

.sidebar-brand-accent {
  width: 24px;
  height: 2px;
  background: var(--sidebar-accent);
  margin-top: 12px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-section-label);
  padding: 10px 20px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--sidebar-text);
  font-size: 0.85rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.sidebar-link:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255,255,255,0.04);
}

.sidebar-link.active {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  border-left-color: var(--sidebar-accent);
  font-weight: 500;
}

.sidebar-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-link.active .sidebar-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  font-size: 0.78rem;
  color: var(--sidebar-text);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user strong {
  color: #cccccc;
  display: block;
}

.sidebar-logout {
  font-size: 0.75rem;
  color: var(--sidebar-section-label);
  transition: color 0.12s;
}

.sidebar-logout:hover { color: var(--sidebar-text); }

/* Content area */
.admin-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.topbar-role {
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-body {
  padding: 32px;
  flex: 1;
}

/* -----------------------------------------------------------------------------
   Stats Cards — Dashboard
   ----------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-light);
}

.stat-card--clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.stat-card--clickable:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* Section headers */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.section-link {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

.section-link:hover { text-decoration: underline; }

/* Recent items grid */
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.recent-card {
  background: var(--card-bg);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
}

.recent-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #f0efed;
}

.recent-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f0efed 0%, #e8e6e2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recent-card-body {
  padding: 8px 10px;
}

.recent-card-sku {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-card-date {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--card-radius);
}

/* -----------------------------------------------------------------------------
   Hero Upload Page
   ----------------------------------------------------------------------------- */
.upload-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

.upload-zone-wrap {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-light);
  padding: 32px;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  position: relative;
}

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

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

.upload-zone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-tertiary);
}

.upload-zone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upload-zone-sub {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.upload-zone-sub span {
  color: var(--accent);
  font-weight: 500;
}

.upload-preview {
  margin-top: 20px;
  display: none;
}

.upload-preview.visible { display: block; }

.upload-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 6px;
  background: #f0efed;
}

.upload-preview-name {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
}

.upload-file-count {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 10px;
  text-align: center;
}

.upload-folder-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px auto 0;
  padding: 7px 16px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.upload-folder-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Upload form panel */
.upload-form-panel {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-light);
  padding: 28px;
}

.panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

/* Forms */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--input-border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--input-focus);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Upload success banner */
.upload-success {
  background: var(--success-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--card-radius);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.upload-success-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f0efed;
}

.upload-success-text {}

.upload-success-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--success);
  margin-bottom: 3px;
}

.upload-success-sku {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-success-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Alert banners */
.alert {
  padding: 12px 18px;
  border-radius: var(--card-radius);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
}

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

/* Edit page image panel */
.edit-image-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.edit-image-preview {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #f5f4f2;
  cursor: pointer;
  display: block;
}

.edit-image-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.82rem;
  background: #f5f4f2;
}

.edit-image-caption {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  padding: 8px;
  text-align: center;
}

.edit-meta-list {
  display: flex;
  gap: 20px;
  padding: 14px 0 4px;
}

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

.edit-meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.edit-meta-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Hex color swatch preview */
.hex-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hex-input-wrap input {
  flex: 1;
}

.hex-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
  display: none;
}

/* -----------------------------------------------------------------------------
   Swatch Library
   ----------------------------------------------------------------------------- */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.filter-search {
  flex: 1;
  position: relative;
}

.filter-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.filter-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--input-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.filter-search input:focus { border-color: var(--input-focus); }

.filter-select select {
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--input-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9a9a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.filter-select select:focus { border-color: var(--input-focus); }

.filter-count {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Swatch grid */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.swatch-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.15s, transform 0.12s;
}

.swatch-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.swatch-card-img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  background: #f0efed;
}

.swatch-card-img-placeholder {
  width: 100%;
  aspect-ratio: 3/2;
  background: linear-gradient(135deg, #ede9e3 0%, #ddd9d3 50%, #e5e1db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa49d;
  font-weight: 600;
}

.swatch-card-body {
  padding: 12px 14px;
}

.swatch-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.swatch-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 7px;
}

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

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

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

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

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

.swatch-card-sku {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -----------------------------------------------------------------------------
   Client Portal
   ----------------------------------------------------------------------------- */
.client-layout {
  min-height: 100vh;
  background: var(--content-bg);
}

.client-header {
  background: #0d0d0d;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.client-header-brand {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e8e8e8;
}

.client-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.82rem;
  color: #888;
}

.client-header-user { color: #aaa; }

.client-header-logout {
  color: #666;
  font-size: 0.78rem;
  transition: color 0.12s;
}

.client-header-logout:hover { color: #aaa; }

.client-header-accent {
  width: 1px;
  height: 16px;
  background: #2a2a2a;
}

.client-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px;
}

.client-welcome {
  margin-bottom: 36px;
}

.client-welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.client-welcome-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.sku-section {
  margin-bottom: 40px;
}

.sku-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sku-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.sku-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sku-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--border-light);
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: auto;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.asset-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
}

.asset-card-img-wrap {
  position: relative;
  overflow: hidden;
}

.asset-card-img {
  width: 100%;
  aspect-ratio: 19/15;
  object-fit: cover;
  background: #f0efed;
  display: block;
  transition: transform 0.2s;
}

.asset-card:hover .asset-card-img { transform: scale(1.02); }

.asset-card-img-placeholder {
  width: 100%;
  aspect-ratio: 19/15;
  background: linear-gradient(135deg, #f0efed 0%, #e5e2dd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b0a99f;
}

.asset-card-body {
  padding: 12px 16px 14px;
}

.asset-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.asset-card-date {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.asset-card-actions { display: flex; gap: 8px; }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s;
  text-decoration: none;
}

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

/* No-profile state */
.no-profile {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}

.no-profile-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.no-profile-sub { font-size: 0.85rem; }

/* -----------------------------------------------------------------------------
   Page header utility
   ----------------------------------------------------------------------------- */
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-select-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a1a2e;
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 24px 0;
}

/* =============================================================================
   Lightbox
   ============================================================================= */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.18); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  width: 40px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.lightbox-nav:hover  { background: rgba(255,255,255,0.18); }
.lightbox-nav:disabled { opacity: 0.2; cursor: default; pointer-events: none; }

.lightbox-nav--prev { left: 16px; }
.lightbox-nav--next { right: 16px; }

.lightbox-hint {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: rgba(255,255,255,0.38);
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
}

.lightbox-stage {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 20px 44px;
  box-sizing: border-box;
}

.lightbox-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.lightbox-frame img {
  max-width: 92vw;
  max-height: calc(100vh - 116px);
  object-fit: contain;
  display: block;
  border-radius: 4px;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

/* Zoom / pan mode — switch to block so the image starts at scroll origin (0,0).
   Flex justify-content:center offsets the image negatively when it overflows,
   which makes scroll position calculations unreliable. */
.lightbox-frame.zoomed {
  display: block;
  overflow: auto;
  max-width: 92vw;
  max-height: calc(100vh - 116px);
}

.lightbox-frame.zoomed img {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: grab;
  border-radius: 0;
  margin: 0;
}

.lightbox-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
  pointer-events: none;
}

.lightbox-caption {
  color: rgba(255,255,255,0.45);
  font-size: 0.78rem;
  white-space: nowrap;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-counter {
  color: rgba(255,255,255,0.3);
  font-size: 0.72rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

[data-lightbox] { cursor: zoom-in; }


/* =============================================================================
   Heroes Gallery Modal
   ============================================================================= */

.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
}

.gallery-modal.active { display: flex; }

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
}

.gallery-modal-dialog {
  position: relative;
  z-index: 5;
  background: var(--content-bg);
  width: min(1100px, 96vw);
  max-height: 92vh;
  margin-top: 4vh;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gallery-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.gallery-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gallery-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.gallery-modal-close:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.gallery-modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.gallery-thumb {
  background: var(--card-bg);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
}

.gallery-thumb-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: #f0efed;
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.gallery-thumb-img:hover { opacity: 0.88; }

.gallery-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f0efed 0%, #e8e6e2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gallery-thumb-label {
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-thumb-badge {
  padding: 0 8px 6px;
  line-height: 1;
}

.gallery-loading {
  padding: 60px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.gallery-empty {
  padding: 60px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.gallery-empty a { color: var(--accent); }

/* Select mode header */
.gallery-modal-header--select {
  background: #1a1a2e;
}

.gallery-modal-header--select .gallery-modal-title {
  color: #fff;
}

/* Select button */
.gallery-select-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

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

/* Cancel select button */
.gallery-cancel-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 0.8rem;
  color: #fff;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.gallery-cancel-btn:hover { background: rgba(255,255,255,0.15); }

/* Danger button */
.btn-danger {
  background: #c0392b;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-danger:hover:not(:disabled) { background: #a93226; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

/* Thumbnail select state */
.gallery-thumb {
  position: relative;
}

.gallery-thumb-select-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 2px solid rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s;
  color: transparent;
}

[data-select-mode] .gallery-thumb-select-check {
  opacity: 1;
}

[data-select-mode] .gallery-thumb { cursor: pointer; }

.gallery-thumb.selected .gallery-thumb-select-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.gallery-thumb.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--accent);
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}

/* Context menu */
.context-menu {
  position: fixed;
  z-index: 2000;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.08);
  padding: 4px;
  min-width: 160px;
  display: none;
}

.context-menu.active { display: block; }

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 5px;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.context-menu-item:hover { background: var(--border-light); }

.context-menu-item--danger { color: #c0392b; }
.context-menu-item--danger:hover { background: #fdf0ee; }

.context-menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* =============================================================================
   Calibration
   ============================================================================= */

/* Profile list */
.cal-profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.cal-profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cal-profile-img-wrap { background: #f5f4f2; }

.cal-profile-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.cal-profile-img-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.cal-profile-body {
  padding: 16px;
  flex: 1;
}

.cal-profile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.cal-profile-date {
  font-size: 0.74rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.cal-profile-ppi {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.cal-ppi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cal-ppi-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-profile-detail {
  font-size: 0.74rem;
  color: var(--text-tertiary);
}

/* Mark page layout */
.cal-mark-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .cal-mark-layout { grid-template-columns: 1fr; }
}

.cal-mark-image-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-mark-instructions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-mark-step {
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
}

/* Canvas wrap */
.cal-canvas-wrap {
  position: relative;
  display: block;
  line-height: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #1a1a1a;
}

.cal-image {
  display: block;
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.cal-canvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
}

/* PPI preview bar */
.cal-ppi-preview {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cal-ppi-preview-label {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.cal-ppi-preview-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.cal-ppi-preview-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.cal-ppi-preview-detail {
  font-size: 0.74rem;
  color: var(--text-tertiary);
  margin-left: 4px;
}

/* Form side panel */
.cal-mark-form-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: 24px;
}

.cal-mark-cc-info {
  background: var(--accent-light);
  border: 1px solid #e8d4a8;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.cal-mark-cc-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 3px;
}

.cal-mark-cc-value {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-mark-cc-dims {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Corner status dots */
.cal-corner-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.cal-corner-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cal-corner-dot-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-tertiary);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-corner-dot-label { flex: 1; }

.cal-corner-dot-check {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.panel-box {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
}

/* =============================================================================
   Pipeline Page
   ============================================================================= */

.pipeline-builder {
  display: grid;
  grid-template-columns: 1fr 1fr 300px;
  gap: 16px;
  margin-bottom: 32px;
  align-items: start;
}

.pipeline-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pipeline-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
}

.pipeline-panel-step {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pipeline-panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pipeline-panel-subtitle {
  font-size: 0.76rem;
  color: var(--text-tertiary);
  padding: 4px 16px 10px;
}

/* Gallery within pipeline panels */
.pipeline-gallery {
  overflow-y: auto;
  max-height: 340px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.pipeline-gallery-thumb {
  border-radius: 6px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  background: var(--border-light);
}

.pipeline-gallery-thumb:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.pipeline-gallery-thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.pipeline-gallery-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.pipeline-gallery-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

.pipeline-gallery-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  padding: 4px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Settings panel */
.pipeline-panel--settings {
  padding: 0 0 16px;
}

.pipeline-panel--settings .pipeline-panel-subtitle {
  display: none;
}

.pipeline-selection-summary {
  margin: 12px 16px 0;
  background: var(--border-light);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-selection-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.pipeline-selection-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  width: 48px;
}

.pipeline-selection-value {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-selection-empty {
  color: var(--text-tertiary);
  font-style: italic;
  font-weight: 400;
}

/* Output formats */
.pipeline-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.pipeline-format-option {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.pipeline-format-option input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* Pipeline panel form-group padding */
.pipeline-panel--settings .form-group {
  padding: 0 16px;
}

/* ── Jobs history ──────────────────────────────────────────────────────────── */
.pipeline-jobs-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.pipeline-jobs-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-light);
}

.pipeline-jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.pipeline-jobs-table thead th {
  background: var(--border-light);
  padding: 8px 12px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
}

.pipeline-jobs-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.pipeline-jobs-table tbody tr:last-child td {
  border-bottom: none;
}

.pipeline-job-thumb-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-job-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.pipeline-job-thumb-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--border-light);
  flex-shrink: 0;
}

.pipeline-job-name {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status badges */
.pipeline-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.pipeline-status-pending   { background: #f3f3f0; color: var(--text-secondary); }
.pipeline-status-masking   { background: #fff8e1; color: #b07800; }
.pipeline-status-replacing { background: #e8f0fe; color: #2553c0; }
.pipeline-status-delivering{ background: #e3f5ec; color: #1a7a40; }
.pipeline-status-complete  { background: #e3f5ec; color: #1a7a40; }
.pipeline-status-failed    { background: #fde8e8; color: #c0251a; }

.pipeline-job-error {
  font-size: 0.68rem;
  color: #c0251a;
  margin-top: 3px;
  cursor: help;
}

/* Format chips */
.pipeline-job-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pipeline-format-chip {
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

/* Output spec row in settings panel */
.pipeline-spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 8px;
  margin-top: 4px;
}

.pipeline-spec-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pipeline-spec-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Spec column in jobs table */
.pipeline-job-spec {
  white-space: nowrap;
}

.pipeline-spec-value {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.pipeline-spec-dpi {
  display: block;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.pipeline-job-date {
  font-size: 0.76rem;
  white-space: nowrap;
}

.pipeline-job-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pipeline-btn-sm {
  font-size: 0.74rem !important;
  padding: 5px 10px !important;
}

.text-tertiary {
  color: var(--text-tertiary);
}

/* Empty state inside jobs container */
#pipeline-jobs-container .empty-state {
  padding: 24px;
}
