:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-ring: rgba(37, 99, 235, 0.16);
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(59, 130, 246, 0.22);
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --indigo: #4f46e5;
  --indigo-soft: #eef2ff;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.09);
}

/* Dynamic Mobile Survey Themes */
.theme-blue { --t-primary: #2563eb; --t-grad: linear-gradient(135deg, #1d4ed8, #3b82f6); --t-soft: #eff6ff; }
.theme-indigo { --t-primary: #4f46e5; --t-grad: linear-gradient(135deg, #4338ca, #6366f1); --t-soft: #eef2ff; }
.theme-emerald { --t-primary: #059669; --t-grad: linear-gradient(135deg, #047857, #10b981); --t-soft: #ecfdf5; }
.theme-rose { --t-primary: #e11d48; --t-grad: linear-gradient(135deg, #be123c, #f43f5e); --t-soft: #fff1f2; }
.theme-amber { --t-primary: #d97706; --t-grad: linear-gradient(135deg, #b45309, #f59e0b); --t-soft: #fffbeb; }
.theme-slate { --t-primary: #334155; --t-grad: linear-gradient(135deg, #0f172a, #475569); --t-soft: #f1f5f9; }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ===== SaaS App Shell (Sidebar + Main) ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
  color: #fff;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  flex-shrink: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.sidebar-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.48);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

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

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: #94a3b8;
}

.sidebar-logout {
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
}

.sidebar-logout:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.25);
}

.main-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 28px 92px;
}

@media (max-width: 920px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 14px 16px;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-section-label, .sidebar-footer {
    display: none;
  }
  .container {
    padding: 18px 14px 92px;
  }
}

/* ===== Hero Welcome Banner ===== */
.hero-banner {
  background: linear-gradient(125deg, #1e3a8a 0%, #2563eb 52%, #4f46e5 100%);
  border-radius: 18px;
  padding: 28px 30px;
  color: #fff;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22);
}

.hero-banner::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
  top: -120px;
  right: -60px;
  pointer-events: none;
}

.hero-banner::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, transparent 70%);
  bottom: -90px;
  right: 220px;
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero-desc {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.hero-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .hero-steps {
    grid-template-columns: 1fr;
  }
}

.hero-step {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.hero-step-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-step-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.hero-step-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== Cards & KPI ===== */
.card {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
}

.card-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1020px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

.stat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.amber { background: #fef3c7; color: #d97706; }
.stat-icon.indigo { background: #eef2ff; color: #4f46e5; }

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-top: 2px;
}

.stat-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ===== Quick Template Cards ===== */
.tpl-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.16s ease;
}

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

.tpl-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tpl-emoji {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: var(--primary-soft);
  flex-shrink: 0;
}

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

.tpl-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.tpl-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tpl-tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 500;
}

/* ===== Buttons & Badges ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.34);
}

.btn-white {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.btn-white:hover {
  transform: translateY(-1px);
  background: #f8fafc;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.26);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.22);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.btn-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.btn-warning:hover:not(:disabled) {
  background: #fef3c7;
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active { background: var(--success-soft); color: #15803d; }
.badge-draft { background: var(--warning-soft); color: #b45309; }
.badge-paused { background: #e2e8f0; color: #475569; }
.badge-type { background: var(--primary-soft); color: var(--primary); }

/* ===== Filter tabs & Search ===== */
.filter-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}

.filter-tab {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.alert-info { background: var(--primary-soft); color: #1e40af; border: 1px solid #bfdbfe; }

.survey-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Wenjuanxing-style 2-row Survey Card */
.wjx-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  position: relative;
}

.wjx-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-hover);
}

.wjx-card-top {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wjx-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wjx-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.wjx-title:hover {
  color: var(--primary);
}

.wjx-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
}

.wjx-tag.eval {
  background: #eef2ff;
  color: #4f46e5;
}

.wjx-meta-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.wjx-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.wjx-status-dot.active { color: #2563eb; }
.wjx-status-dot.draft { color: #d97706; }
.wjx-status-dot.paused { color: #64748b; }

.wjx-card-bar {
  border-top: 1px solid #f1f5f9;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: #fcfdff;
  border-radius: 0 0 12px 12px;
}

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

.wjx-actions-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Dropdown menu */
.wjx-dropdown {
  position: relative;
  display: inline-block;
}

.wjx-drop-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.wjx-drop-trigger:hover, .wjx-dropdown.open .wjx-drop-trigger {
  background: #f1f5f9;
  color: var(--primary);
}

.wjx-drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 204px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  padding: 6px;
  margin-top: 4px;
  z-index: 50;
}

/* Invisible hover bridge so moving mouse down into menu never closes it */
.wjx-drop-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 12px;
}

.wjx-dropdown:hover .wjx-drop-menu,
.wjx-dropdown.open .wjx-drop-menu {
  display: block;
}

.wjx-drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  color: #1e293b;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.wjx-drop-item:hover {
  background: #eff6ff;
  color: var(--primary);
}

.wjx-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.14s ease;
}

.wjx-ctrl-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.wjx-ctrl-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.wjx-circle-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e293b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.wjx-circle-icon.play {
  background: #2563eb;
}

.wjx-divider {
  width: 1px;
  height: 16px;
  background: #e2e8f0;
}

.survey-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: #fff;
  transition: all 0.16s ease;
}

.survey-item:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.survey-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 46px 20px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

.progress-row { margin-bottom: 11px; }
.progress-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.progress-track { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: 999px; transition: width 0.25s ease; }

