/* ================================================
   PDF TOOLKIT - style.css
   Modern, clean SaaS-inspired design
   ================================================ */

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

/* ---- CSS VARIABLES (Light Theme) ---- */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #6366f1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

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

  --sidebar-width: 260px;
  --header-height: 64px;
}

/* ---- DARK THEME ---- */
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #334155;
  --border-focus: #818cf8;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #1e1b4b;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.6);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================
   LAYOUT
   ================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition), background var(--transition-slow), border-color var(--transition-slow);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-text span {
  color: var(--primary);
}

.sidebar-section {
  padding: 12px 12px 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item .nav-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 15px;
  flex-shrink: 0;
  background: var(--surface-2);
  transition: all var(--transition);
}

.nav-item.active .nav-icon {
  background: var(--primary);
  color: white;
}

.nav-item .nav-label { flex: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  flex: 1;
  font-family: inherit;
}

.theme-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}

.menu-toggle:hover { background: var(--surface-2); color: var(--text-primary); }

.content-area {
  padding: 28px;
  flex: 1;
  max-width: 100%;
}

/* ================================================
   TOOL PANEL
   ================================================ */

.tool-panel {
  display: none;
  animation: fadeSlideIn 0.3s ease;
}

.tool-panel.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-header {
  margin-bottom: 24px;
}

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

.panel-header p {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 14px;
}

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  position: relative;
}

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

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

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

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

.upload-zone p {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-zone .btn-browse {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  pointer-events: none;
}

.upload-zone:hover .btn-browse { background: var(--primary-dark); }

/* ---- FILE LIST ---- */
.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.file-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.file-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
  line-height: 1;
}

.file-remove:hover { background: #fee2e2; color: var(--danger); }

/* ---- CONTROLS/OPTIONS ROW ---- */
.options-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: all var(--transition);
  min-width: 120px;
}

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

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,0.4); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-danger:hover { transform: translateY(-1px); }

.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ---- PROGRESS BAR ---- */
.progress-wrap {
  margin: 16px 0;
  display: none;
}

.progress-wrap.visible { display: block; }

.progress-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
  animation: shimmer 2s infinite;
  background-size: 200% 100%;
}

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

/* ---- RESULT CARD ---- */
.result-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  animation: fadeSlideIn 0.3s ease;
}

.result-card.visible { display: block; }

.result-card.error-card { border-color: var(--danger); }

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.result-icon { font-size: 24px; }

.result-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.result-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ================================================
   PAGE THUMBNAIL GRID
   ================================================ */

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.page-thumb {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  transition: all var(--transition);
  user-select: none;
}

.page-thumb:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.page-thumb.selected { border-color: var(--primary); background: var(--primary-light); }
.page-thumb.ghost { opacity: 0.4; }
.page-thumb.drag-over-indicator { border-color: var(--accent); border-style: dashed; }

.page-thumb canvas {
  width: 100%;
  height: auto;
  display: block;
}

.page-thumb .page-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.page-thumb .page-checkbox {
  position: absolute;
  top: 6px; left: 6px;
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.page-thumb .page-actions {
  position: absolute;
  top: 6px; right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.page-thumb:hover .page-actions { opacity: 1; }

.page-action-btn {
  width: 24px; height: 24px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  transition: all var(--transition);
  color: var(--text-primary);
}

.page-action-btn:hover { background: white; box-shadow: var(--shadow-sm); }

.page-thumb .rotation-badge {
  position: absolute;
  bottom: 26px;
  right: 4px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 9px;
  padding: 1px 4px;
  font-weight: 600;
}

/* ================================================
   SIGNATURE CANVAS
   ================================================ */

.sig-canvas-wrap {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  cursor: crosshair;
  margin-top: 12px;
}

#signatureCanvas {
  display: block;
  width: 100%;
  height: 200px;
  touch-action: none;
}

.sig-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ================================================
   PDF VIEWER
   ================================================ */

.viewer-wrap {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-top: 16px;
}

.viewer-toolbar {
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.viewer-pages {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
}

.viewer-page {
  box-shadow: var(--shadow-lg);
  border-radius: 4px;
  overflow: hidden;
}

.viewer-page canvas {
  display: block;
  max-width: 100%;
}

/* ================================================
   TEXT OUTPUT AREA
   ================================================ */

.text-output {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.text-output pre {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

/* ================================================
   IMAGE GRID (Image to PDF)
   ================================================ */

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.image-thumb-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  aspect-ratio: 3/4;
  background: var(--surface-2);
  transition: all var(--transition);
}

.image-thumb-item:hover { border-color: var(--primary); }

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

.image-thumb-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.image-thumb-item:hover .image-thumb-remove { opacity: 1; }

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 360px;
  color: white;
}

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

.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(30px) scale(0.95); }
}

/* ================================================
   OVERLAY / MODAL
   ================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.overlay.visible { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  width: 100%;
  animation: fadeSlideIn 0.3s ease;
  overflow: hidden;
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--surface-2); color: var(--text-primary); }

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ================================================
   INFO CARDS / WELCOME STATS
   ================================================ */

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
}

.welcome-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.welcome-card .card-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.welcome-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ================================================
   SPLIT RANGE CONTROLS
   ================================================ */

.split-range-group {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.range-input { max-width: 70px; text-align: center; }

/* ================================================
   DIVIDER
   ================================================ */

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ================================================
   BADGE / TAG
   ================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #d1fae5; color: #059669; }
.badge-warning { background: #fef3c7; color: #d97706; }

/* ================================================
   DRAG-HANDLE CURSOR
   ================================================ */

.sortable-ghost { opacity: 0.4; }
.sortable-drag   { box-shadow: var(--shadow-xl) !important; transform: scale(1.03); }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle { display: flex; }

  .content-area { padding: 16px; }

  .welcome-grid { grid-template-columns: repeat(2, 1fr); }

  .options-row { flex-direction: column; align-items: stretch; }

  .page-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (max-width: 480px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; justify-content: center; }
}

/* ================================================
   MISC UTILS
   ================================================ */

.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }

/* Color inputs */
input[type="color"] {
  width: 40px; height: 34px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
}

/* Range inputs */
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---- SIDEBAR OVERLAY (mobile) ---- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.sidebar-backdrop.visible { display: block; }
