/* ==========================================================================
   S DIGITAL SHOP (sdigitalshop.com)
   Official Portal Stylesheet • Responsive, Modern, Clean & High Contrast Print
   ========================================================================== */

:root {
  --primary: #123e75;
  --primary-hover: #0c2d58;
  --primary-light: #eaf2fc;
  --accent: #0284c7;
  --accent-green: #059669;
  --accent-green-hover: #047857;
  --accent-amber: #d97706;
  --accent-red: #dc2626;
  --bg-page: #f0f4f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border: #cbd5e1;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* --- App Header --- */
.sds-header {
  background: linear-gradient(135deg, #0d274c 0%, #153e77 100%);
  color: #ffffff;
  padding: 14px 24px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-logo-icon {
  width: 44px;
  height: 44px;
  background: #ffffff;
  color: var(--primary);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: #93c5fd;
  font-weight: 500;
}

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

.clock-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}

.btn-header-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-green);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  transition: background 0.2s ease;
}

.btn-header-wa:hover {
  background: var(--accent-green-hover);
}

/* --- Top Navigation Tabs Bar --- */
.nav-tab-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 72px;
  z-index: 40;
}

.nav-tab-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 6px;
  padding: 8px 20px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 650;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.nav-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

/* --- Main Layout --- */
.main-content {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* --- Universal Panels & Cards --- */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.panel-header {
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   TAB 1: CSC SHORTCUTS
   ========================================================================== */
.shortcuts-filter-bar {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  background: var(--surface);
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
}

.category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cat-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-btn:hover {
  border-color: #94a3b8;
  color: var(--primary);
}

.cat-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.cat-btn.fav-cat.active {
  background: #f59e0b;
  border-color: #f59e0b;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.shortcut-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.shortcut-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.badge-tag {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.fav-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #cbd5e1;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.fav-btn:hover {
  color: #f59e0b;
}

.fav-btn.active {
  color: #f59e0b;
}

.card-title {
  font-size: 16px;
  font-weight: 750;
  color: #0f172a;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
  flex: 1;
}

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

.btn-portal {
  flex: 1;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-portal:hover {
  background: var(--primary-hover);
}

.btn-copy-link {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease;
}

.btn-copy-link:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   TAB 2: SMART PRINT STUDIO
   ========================================================================== */
.smart-print-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.mode-tab-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.mode-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

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

.input-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-slider-row input[type="range"] {
  flex: 1;
}

.input-slider-row input[type="number"] {
  width: 85px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.quick-pos-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}

.btn-small-pos {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 650;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.btn-small-pos:hover {
  background: #e2e8f0;
}

.file-dropzone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  padding: 24px 16px;
  text-align: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 16px;
  display: block;
  transition: background 0.2s, border-color 0.2s;
}

.file-dropzone.drop-active {
  background: #dbeafe !important;
  border-color: var(--primary) !important;
}

.file-dropzone input[type="file"] {
  display: block;
  margin: 10px auto 0;
  font-size: 13px;
}

.id-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.id-cardbox {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--surface-alt);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  outline: none;
}

.id-cardbox:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.id-cardbox.box-selected,
#docPane.box-selected {
  border: 2px solid #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

.cardbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cardbox-title {
  font-weight: 750;
  font-size: 14px;
  color: var(--text-dark);
}

.target-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.target-badge.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.btn-action.primary {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.preview-container {
  background: #e2e8f0;
  border-radius: var(--radius-sm);
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 8px;
  margin: 10px 0;
}

.preview-container img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.tool-buttons-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.btn-action {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 650;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s;
}

.btn-action:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
}

.btn-print-main {
  background: var(--primary);
  color: #ffffff;
  font-size: 16px;
  font-weight: 750;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.btn-print-main:hover {
  background: var(--primary-hover);
}

.btn-send-wa {
  background: var(--accent-green);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-send-wa:hover {
  background: var(--accent-green-hover);
}

/* Multi-Network QR Switcher Chips */
.qr-mode-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.qr-mode-chip {
  flex: 1;
  min-width: 80px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.15s;
}

.qr-mode-chip:hover {
  background: #e2e8f0;
  color: var(--primary);
}

.qr-mode-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-print-standee {
  width: 100%;
  margin-top: 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-print-standee:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* Paper Mini Canvas Preview */
.paper-preview-box {
  background: #334155;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
  text-align: center;
}

.paper-mini {
  width: min(100%, 260px);
  aspect-ratio: 210 / 297;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  margin: 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.paper-mini canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Status alerts */
.status-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
}

.status-alert.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-alert.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Crop Modal */
.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.crop-dialog {
  width: min(960px, 98vw);
  height: min(92vh, 850px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.crop-stage {
  flex: 1;
  min-height: 420px;
  height: 520px;
  background: #0f172a;
  overflow: hidden;
  position: relative;
  margin: 12px 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-stage img#cropImage {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.crop-stage.perspective #cropImage,
.crop-stage.perspective .cropper-container {
  display: none !important;
}

.perspective-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f172a;
}

.perspective-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  z-index: 5;
}

.corner-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.corner-layer svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.corner-handle {
  position: absolute;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  transform: translate(-50%, -50%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  z-index: 30;
}

.corner-handle:active {
  cursor: grabbing;
}

/* Semi-transparent, small, high-precision corner handle ring */
.corner-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  transition: background 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
}

/* Precision center dot so corner underneath is visible with subpixel accuracy */
.corner-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

.corner-handle:hover::after,
.corner-handle:active::after {
  background: rgba(16, 185, 129, 0.55);
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.crop-actions-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-secondary {
  background: #334155;
  color: #ffffff;
  font-weight: 650;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #1e293b;
}

/* ==========================================================================
   TAB 3: PHOTO & SIGN RESIZER
   ========================================================================== */
.resizer-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

/* ==========================================================================
   TAB 5: AGE CALCULATOR
   ========================================================================== */
.age-calc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.age-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.age-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.age-card strong {
  font-size: 28px;
  color: var(--primary);
  display: block;
}

.age-card span {
  font-size: 13px;
  color: var(--text-muted);
}

.eligibility-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.eligibility-table th,
.eligibility-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.elig-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}

.elig-badge.eligible {
  background: #dcfce7;
  color: #15803d;
}

.elig-badge.not-eligible {
  background: #fee2e2;
  color: #b91c1c;
}

/* ==========================================================================
   TAB 6: RATE CHART & BILLING
   ========================================================================== */
.rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.rate-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rate-price {
  font-weight: 800;
  color: var(--primary);
  font-size: 15px;
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.billing-table th,
.billing-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.billing-table th {
  background: #f1f5f9;
  text-align: left;
}

/* ==========================================================================
   TAB 7: FORMS LIBRARY
   ========================================================================== */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.form-badge {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 8px;
}

.form-title {
  font-size: 15px;
  font-weight: 750;
  color: #1e293b;
  margin-bottom: 6px;
}

.form-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

.btn-form-download {
  display: block;
  text-align: center;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s;
}

.btn-form-download:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* Toast */
.sds-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 1000;
}

.sds-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.sds-footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  background: #ffffff;
}

/* Print Area (Hidden in screen) */
#printArea {
  display: none;
}

/* ==========================================================================
   HIGH-PRECISION PRINT STYLES (@media print)
   ========================================================================== */
@media print {
  @page {
    size: auto;
    margin: 0;
  }
  body > * {
    display: none !important;
  }
  #printArea {
    display: block !important;
    background: #ffffff;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  #printArea img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
  }
  #printArea .sheet {
    width: 210mm;
    height: 297mm;
    page-break-after: always;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
  }
  #printArea .sheet img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .smart-print-grid,
  .passport-studio-grid,
  .resizer-grid {
    grid-template-columns: 1fr;
  }
  .id-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PASSPORT PHOTO STUDIO STYLES
   ========================================================================== */
.passport-studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}

.passport-controls-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.passport-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.passport-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.passport-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.passport-dropzone:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.passport-preset-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.passport-preset-btn {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.passport-preset-btn:hover {
  background: #e2e8f0;
}

.passport-preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.passport-face-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.passport-face-guide.hidden {
  display: none !important;
}

.face-guide-head {
  width: 140px;
  height: 190px;
  border: 2px dashed rgba(56, 189, 248, 0.85);
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.face-guide-eyes {
  position: absolute;
  top: 48%;
  left: 20%;
  right: 20%;
  height: 1px;
  border-top: 1px dashed rgba(251, 191, 36, 0.7);
}

.face-guide-chin {
  position: absolute;
  top: 68%;
  left: 35%;
  right: 35%;
  height: 1px;
  border-top: 1.5px solid rgba(239, 68, 68, 0.8);
}

.face-guide-label {
  position: absolute;
  bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

.passport-color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.swatch-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.swatch-btn:hover {
  transform: scale(1.08);
}

.swatch-btn.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.swatch-check {
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.swatch-name {
  font-size: 8px;
  font-weight: 700;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.swatch-custom {
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  color: #ffffff;
}

.passport-qty-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.passport-qty-btn {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.passport-qty-btn:hover {
  background: #e2e8f0;
}

.passport-qty-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.grad-swatch-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.grad-swatch-btn:hover {
  transform: scale(1.08);
}

.grad-swatch-btn.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}


/* ==========================================================================
   S DIGITAL SHOP STYLE EXTENSIONS: PDF TOOLS & PVC ID CARD STUDIO
   ========================================================================== */

/* Subtab navigation in PDF Tools */
.pdf-subtab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pdf-subtab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-radius: 6px 6px 0 0;
}

.pdf-subtab-btn:hover {
  color: var(--primary);
  background: var(--surface-alt);
}

.pdf-subtab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}

/* Drag and Drop Zone */
.pdf-drop-zone {
  border: 2px dashed #93c5fd;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdf-drop-zone:hover,
.pdf-drop-zone.dragover {
  background: #dcfce7;
  border-color: #22c55e;
  transform: scale(1.01);
}

/* Img2Pdf Grid & Cards */
.img2pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.img2pdf-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.img2pdf-card:hover {
  box-shadow: var(--shadow-md);
}

.img2pdf-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  z-index: 2;
}

.img2pdf-thumb-wrap {
  width: 100%;
  height: 140px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img2pdf-thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.img2pdf-meta {
  padding: 6px 2px 2px;
}

.img2pdf-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.img2pdf-size {
  font-size: 11px;
  color: var(--text-muted);
}

.img2pdf-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  justify-content: flex-end;
}

.btn-sub-action {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sub-action:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-sub-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-sub-action.text-danger {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.btn-sub-action.text-danger:hover {
  background: #fee2e2;
}

/* PDF Merge List Rows */
.pdf-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.pdf-queue-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}

.pdf-row-order {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 8px;
  border-radius: 12px;
}

.pdf-row-icon {
  font-size: 22px;
}

.pdf-row-details {
  flex: 1;
  min-width: 0;
}

.pdf-row-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.pdf-row-info {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}

.pdf-row-actions {
  display: flex;
  gap: 6px;
}

/* PDF to JPG Grid */
.pdf2img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pdf2img-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.pdf2img-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.pdf2img-preview-wrap {
  width: 100%;
  height: 220px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf2img-preview-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pdf2img-actions {
  margin-top: 8px;
}

/* ==========================================================================
   PVC ID CARD STUDIO STYLING
   ========================================================================== */
.pvc-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}

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

.pvc-slots-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.pvc-slot-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.pvc-slot-thumb {
  width: 100%;
  height: 110px;
  background: #e2e8f0;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}

.btn-lock-ratio {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-lock-ratio.locked {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #93c5fd;
}


/* ==========================================================================
   S DIGITAL SHOP STYLE PASSPORT STUDIO: SIDE-BY-SIDE LIVE PREVIEW & TOOLS
   ========================================================================== */

.passport-studio-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1.35fr) minmax(360px, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 980px) {
  .passport-studio-layout {
    grid-template-columns: 1fr;
  }
}

/* Sticky Live Preview Stage (Left Column) */
.passport-preview-stage {
  position: sticky;
  top: 75px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 980px) {
  .passport-preview-stage {
    position: relative;
    top: 0;
  }
}

.preview-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.zoom-ctrls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 6px;
}

.btn-zoom {
  background: transparent;
  border: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  color: var(--text-main);
}

.btn-zoom:hover {
  color: var(--primary);
}

/* Blueprint / Dotted Stage for Sheet Canvas */
.passport-canvas-box {
  background: #0f172a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 16px 16px;
  min-height: 440px;
  max-height: 600px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
  padding: 16px;
}

#passportLiveCanvas {
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
}

/* Tools Sidebar (Right Column) */
.passport-tools-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tool-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Remove BG Button (S Digital Shop Blue Button) */
.btn-remove-bg {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.btn-remove-bg:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

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

.btn-remove-bg:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Auto Crop ID Card Button */
.btn-auto-crop-id {
  width: 100%;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all 0.2s ease;
  margin-top: 8px;
}

.btn-auto-crop-id:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
}

/* Color Circles */
.bg-color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.swatch-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}

.swatch-circle:hover {
  transform: scale(1.1);
}

.swatch-circle.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.swatch-circle .check {
  font-size: 13px;
  font-weight: 800;
  display: none;
}

.swatch-circle.active .check {
  display: block;
}

/* Feather / Softness Slider Badge */
.val-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: 8px;
}
