/* assets/css/app.css - Lanyard Sublimation Sheet Management System */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-ring: rgba(37, 99, 235, 0.25);
  
  --secondary: #475569;
  --secondary-hover: #334155;
  
  --accent: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.15);
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #2563eb;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sidebar-brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.sidebar-brand-text span {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  padding: 12px 12px 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background-color: var(--bg-sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #334155;
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.admin-info .name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.admin-info .role {
  font-size: 11px;
  color: var(--text-light);
}

.btn-icon-ghost {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-icon-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

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

.page-title-area h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.page-title-area p {
  font-size: 12px;
  color: var(--text-muted);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

/* Common UI Components */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  transition: var(--transition);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--secondary);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-success {
  background-color: var(--success);
  color: #fff;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.stat-12mm::after { background: #3b82f6; }
.stat-card.stat-16mm::after { background: #8b5cf6; }
.stat-card.stat-sheets::after { background: #10b981; }
.stat-card.stat-total::after { background: #f59e0b; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-content .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-content .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
  line-height: 1;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-12mm {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-16mm {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.badge-draft {
  background-color: #f1f5f9;
  color: #475569;
}

.badge-saved {
  background-color: #e0f2fe;
  color: #0369a1;
}

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

/* Form Controls */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: #fff;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Size Selection Cards */
.size-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.size-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
  position: relative;
}

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

.size-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

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

.size-badge {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.size-card.active .size-badge {
  color: var(--primary);
}

.size-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.spec-item strong {
  color: var(--text-main);
  display: block;
}

/* Dropzone */
.dropzone-container {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background-color: #f8fafc;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 24px;
}

.dropzone-container:hover, .dropzone-container.drag-over {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin: 0 auto 12px;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Uploaded Designs List */
.designs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.design-item-card {
  display: grid;
  grid-template-columns: 80px 1fr 140px 140px 50px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.design-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.design-thumb-box {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.design-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.design-meta .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.design-meta .specs {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.warning-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-bg);
  color: #b45309;
  border: 1px solid var(--warning-border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-top: 4px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.qty-input {
  width: 70px;
  text-align: center;
  padding: 6px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

/* Live Calculation Sticky Bar */
.live-calc-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}

.calc-metrics {
  display: flex;
  gap: 28px;
}

.calc-metric-item .label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-metric-item .val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

/* Layout Sheet Previewer */
.preview-stage-container {
  background: #e2e8f0;
  border-radius: var(--radius-lg);
  border: 1px solid #cbd5e1;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  min-height: 600px;
}

.preview-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.sheet-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-viewport {
  margin-top: 50px;
  width: 100%;
  height: 580px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: grab;
}

.sheet-viewport:active {
  cursor: grabbing;
}

/* Sheet Canvas Representation */
.sheet-physical-board {
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid #94a3b8;
  position: relative;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  display: flex;
  flex-direction: column;
}

.sheet-header-banner {
  height: 24px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 8px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.3px;
}

.sheet-printable-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: stretch;
}

.lanyard-slot {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #e0f2fe;
  border: 1px solid #38bdf8;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 1px;
  transition: var(--transition);
  cursor: pointer;
}

.lanyard-slot:hover {
  border-color: #0284c7;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
  z-index: 5;
}

.lanyard-slot img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
}

.lanyard-slot-badge {
  position: absolute;
  bottom: 4px;
  font-size: 7px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 1px 3px;
  border-radius: 2px;
  white-space: nowrap;
}

/* Tooltip */
.slot-tooltip {
  position: fixed;
  background: #0f172a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  display: none;
  white-space: nowrap;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-box {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info { background: #2563eb; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .size-selector-grid {
    grid-template-columns: 1fr;
  }
  .design-item-card {
    grid-template-columns: 60px 1fr 100px 40px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .top-bar {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
  .calc-metrics {
    flex-wrap: wrap;
    gap: 14px;
  }
  .live-calc-bar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* ==========================================================================
   VISUAL MARGIN & PHYSICAL LAYOUT EDITOR STYLES
   ========================================================================== */

.layout-editor-split {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  align-items: flex-start;
}

@media (max-width: 1200px) {
  .layout-editor-split {
    grid-template-columns: 1fr;
  }
}

.profile-tab-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 12px;
}

.profile-tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  color: var(--text-muted);
}

.profile-tab-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.profile-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-ring);
}

.editor-param-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.editor-section-header {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-stage-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-stage-toolbar {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-stage-viewport {
  background: #0f172a;
  min-height: 720px;
  max-height: 860px;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  user-select: none;
}

/* Interactive Canvas Board */
.editor-sheet-board {
  background: #ffffff;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  border: 2px solid #334155;
  transform-origin: top center;
  transition: transform 0.1s ease-out;
  cursor: default;
}

/* Ruler Grid Overlay */
.sheet-ruler-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  pointer-events: none;
}

/* Translucent Physical Margin Overlays */
.margin-overlay-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(245, 158, 11, 0.16);
  border-bottom: 2px dashed #f59e0b;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #92400e;
}

.margin-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(245, 158, 11, 0.16);
  border-top: 2px dashed #f59e0b;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #92400e;
}

.margin-overlay-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(37, 99, 235, 0.16);
  border-right: 2px dashed #2563eb;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
  writing-mode: vertical-rl;
}

.margin-overlay-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(37, 99, 235, 0.16);
  border-left: 2px dashed #2563eb;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
  writing-mode: vertical-rl;
}

.margin-overlay-group-sep {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(168, 85, 247, 0.18);
  border-left: 1px dashed #a855f7;
  border-right: 1px dashed #a855f7;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #6b21a8;
  writing-mode: vertical-rl;
}

/* Interactive Group Zones */
.editor-group-zone {
  position: absolute;
  border: 2px solid #0ea5e9;
  background: rgba(14, 165, 233, 0.04);
  border-radius: 4px;
  z-index: 15;
  cursor: grab;
  transition: border-color 0.15s, background-color 0.15s;
}

.editor-group-zone:hover {
  border-color: #0284c7;
  background: rgba(14, 165, 233, 0.08);
}

.editor-group-zone.dragging {
  cursor: grabbing;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.editor-group-tag {
  position: absolute;
  top: -22px;
  left: 0;
  background: #0ea5e9;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 3px 3px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* Individual Interactive Slot in Editor */
.editor-slot-box {
  position: absolute;
  background: #e2e8f0;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 9px;
  font-weight: 700;
  color: #475569;
  z-index: 20;
  transition: all 0.1s ease;
  cursor: pointer;
}

.editor-slot-box:hover {
  background: #fef08a;
  border-color: #ca8a04;
  color: #854d0e;
  z-index: 30;
  box-shadow: 0 0 8px rgba(202, 138, 4, 0.5);
  transform: scaleY(1.005);
}

.editor-slot-box.selected {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1d4ed8;
  z-index: 35;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
}

.editor-slot-num {
  font-size: 8px;
  font-weight: 800;
}

/* Measurement Mode Panel */
.measurement-inspector-panel {
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid #334155;
}

.measurement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.measurement-item {
  background: #1e293b;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #334155;
}

.measurement-item .label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.measurement-item .val {
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  margin-top: 2px;
}

