/* ============================================================
   Auto-Print Xerox — Clean Modern White & Crystal Glass Theme
   Google Font: Outfit (loaded via PHP header include)
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-body:       #f4f6fb;
  --bg-card:       #ffffff;
  --bg-card-solid: #ffffff;
  --bg-sidebar:    #ffffff;
  --bg-subtle:     #f8fafc;

  --accent:        #6366f1;
  --accent-light:  #818cf8;
  --accent-dark:   #4f46e5;
  --accent-cyan:   #0284c7;
  --accent-glow:   rgba(99, 102, 241, 0.25);

  --success:       #10b981;
  --success-bg:    #ecfdf5;
  --warning:       #f59e0b;
  --warning-bg:    #fffbeb;
  --danger:        #ef4444;
  --danger-bg:     #fef2f2;
  --info:          #0ea5e9;
  --info-bg:       #f0f9ff;

  --text:          #0f172a;
  --text-muted:    #475569;
  --text-dim:      #64748b;

  --border:        #e2e8f0;
  --border-accent: rgba(99, 102, 241, 0.4);
  --border-glass:  rgba(255, 255, 255, 0.8);

  --shadow:        0 10px 30px -5px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(226, 232, 240, 0.8);
  --shadow-sm:     0 4px 15px rgba(15, 23, 42, 0.05);
  --shadow-lg:     0 20px 45px -10px rgba(15, 23, 42, 0.12);
  --radius:        18px;
  --radius-sm:     12px;
  --radius-xs:     6px;

  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-body);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

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

img { max-width: 100%; }

/* ── Soft Clean Ambient Background ─────────────────────────── */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    var(--bg-body);
}

/* ── Glass Card (Clean White) ──────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.glass-card:hover {
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.25);
}

/* ── Brand Header ──────────────────────────────────────────── */
.brand-header {
  text-align: center;
  padding: 1.8rem 0 1.2rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 18px var(--accent-glow);
  color: #fff;
}

.brand-name {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.brand-tagline {
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ── Step Indicator ────────────────────────────────────────── */
.steps-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 1rem auto 2rem;
  max-width: 520px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: var(--border);
  z-index: 0;
  transition: var(--transition);
}

.step-item.done:not(:last-child)::after,
.step-item.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--accent), var(--border));
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  background: #ffffff;
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.step-item.active .step-circle {
  border-color: var(--accent);
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  box-shadow: 0 4px 15px var(--accent-glow);
}

.step-item.done .step-circle {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--accent-dark); }
.step-item.done .step-label   { color: var(--success); }

/* ── Section Title ─────────────────────────────────────────── */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Upload Drop Zone ──────────────────────────────────────── */
.drop-zone {
  border: 2px dashed #818cf8;
  border-radius: var(--radius);
  padding: 2.8rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #eef2ff;
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-dark);
  background: #e0e7ff;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

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

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
}

.drop-zone-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 0.4rem;
}

.drop-zone-sub {
  color: #475569;
  font-size: 0.88rem;
}

