/* assets/css/style.css */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --secondary: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --dark: #1e293b;
  --gray: #64748b;
  --light-gray: #f1f5f9;
  --border: #e2e8f0;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: #f8fafc;
  color: var(--dark);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: var(--dark);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.3s;
}

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

.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

.sidebar-brand small { color: #94a3b8; font-size: 11px; }

.sidebar-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 8px 12px 4px;
  margin-top: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-nav a .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: #e2e8f0; text-decoration: none; }
.sidebar-nav a.active { background: var(--primary); color: #fff; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 13.5px;
  text-decoration: none;
  transition: all 0.15s;
}

.sidebar-footer a:hover { background: rgba(239,68,68,0.15); color: #f87171; text-decoration: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title h1 { font-size: 20px; font-weight: 700; color: var(--dark); }
.topbar-title p { font-size: 13px; color: var(--gray); margin-top: 1px; }

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

/* ===== PAGE CONTENT ===== */
.page-content { padding: 28px; flex: 1; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 { font-size: 15px; font-weight: 700; color: var(--dark); }
.card-body { padding: 24px; }

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

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.purple { background: var(--primary-light); }
.stat-icon.cyan { background: #ecfeff; }
.stat-icon.green { background: #ecfdf5; }
.stat-icon.orange { background: #fff7ed; }

.stat-info h3 { font-size: 26px; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-info p { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--light-gray); color: var(--dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; color: var(--dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #2563eb; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; justify-content: center; }
.btn-block { width: 100%; justify-content: center; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  background: #f8fafc;
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--dark);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

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

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; gap: 20px; margin-bottom: 20px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

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

label .required { color: var(--danger); margin-left: 3px; }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

textarea { resize: vertical; min-height: 100px; }

.form-text { font-size: 12px; color: var(--gray); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

.checkbox-group, .radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-group label, .radio-group label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
  cursor: pointer;
  margin: 0;
}

.checkbox-group input, .radio-group input { width: auto; }

.toggle-wrap { display: flex; align-items: center; gap: 10px; }

.toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  left: 3px; top: 3px;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

/* ===== FIELD BUILDER ===== */
.field-builder-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
}

.field-type-palette {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.field-type-palette .palette-header {
  padding: 16px 20px;
  background: var(--light-gray);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-type-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: grab;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.15s;
  user-select: none;
}

.field-type-item:hover { background: var(--primary-light); }
.field-type-item:last-child { border-bottom: none; }

.field-type-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.field-type-info strong { font-size: 13px; font-weight: 600; color: var(--dark); display: block; }
.field-type-info small { font-size: 11px; color: var(--gray); }

/* ===== FORM CANVAS ===== */
.form-canvas {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 400px;
}

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

#fields-list {
  padding: 16px;
  min-height: 300px;
}

.field-item {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.field-item:hover { border-color: var(--primary); background: var(--primary-light); }
.field-item.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.field-item.ui-sortable-helper { box-shadow: var(--shadow-lg); opacity: 0.9; border-color: var(--primary); }
.field-item.ui-sortable-placeholder { background: #e0e7ff; border: 2px dashed var(--primary); opacity: 0.5; }

.field-drag-handle {
  cursor: grab;
  color: #94a3b8;
  font-size: 16px;
  padding: 4px;
}

.field-item-info { flex: 1; }
.field-item-info strong { font-size: 13.5px; font-weight: 600; color: var(--dark); }
.field-item-info span { font-size: 11px; color: var(--gray); margin-left: 8px; }

.field-item-type {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.field-item-actions { display: flex; gap: 5px; }

.empty-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--gray);
}

.empty-canvas .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-canvas h4 { font-size: 16px; color: var(--dark); margin-bottom: 8px; }
.empty-canvas p { font-size: 13px; }

/* ===== FIELD EDITOR PANEL ===== */
.field-editor {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 16px;
}

.field-editor.show { display: block; }

.field-editor .editor-header {
  padding: 14px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
}

.field-editor .editor-body { padding: 20px; }

/* ===== OPTIONS EDITOR ===== */
.options-editor { margin-top: 8px; }

.option-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.option-row input { flex: 1; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h4 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray);
  line-height: 1;
  padding: 2px;
}

/* ===== PUBLIC FORM ===== */
.public-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

.public-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 640px;
  overflow: hidden;
}

.public-form-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 36px 40px;
  color: #fff;
}

.public-form-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.public-form-header p { opacity: 0.85; font-size: 15px; }

.public-form-body { padding: 36px 40px; }

.public-form-body .form-group { margin-bottom: 22px; }

.public-form-body label {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 7px;
}

.public-form-footer {
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  text-align: center;
  font-size: 12px;
  color: var(--gray);
}

.success-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 60px 40px;
}

.success-icon { font-size: 64px; margin-bottom: 20px; }
.success-card h2 { font-size: 24px; font-weight: 800; color: var(--dark); margin-bottom: 12px; }
.success-card p { color: var(--gray); font-size: 15px; }

/* ===== LOGIN ===== */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.login-header {
  background: var(--primary);
  padding: 32px 36px;
  color: #fff;
  text-align: center;
}

.login-header .logo-icon { font-size: 40px; margin-bottom: 12px; }
.login-header h1 { font-size: 22px; font-weight: 800; }
.login-header p { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.login-body { padding: 32px 36px; }
.login-footer { padding: 16px 36px 24px; text-align: center; font-size: 13px; color: var(--gray); }

/* ===== URL BOX ===== */
.url-box {
  display: flex;
  align-items: center;
  background: var(--light-gray);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.url-box input {
  border: none;
  background: transparent;
  flex: 1;
  padding: 9px 14px;
  font-size: 13px;
  outline: none;
}

.url-box .btn { border-radius: 0; margin: 0; flex-shrink: 0; }

/* ===== BREADCRUMB ===== */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray); }
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { color: #cbd5e1; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.empty-state p { color: var(--gray); margin-bottom: 20px; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== PROGRESS ===== */
.step-progress {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
}

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

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

.step.completed:not(:last-child)::after { background: var(--primary); }

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--light-gray);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray);
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}

.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.completed .step-circle { background: var(--success); border-color: var(--success); color: #fff; }

.step-label { font-size: 11px; margin-top: 6px; color: var(--gray); font-weight: 600; text-align: center; }
.step.active .step-label { color: var(--primary); }
.step.completed .step-label { color: var(--success); }

/* ===== SUBMISSIONS VIEW ===== */
.submission-detail { padding: 0; }

.submission-field {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
}

.submission-field:last-child { border-bottom: none; }
.submission-field .field-label { font-size: 13px; font-weight: 600; color: var(--gray); }
.submission-field .field-value { font-size: 14px; color: var(--dark); white-space: pre-wrap; word-break: break-word; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar { width: 70px; }
  .sidebar-brand h2, .sidebar-brand small,
  .sidebar-nav a span, .nav-section-title,
  .sidebar-footer a span { display: none; }
  .sidebar-nav a { justify-content: center; padding: 12px; }
  .sidebar-nav a .nav-icon { width: auto; }
  .sidebar-footer a { justify-content: center; }
  .main-content { margin-left: 70px; }
  .field-builder-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .public-form-body, .public-form-header { padding: 24px 20px; }
  .topbar { padding: 12px 16px; }
}

/* ===== UTILITIES ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); font-size: 13px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-bold { font-weight: 700; }
.w-full { width: 100%; }
.d-none { display: none; }
.d-flex { display: flex; }
.ms-auto { margin-left: auto; }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FORM PREVIEW ===== */
.preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  overflow-y: auto;
  padding: 40px 20px;
}

.preview-overlay.show { display: block; }

.preview-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
  box-shadow: var(--shadow-md);
}

/* ===== DRAG PLACEHOLDER ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--gray);
  margin-bottom: 10px;
  transition: all 0.2s;
}

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

.conditional-section {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}

.conditional-section label { color: #92400e; }