.text-answer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.text-answer-item { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 15px; font-size: 14px; }
.text-answer-time { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== Upload dropzone & Editor ===== */
.dropzone {
  border: 2px dashed #93c5fd;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  border-radius: 14px;
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dropzone:hover, .dropzone.dragover {
  background: #dbeafe;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.q-editor-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  background: #fbfdff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.q-editor-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.option-edit-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.option-edit-row { display: flex; align-items: center; gap: 8px; }

.option-tag {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-box {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 0 8px;
  height: 40px;
}

.score-box span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.score-input { width: 62px; border: none; outline: none; font-size: 14px; font-weight: 700; color: var(--primary); text-align: center; background: transparent; }

.global-settings-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.settings-checks { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-bottom: 14px; }
.settings-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; color: var(--text); }

.theme-swatches { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.theme-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s ease; }
.theme-swatch:hover { transform: scale(1.1); }
.theme-swatch.active { border-color: #0f172a; box-shadow: 0 0 0 2px #fff inset; transform: scale(1.12); }

.q-settings-panel {
  margin-top: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

@media (max-width: 720px) {
  .q-settings-panel { grid-template-columns: 1fr; }
}

.q-settings-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.sticky-action-bar {
  position: fixed;
  bottom: 0;
  left: 248px;
  right: 0;
  z-index: 25;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 12px 28px;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.06);
}

@media (max-width: 920px) {
  .sticky-action-bar { left: 0; padding: 12px 16px; }
}

.sticky-action-inner {
  max-width: 1144px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Login Split Page ===== */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}

.login-visual {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  color: #fff;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-visual::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, transparent 70%);
  bottom: -140px;
  right: -120px;
}

.login-form-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  background: #f8fafc;
}

/* ===== Mobile Fill Page ===== */
.q-hint { font-size: 13px; color: var(--muted); margin: -6px 0 10px; }

.fill-progress-bar {
  position: sticky;
  top: 8px;
  z-index: 15;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.mobile-wrap { max-width: 660px; margin: 0 auto; padding: 20px 14px 64px; }

.mobile-header {
  background: var(--t-grad, linear-gradient(135deg, #1d4ed8, #3b82f6));
  color: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

.mobile-header h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.35; }
.mobile-header p { margin: 0; font-size: 14px; opacity: 0.94; white-space: pre-line; }

.q-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04); }
.q-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; line-height: 1.5; }
.req-star { color: var(--danger); margin-left: 4px; }

.sidebar-brand-logo {
  display: block;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 18px;
  text-decoration: none;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 204px;
  height: auto;
  display: block;
  border: none;
  background: transparent;
}

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

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

/* Mobile Survey Polish */
.mobile-body {
  background: #f2f5fa;
  -webkit-tap-highlight-color: transparent;
}

.preview-banner {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.mobile-brand-row {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.mobile-header-logo {
  height: 36px;
  width: auto;
  display: block;
  border: none;
  background: transparent;
}

.q-num-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--t-soft, #eff6ff);
  color: var(--t-primary, #2563eb);
  font-size: 13px;
  font-weight: 800;
  margin-right: 6px;
  vertical-align: 1px;
}

/* Matrix Info Input Card */
.matrix-info-box {
  border: 1px solid #dce4ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.matrix-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  border-bottom: 1px solid #eef2f6;
}

.matrix-row:last-child {
  border-bottom: none;
}

.matrix-label {
  background: #f8fafc;
  padding: 13px 10px 13px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  border-right: 1px solid #eef2f6;
  height: 100%;
  display: flex;
  align-items: center;
}

.matrix-input {
  width: 100%;
  border: none;
  outline: none;
  padding: 13px 14px;
  font-size: 15.5px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}

.matrix-input:focus {
  background: var(--t-soft, #f8fbff);
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
  font-size: 15px;
  line-height: 1.55;
  transition: all 0.14s ease;
}

.option-label:has(input:checked) {
  border-color: var(--t-primary, var(--primary));
  background: var(--t-soft, #eff6ff);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

.option-label input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--t-primary, var(--primary));
  flex-shrink: 0;
}

.option-text {
  flex: 1;
  word-break: break-word;
}

.mobile-textarea {
  font-size: 16px;
  line-height: 1.55;
  border-radius: 11px;
}

@media (max-width: 640px) {
  .mobile-wrap {
    padding: 12px 12px calc(44px + env(safe-area-inset-bottom));
  }
  .mobile-header {
    padding: 22px 18px;
    border-radius: 15px;
  }
  .mobile-header h1 {
    font-size: 20px;
  }
  .q-card {
    padding: 16px 15px;
    border-radius: 13px;
  }
  .q-title {
    font-size: 15.5px;
  }
  .matrix-input, .input, .textarea {
    font-size: 16px;
  }
  .option-label {
    padding: 13px 13px;
    font-size: 15px;
  }
}

.rating-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rating-pill { flex: 1; min-width: 48px; position: relative; }
.rating-pill input { position: absolute; opacity: 0; pointer-events: none; }
.rating-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border: 1.5px solid #cbd5e1;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  transition: all 0.14s ease;
}
.rating-pill input:checked + span {
  background: var(--t-primary, var(--primary));
  color: #fff;
  border-color: var(--t-primary, var(--primary));
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.mobile-submit-btn {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 13px;
  margin-top: 8px;
  border: none;
  color: #fff;
  cursor: pointer;
  background: var(--t-grad, linear-gradient(135deg, #1d4ed8, #3b82f6));
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18); }