.file-types {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.file-type-badge {
  background: #ffffff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* ── Options Page Controls ─────────────────────────────────── */
.option-group label.option-label,
.option-group .option-label-sm {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.option-btn-group {
  display: flex;
  gap: 0.5rem;
}

.opt-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #334155;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.opt-btn:hover {
  border-color: var(--accent-light);
  color: var(--accent-dark);
  background: #f8faff;
}

.opt-btn.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #3730a3;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--accent), 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Number Input */
.number-input-wrap {
  display: flex;
  align-items: center;
  width: 140px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.number-input-wrap button {
  width: 40px;
  height: 40px;
  border: none;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.number-input-wrap button:hover {
  background: #e0e7ff;
  color: #4338ca;
}

.number-input-wrap input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  color: #0f172a;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0 0.2rem;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.number-input-wrap input::-webkit-outer-spin-button,
.number-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Price Summary Card */
.price-summary {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.92rem;
}

.price-row .label { color: #64748b; font-weight: 500; }
.price-row .value { font-weight: 700; color: #1e293b; }

.price-total {
  border-top: 1.5px solid #cbd5e1;
  margin-top: 0.6rem;
  padding-top: 0.8rem;
}

.price-total .label { font-weight: 800; color: #0f172a; font-size: 1.05rem; }

.price-total .value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #4338ca;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-glow {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border: none;
  color: #ffffff !important;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.btn-glow:active { transform: translateY(0); }

.btn-glow:disabled {
  opacity: 0.6;
  pointer-events: none;
  box-shadow: none;
}

.btn-outline {
  background: #ffffff;
  border: 1.5px solid #c7d2fe;
  color: #4338ca;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline:hover {
  background: #eef2ff;
  border-color: #818cf8;
  color: #3730a3;
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  border: none;
  color: #fff;
  padding: 0.85rem 2.2rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-view-pages {
  background: linear-gradient(135deg, #4f46e5, #0284c7);
  color: #ffffff !important;
  border: none;
  padding: 0.75rem 1.2rem;
  border-radius: 30px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
  transition: var(--transition);
  width: 100%;
}

.btn-view-pages:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45);
  background: linear-gradient(135deg, #4338ca, #0369a1);
}

/* ── File Browser in Options ───────────────────────────────── */
.file-browser {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 0.3rem;
  margin-bottom: 0.75rem;
}

.file-browser::-webkit-scrollbar { width: 5px; }
.file-browser::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.file-item:hover { border-color: #818cf8; background: #eef2ff; }
.file-item.active {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 1px #6366f1;
}

.file-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.file-thumb img { width: 100%; height: 100%; object-fit: cover; }

.file-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.file-badge { font-size: 0.68rem; color: #64748b; font-weight: 600; }

/* ── Live Preview Section ──────────────────────────────────── */
.live-preview-section {
  background: #f1f5f9;
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid #e2e8f0;
}

.paper-frame {
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  aspect-ratio: 1 / 1.414;
  width: 100%;
  max-width: 190px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.paper-frame.landscape { aspect-ratio: 1.414 / 1; max-width: 260px; }

.paper-img {
  width: 92%; height: 92%; object-fit: contain;
  transition: filter 0.3s ease;
}
.paper-img.grayscale { filter: grayscale(100%); }

.paper-canvas {
  width: 92%;
  height: 92%;
  object-fit: contain;
  transition: filter 0.3s ease;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.paper-canvas.grayscale {
  filter: grayscale(100%) contrast(1.1);
}

.paper-pdf-pager {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  color: #fff;
  border-radius: 20px;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  pointer-events: auto;
}

.paper-page-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 3px;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}
.paper-page-btn:hover {
  color: #60a5fa;
  transform: scale(1.25);
}

.pdf-preview-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  text-align: center;
}

.pdf-tool-preview-wrap {
  width: 100%;
  max-width: 160px;
  margin: 0.4rem auto;
  aspect-ratio: 1 / 1.414;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid #cbd5e1;
}
.pdf-tool-preview-wrap canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.3s ease;
}
.pdf-tool-preview-wrap canvas.grayscale {
  filter: grayscale(100%) contrast(1.1);
}

.pdf-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: #475569;
}

.pdf-placeholder-paper {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: #64748b; font-size: 0.75rem; gap: 0.35rem; padding: 1rem;
}
.pdf-placeholder-paper .icon { font-size: 2.2rem; }

.preview-badge {
  font-size: 0.78rem;
  color: #475569;
  text-align: center;
  line-height: 1.4;
}
.preview-badge strong { color: #0f172a; font-weight: 700; }

/* ── Interactive Page Chips ────────────────────────────────── */
.page-grid-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
  padding: 8px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
}

.page-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.page-chip:hover {
  transform: translateY(-1px);
  border-color: #818cf8;
}

.page-chip.selected {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

.page-chip.excluded {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  text-decoration: line-through;
  opacity: 0.7;
}

.btn-mini {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-mini:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
}

/* ════════════════════════════════════════════════════════════
   PDF VISUAL PAGE GALLERY & CUTTER MODAL (WHITE CLEAN THEME)
   ════════════════════════════════════════════════════════════ */
/* ════════════════════════════════════════════════════════════
   PDF VISUAL PAGE GALLERY & CUTTER MODAL (RESPONSIVE & MOBILE-PERFECT)
   ════════════════════════════════════════════════════════════ */
.pdf-gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.pdf-gallery-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  width: 100%;
  max-width: 1000px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.35);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.pdf-gallery-modal.open .pdf-gallery-box {
  transform: scale(1);
}

.pdf-gallery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  gap: 0.75rem;
}

.pdf-gallery-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}

.pdf-gallery-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  display: block;
  margin-top: 0.2rem;
}

.pdf-gallery-close {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.pdf-gallery-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.pdf-gallery-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  gap: 0.6rem;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pdf-gallery-actions::-webkit-scrollbar { height: 3px; }
.pdf-gallery-actions::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.btn-gallery-action {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-gallery-action:hover {
  background: #eef2ff;
  border-color: #818cf8;
  color: #4338ca;
}

.pdf-selected-count-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-gallery-file-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.pdf-gallery-file-tabs::-webkit-scrollbar { height: 3px; }
.pdf-gallery-file-tabs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.pdf-file-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.pdf-file-tab:hover {
  border-color: #6366f1;
  color: #4338ca;
  background: #f8fafc;
}
.pdf-file-tab.active {
  background: #4338ca;
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(67, 56, 202, 0.25);
}

.pdf-file-section {
  margin-bottom: 1.5rem;
}
.pdf-file-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.pdf-file-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-gallery-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem;
  background: #f8fafc;
}

.pdf-gallery-body::-webkit-scrollbar { width: 6px; }
.pdf-gallery-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.pdf-gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 200px;
  color: #475569;
  font-weight: 600;
}

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

.pdf-page-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.6rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  touch-action: manipulation;
  user-select: none;
}

.pdf-page-card:hover {
  transform: translateY(-2px);
  border-color: #818cf8;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.pdf-page-card.selected {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px #10b981, 0 4px 15px rgba(16, 185, 129, 0.12);
}

.pdf-page-card.excluded {
  border-color: #fca5a5;
  background: #fef2f2;
  opacity: 0.65;
  filter: grayscale(80%);
}

.pdf-page-card.excluded:hover {
  opacity: 0.9;
  filter: grayscale(20%);
}

.pdf-page-canvas-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  margin-bottom: 0.5rem;
  border: 1px solid #f1f5f9;
  pointer-events: none;
}

.pdf-page-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block;
}

.pdf-page-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 4px;
}

.pdf-page-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-page-card.selected .pdf-page-badge {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pdf-page-card.excluded .pdf-page-badge {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.pdf-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  gap: 0.75rem;
}

/* ── Mobile Overrides for PDF Gallery ──────────────────────── */
@media (max-width: 768px) {
  .pdf-gallery-modal {
    padding: 0.4rem;
  }
  .pdf-gallery-box {
    height: 96vh;
    max-height: 96vh;
    border-radius: 14px;
  }
  .pdf-gallery-header {
    padding: 0.75rem 0.9rem;
    gap: 0.5rem;
  }
  .pdf-gallery-title {
    font-size: 0.95rem;
  }
  .pdf-gallery-subtitle {
    font-size: 0.72rem;
  }
  .pdf-gallery-actions {
    padding: 0.45rem 0.75rem;
    gap: 0.4rem;
  }
  .btn-gallery-action {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }
  .pdf-selected-count-badge {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
  }
  .pdf-gallery-body {
    padding: 0.6rem;
  }
  .pdf-pages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .pdf-page-card {
    padding: 0.45rem;
  }
  .pdf-gallery-footer {
    padding: 0.6rem 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .pdf-gallery-footer button {
    font-size: 0.8rem;
    padding: 0.45rem 0.8rem;
  }
}

/* ── Crop Modal (White Clean Theme) ────────────────────────── */
.crop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.crop-modal-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  transform: scale(0.96);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.crop-modal-overlay.open .crop-modal-box { transform: scale(1); }

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.crop-modal-title { font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.crop-modal-close { background: none; border: none; color: #64748b; font-size: 1.3rem; cursor: pointer; }
.crop-modal-close:hover { color: #dc2626; }

.crop-canvas-wrap { flex: 1; overflow: hidden; padding: 1rem; background: #0f172a; min-height: 300px; }
.crop-modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.crop-ratio-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.crop-ratio-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #ffffff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.crop-ratio-btn:hover, .crop-ratio-btn.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #eef2ff;
}

/* ── Payment Card ──────────────────────────────────────────── */
.payment-demo-card {
  background: linear-gradient(135deg, #4338ca, #6366f1);
  border-radius: var(--radius);
  padding: 1.8rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.payment-demo-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.8);
}

.payment-demo-amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: #ffffff;
}

.payment-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.8rem;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  font-size: 0.92rem;
  border-bottom: 1px solid #f1f5f9;
}
.order-summary-row .key { color: #64748b; font-weight: 500; }
.order-summary-row .val { font-weight: 700; color: #1e293b; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}
.alert-info  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── Success Page ──────────────────────────────────── */
.success-icon {
  width: 85px;
  height: 85px;
  background: linear-gradient(135deg, #059669, #10b981);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
}

.job-id-display {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}
.job-id-label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; font-weight: 700; }
.job-id-value { font-size: 1.4rem; font-weight: 800; color: #4338ca; letter-spacing: 2px; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  border-top-color: #6366f1;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.divider { border: 0; border-top: 1px solid #e2e8f0; margin: 1rem 0; }

/* ════════════════════════════════════════════════════════════
   ADMIN PANEL LAYOUT & DASHBOARD (WHITE CLEAN THEME)
   ════════════════════════════════════════════════════════════ */

.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-body);
  position: relative;
}

/* ── Admin Sidebar ─────────────────────────────────────────── */
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 1.5rem 1.2rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background: #f8fafc;
}

.sidebar-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.sidebar-brand-sub {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 1.2rem 0.9rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.8px;
  padding: 0.6rem 0.8rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  transition: var(--transition);
  text-decoration: none;
}

.sidebar-link .icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
}

.sidebar-link:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: translateX(2px);
}

.sidebar-link.active {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.1);
}

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* ── Admin Main Content ────────────────────────────────────── */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-body);
}

.admin-topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.admin-topbar h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

/* ── Stat KPI Cards ────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.stat-icon.purple { background: #eef2ff; color: #6366f1; }
.stat-icon.amber  { background: #fffbeb; color: #f59e0b; }
.stat-icon.blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon.green  { background: #ecfdf5; color: #10b981; }
.stat-icon.red    { background: #fef2f2; color: #ef4444; }

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  font-family: 'Outfit', sans-serif;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Data Tables ───────────────────────────────────────────── */
.data-table-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-table-header {
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.data-table-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.ap-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.ap-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ap-table td {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.ap-table tr:last-child td { border-bottom: none; }
.ap-table tr:hover td { background: #f8faff; }

.job-id-cell {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.filename-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-paid, .badge-printed, .badge-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-pending, .badge-queued, .badge-warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-processing, .badge-claimed, .badge-printing, .badge-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-failed, .badge-cancelled, .badge-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* ── Filter Tabs ───────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.filter-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.filter-tab.active {
  background: #4338ca;
  color: #ffffff;
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.2rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.page-link {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  transition: var(--transition);
  text-decoration: none;
}

.page-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.page-link.active {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
}

/* ── Status Timeline & Details ─────────────────────────────── */
.status-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 0.5rem;
  position: relative;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
  flex: 1;
}

.timeline-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #64748b;
  transition: var(--transition);
}

.timeline-step.done .timeline-dot {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
}

.timeline-step.active .timeline-dot {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-step.failed .timeline-dot {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.timeline-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.detail-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.detail-key {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.form-control-ap {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.form-control-ap:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ── Mobile Responsive Overrides ───────────────────────────── */
@media (max-width: 991px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-topbar {
    padding: 0 1rem;
  }

  .admin-content {
    padding: 1.2rem 1rem;
  }
}

/* ── ID Card Studio Modal & Canvas Designer ────────────────── */
.id-studio-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.id-studio-modal.open {
  display: flex;
}

.id-studio-box {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalScale 0.2s ease-out;
}

.id-studio-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
}

.id-studio-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  gap: 1.25rem;
  flex: 1;
}

.id-studio-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.id-card-preview-thumb {
  width: 100%;
  height: 110px;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  margin-bottom: 0.5rem;
}

.id-card-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.id-studio-canvas-wrap {
  background: #0f172a;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

#idStudioA4Canvas {
  max-width: 100%;
  height: auto;
  max-height: 440px;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  background: #ffffff;
}

/* ── Perspective Straightener Modal ───────────────────────── */
.perspective-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 10005;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.perspective-modal-overlay.open {
  display: flex;
}
.perspective-modal-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  animation: modalScaleIn 0.25s ease;
}
.perspective-container {
  position: relative;
  display: inline-block;
  user-select: none;
  touch-action: none;
  max-width: 100%;
  margin: 0 auto;
}
.perspective-pin {
  position: absolute;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  background: radial-gradient(circle, #38bdf8 30%, #0284c7 100%);
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  cursor: grab;
  z-index: 10;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8), 0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #0f172a;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.perspective-pin:active {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow: 0 0 20px rgba(56, 189, 248, 1), 0 4px 10px rgba(0,0,0,0.7);
}
.perspective-pin span {
  pointer-events: none;
}


