/* ========================================
   AI Diagnostic System — Tech Blue Theme
   Modern glassmorphism + neural network aesthetic
   ======================================== */

:root {
  --primary: #1565FF;
  --primary-dark: #0A4ED0;
  --primary-light: #4D8FFF;
  --primary-50: #E8F0FF;
  --primary-100: #D1E2FF;
  --accent: #00B4D8;
  --accent-light: #5CE1F0;
  --accent-glow: rgba(0, 180, 216, 0.25);
  --navy: #0A1A3F;
  --navy-2: #0F2452;
  --navy-3: #1A357A;
  --bg: #F0F4FF;
  --bg-soft: #E3ECFF;
  --bg-white: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-dark: rgba(10, 26, 63, 0.85);
  --text: #1A2B4A;
  --text-secondary: #5A6B8C;
  --text-muted: #9AABCC;
  --text-inverse: #FFFFFF;
  --white: #FFFFFF;
  --error: #FF4757;
  --error-bg: #FFF0F2;
  --success: #00C896;
  --success-bg: #E6FFF8;
  --warning: #FFA94D;
  --warning-bg: #FFF5E6;
  --border: #DDE5F4;
  --border-hover: #B0C4F0;
  --shadow-xs: 0 1px 3px rgba(21, 101, 255, 0.06);
  --shadow-sm: 0 2px 8px rgba(21, 101, 255, 0.08);
  --shadow: 0 4px 16px rgba(21, 101, 255, 0.10);
  --shadow-lg: 0 8px 32px rgba(21, 101, 255, 0.15);
  --shadow-glow: 0 0 24px rgba(0, 180, 216, 0.20);
  --shadow-glow-blue: 0 0 24px rgba(21, 101, 255, 0.25);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --gradient-main: linear-gradient(135deg, #0A1A3F 0%, #1565FF 60%, #00B4D8 100%);
  --gradient-navy: linear-gradient(135deg, #0A1A3F 0%, #0F2452 100%);
  --gradient-blue: linear-gradient(135deg, #1565FF 0%, #00B4D8 100%);
  --gradient-blue-soft: linear-gradient(135deg, #E8F0FF 0%, #F0F4FF 100%);
  --gradient-accent: linear-gradient(90deg, #00B4D8, #1565FF);
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'STHeiti', sans-serif;
  --font-serif: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'STHeiti', sans-serif;
  --max-width: 480px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(21, 101, 255, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(0, 180, 216, 0.06) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  padding: 16px;
  margin: 0 auto;
}

/* ========================================
   Header — Navy gradient with neural network pattern
   ======================================== */

.page-header {
  width: 100%;
  background: var(--gradient-navy);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(0, 180, 216, 0.15) 0%, transparent 30%),
    radial-gradient(circle at 85% 30%, rgba(21, 101, 255, 0.2) 0%, transparent 35%),
    var(--gradient-navy);
  color: var(--white);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%2300B4D8' stroke-width='0.5' opacity='0.15'%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3Ccircle cx='100' cy='30' r='3'/%3E%3Ccircle cx='160' cy='50' r='3'/%3E%3Ccircle cx='30' cy='100' r='3'/%3E%3Ccircle cx='80' cy='90' r='3'/%3E%3Ccircle cx='140' cy='110' r='3'/%3E%3Ccircle cx='170' cy='80' r='3'/%3E%3Ccircle cx='50' cy='160' r='3'/%3E%3Ccircle cx='110' cy='150' r='3'/%3E%3Ccircle cx='160' cy='170' r='3'/%3E%3Cline x1='40' y1='40' x2='100' y2='30'/%3E%3Cline x1='100' y1='30' x2='160' y2='50'/%3E%3Cline x1='40' y1='40' x2='30' y2='100'/%3E%3Cline x1='100' y1='30' x2='80' y2='90'/%3E%3Cline x1='80' y1='90' x2='140' y2='110'/%3E%3Cline x1='160' y1='50' x2='170' y2='80'/%3E%3Cline x1='140' y1='110' x2='170' y2='80'/%3E%3Cline x1='80' y1='90' x2='50' y2='160'/%3E%3Cline x1='140' y1='110' x2='110' y2='150'/%3E%3Cline x1='110' y1='150' x2='160' y2='170'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.6;
  pointer-events: none;
}

.page-header .logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.page-header .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--white);
  box-shadow: 0 0 16px rgba(0, 180, 216, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
}

.page-header .logo-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: var(--gradient-blue);
  opacity: 0.3;
  z-index: -1;
  filter: blur(8px);
}

.page-header .logo-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(0, 180, 216, 0.35));
}

.page-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.page-header .subtitle {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* ========================================
   Card — Glassmorphism with subtle blue tint
   ======================================== */

.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s, border-color 0.3s;
  position: relative;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-100);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--gradient-blue);
  color: var(--white);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(21, 101, 255, 0.3);
}

/* ========================================
   Form Common
   ======================================== */

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

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ========================================
   Radio Cards
   ======================================== */

.radio-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-card {
  flex: 1;
  min-width: calc(50% - 4px);
  position: relative;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.radio-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  min-height: 48px;
}

.radio-card input:checked + label {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(21, 101, 255, 0.15);
}

.radio-card input:focus-visible + label,
.radio-card label:active {
  border-color: var(--accent);
}

.radio-card .radio-dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.radio-card input:checked + label .radio-dot {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-card input:checked + label .radio-dot::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
}

/* ========================================
   Checkbox Cards
   ======================================== */

.checkbox-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-card {
  flex: 1;
  min-width: calc(50% - 4px);
  position: relative;
}

.checkbox-card input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.checkbox-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  min-height: 48px;
}

.checkbox-card input:checked + label {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(21, 101, 255, 0.15);
}

.checkbox-card .check-icon {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 12px;
  color: transparent;
}

.checkbox-card input:checked + label .check-icon {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
}

/* ========================================
   Sortable Multi-select
   ======================================== */

.sort-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sort-checkbox-item {
  flex: 1;
  min-width: calc(50% - 4px);
  position: relative;
}

.sort-checkbox-item input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.sort-checkbox-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  min-height: 48px;
}

.sort-checkbox-item input:checked + label {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(21, 101, 255, 0.15);
}

.sort-checkbox-item .sort-rank {
  display: none;
  width: 22px;
  height: 22px;
  background: var(--gradient-blue);
  color: var(--white);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(21, 101, 255, 0.3);
}

.sort-checkbox-item input:checked + label .sort-rank {
  display: flex;
}

/* ========================================
   Grid (Department)
   ======================================== */

.department-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dept-grid-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dept-grid-label {
  flex: 0 0 90px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
  padding-right: 4px;
  line-height: 1.2;
}

.dept-grid-options {
  display: flex;
  gap: 6px;
  flex: 1;
}

.dept-grid-option {
  flex: 1;
  position: relative;
}

.dept-grid-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.dept-grid-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  text-align: center;
  min-height: 42px;
  line-height: 1.2;
}

.dept-grid-option input:checked + label {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}

.dept-grid-header {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  padding-left: 98px;
}

.dept-grid-header span {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ========================================
   Task Checkbox Table (B Survey)
   ======================================== */

.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.task-table th {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 4px 6px;
  text-align: center;
  line-height: 1.3;
}

.task-table th:first-child {
  text-align: left;
  width: 35%;
}

.task-table td {
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
}

.task-table .task-name {
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 8px 6px;
}

.task-table .opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 6px 4px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  text-align: center;
  line-height: 1.2;
}

.task-table .opt-btn.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}

.task-table .opt-btn.dead-process.selected {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
  font-weight: 600;
}

/* ========================================
   Buttons — Gradient with glow
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  text-decoration: none;
  font-family: var(--font-sans);
  min-height: 48px;
}

.btn-primary {
  background: var(--gradient-blue);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(21, 101, 255, 0.3);
}

.btn-primary:hover, .btn-primary:active {
  box-shadow: 0 6px 24px rgba(21, 101, 255, 0.4);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--gradient-accent);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3);
}

.btn-accent:hover, .btn-accent:active {
  box-shadow: 0 6px 24px rgba(0, 180, 216, 0.4);
  transform: translateY(-1px);
}

/* Alias for backward compatibility */
.btn-brass {
  background: var(--gradient-accent);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3);
}

.btn-brass:hover, .btn-brass:active {
  box-shadow: 0 6px 24px rgba(0, 180, 216, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

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

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
  min-height: 54px;
}

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

/* ========================================
   Progress Bar — Blue gradient
   ======================================== */

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 8px 0 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-blue);
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(0, 180, 216, 0.4);
}

/* ========================================
   Toast
   ======================================== */

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
}

.toast.error {
  background: var(--error);
}

.toast.success {
  background: var(--success);
}

/* ========================================
   Loading Spinner — AI pulse
   ======================================== */

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(240, 244, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

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

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========================================
   Home Page — AI hero with gradient
   ======================================== */

.home-hero {
  padding: 40px 16px 24px;
  text-align: center;
}

.home-hero .hero-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.home-hero h2 {
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 8px;
  font-weight: 700;
}

.home-hero p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

.home-cards {
  padding: 0 0 24px;
}

.home-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-blue);
  opacity: 0;
  transition: opacity 0.25s;
}

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

.home-card:hover::before {
  opacity: 1;
}

.home-card:active {
  transform: scale(0.98);
}

.home-card .card-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.home-card h3 {
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 4px;
  font-weight: 700;
}

.home-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========================================
   A Survey Share Section
   ======================================== */

.share-section {
  text-align: center;
  padding: 20px 16px;
  display: none;
}

.share-section.show {
  display: block;
}

.share-section .qr-wrapper {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.share-section .qr-wrapper img {
  max-width: 200px;
  border-radius: var(--radius);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow);
}

.share-url {
  background: var(--bg-soft);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--primary);
  word-break: break-all;
  margin: 12px 0;
}

/* ========================================
   Report Page Styles
   ======================================== */

.report-page {
  background: var(--bg);
}

.report-header {
  background: var(--gradient-navy);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(0, 180, 216, 0.15) 0%, transparent 30%),
    radial-gradient(circle at 85% 30%, rgba(21, 101, 255, 0.2) 0%, transparent 35%),
    var(--gradient-navy);
  color: var(--white);
  padding: 32px 20px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.report-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%2300B4D8' stroke-width='0.5' opacity='0.12'%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3Ccircle cx='100' cy='30' r='3'/%3E%3Ccircle cx='160' cy='50' r='3'/%3E%3Ccircle cx='30' cy='100' r='3'/%3E%3Ccircle cx='80' cy='90' r='3'/%3E%3Ccircle cx='140' cy='110' r='3'/%3E%3Ccircle cx='170' cy='80' r='3'/%3E%3Ccircle cx='50' cy='160' r='3'/%3E%3Ccircle cx='110' cy='150' r='3'/%3E%3Ccircle cx='160' cy='170' r='3'/%3E%3Cline x1='40' y1='40' x2='100' y2='30'/%3E%3Cline x1='100' y1='30' x2='160' y2='50'/%3E%3Cline x1='40' y1='40' x2='30' y2='100'/%3E%3Cline x1='100' y1='30' x2='80' y2='90'/%3E%3Cline x1='80' y1='90' x2='140' y2='110'/%3E%3Cline x1='160' y1='50' x2='170' y2='80'/%3E%3Cline x1='140' y1='110' x2='170' y2='80'/%3E%3Cline x1='80' y1='90' x2='50' y2='160'/%3E%3Cline x1='140' y1='110' x2='110' y2='150'/%3E%3Cline x1='110' y1='150' x2='160' y2='170'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

.report-header .report-logo {
  font-size: 11px;
  letter-spacing: 0.15em;
  opacity: 0.6;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}

.report-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.report-header .report-date {
  font-size: 0.8rem;
  opacity: 0.6;
  position: relative;
  z-index: 1;
}

.report-body {
  padding: 0 16px 24px;
  max-width: 680px;
  margin: 0 auto;
}

/* Score Ring */
.score-section {
  text-align: center;
  padding: 24px 20px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  margin: -20px 0 16px;
  box-shadow: var(--shadow);
  position: relative;
  border: 1px solid var(--border);
}

.score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring .ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring .ring-fill {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.score-ring .score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
}

.score-ring .score-max {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.score-headline {
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 12px;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-50);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.75rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.evidence-list {
  text-align: left;
  margin-top: 12px;
}

.evidence-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  border-bottom: 1px solid var(--bg-soft);
}

.evidence-item:last-child {
  border-bottom: none;
}

.evidence-item .ev-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

/* Section Card */
.section-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.section-card h3 {
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-100);
  font-weight: 700;
}

/* Department Cards */
.dept-report-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
}

.dept-report-card .dept-agent-name {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.dept-report-card .dept-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.dept-report-card .dept-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.safety-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  line-height: 1.5;
  text-align: center;
}

/* CTA Section */
.cta-section {
  background: var(--gradient-navy);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(0, 180, 216, 0.15) 0%, transparent 30%),
    radial-gradient(circle at 85% 30%, rgba(21, 101, 255, 0.2) 0%, transparent 35%),
    var(--gradient-navy);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  margin: 8px 0 24px;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%2300B4D8' stroke-width='0.5' opacity='0.1'%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3Ccircle cx='100' cy='30' r='3'/%3E%3Ccircle cx='160' cy='50' r='3'/%3E%3Ccircle cx='30' cy='100' r='3'/%3E%3Ccircle cx='80' cy='90' r='3'/%3E%3Ccircle cx='140' cy='110' r='3'/%3E%3Cline x1='40' y1='40' x2='100' y2='30'/%3E%3Cline x1='100' y1='30' x2='160' y2='50'/%3E%3Cline x1='40' y1='40' x2='30' y2='100'/%3E%3Cline x1='100' y1='30' x2='80' y2='90'/%3E%3Cline x1='80' y1='90' x2='140' y2='110'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

.cta-section h3 {
  color: var(--accent-light);
  border-bottom: none;
  position: relative;
  z-index: 1;
}

.cta-section .cta-date {
  font-size: 0.9rem;
  margin-bottom: 16px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.cta-section .btn-accent {
  font-size: 1.1rem;
  padding: 14px 36px;
  position: relative;
  z-index: 1;
}

.cta-section .btn-brass {
  font-size: 1.1rem;
  padding: 14px 36px;
  position: relative;
  z-index: 1;
  background: var(--gradient-accent);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3);
}

/* Priority highlight */
.priority-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--gradient-blue);
  color: var(--white);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(21, 101, 255, 0.3);
}

/* ========================================
   Admin Page
   ======================================== */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-table th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 8px;
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.4;
}

.admin-table tr:hover td {
  background: var(--primary-50);
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-pending {
  background: var(--warning-bg);
  color: #B8731A;
}

.status-ready {
  background: var(--primary-50);
  color: var(--primary);
}

.status-generated {
  background: var(--success-bg);
  color: #008060;
}

.admin-dept-list {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================
   Status Page (waiting)
   ======================================== */

.status-page {
  text-align: center;
  padding: 40px 16px;
}

.status-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.status-page h2 {
  color: var(--navy);
  margin-bottom: 8px;
  font-weight: 700;
}

.status-collection {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.status-collection-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.status-collection-item .check-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.status-collection-item.done .check-circle {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

/* ========================================
   Text Input
   ======================================== */

.text-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--bg-white);
  transition: all 0.2s;
  min-height: 48px;
  color: var(--text);
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 255, 0.1);
}

.text-input::placeholder {
  color: var(--text-muted);
}

/* ========================================
   Responsive — PC (≥769px) & Mobile (≤768px)
   ======================================== */

/* ===== PC: wider containers, multi-column, bigger fonts ===== */
@media (min-width: 769px) {
  .container {
    max-width: 600px;
    padding: 24px;
  }

  .page-header {
    padding: 28px 24px;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .report-body {
    max-width: 700px;
  }

  .task-table th {
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  .task-table .task-name {
    font-size: 0.9rem;
  }

  .task-table .opt-btn {
    font-size: 0.82rem;
    min-height: 42px;
  }

  .admin-page .container {
    max-width: 960px;
  }

  /* Home cards align with CTA section */
  .home-cards {
    width: 100%;
    max-width: none;
  }

  /* Hero bigger on PC */
  .home-hero {
    padding: 56px 16px 32px;
  }
  .home-hero .hero-icon {
    font-size: 72px;
  }
  .home-hero h2 {
    font-size: 1.7rem;
  }
  .home-hero p {
    max-width: 480px;
    font-size: 1rem;
  }

  /* Report body wider */
  .report-body {
    max-width: 720px;
    padding: 0 24px 32px;
  }
  .report-header {
    padding: 40px 24px 28px;
  }
  .report-header h1 {
    font-size: 1.6rem;
  }
  .score-ring {
    width: 160px;
    height: 160px;
  }
  .score-ring .score-value {
    font-size: 2.8rem;
  }
  .section-card {
    padding: 24px 20px;
  }
}

/* ===== Tablet/PC large: even wider for admin-style pages ===== */
@media (min-width: 1024px) {
  .home-hero h2 { font-size: 2rem; }
  .home-hero p { font-size: 1.05rem; max-width: 560px; }
  .report-body { max-width: 800px; }
}

/* ===== Mobile: stack everything, scrollable tables, compact modals ===== */
@media (max-width: 768px) {
  /* Force all table wrappers to scroll */
  .table-wrapper, .admin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Stat cards: single column on small phones */
  .stat-cards {
    flex-direction: column;
  }
  .stat-card {
    min-width: 100%;
  }

  /* Headers: smaller text */
  .page-header h1 { font-size: 1.1rem; }
  .page-header .subtitle { font-size: 0.75rem; }

  /* Report: smaller sections */
  .report-header { padding: 24px 14px 20px; }
  .report-header h1 { font-size: 1.2rem; }
  .report-body { padding: 0 12px 20px; }
  .score-ring { width: 120px; height: 120px; }
  .score-ring .score-value { font-size: 2rem; }
  .score-section { padding: 20px 14px; margin: -16px 0 12px; }
  .section-card { padding: 16px 12px; margin-bottom: 10px; }
  .section-card h3 { font-size: 0.98rem; }
  .dept-report-card { padding: 12px 10px; }
  .dept-report-card .dept-meta { flex-direction: column; gap: 4px; }

  /* Home hero compact */
  .home-hero { padding: 28px 12px 20px; }
  .home-hero .hero-icon { font-size: 44px; }
  .home-hero h2 { font-size: 1.25rem; }

  /* Buttons full width on mobile */
  .btn { width: 100%; padding: 12px 20px; }
  .btn-lg { font-size: 1rem; padding: 14px 24px; }

  /* Modal full-width */
  .modal { width: 92vw !important; max-width: 92vw !important; padding: 20px 16px !important; }

  /* CTA section */
  .cta-section { padding: 20px 14px; }
  .cta-section .btn-brass { width: 100%; font-size: 1rem; padding: 12px 20px; }

  /* Forms */
  .radio-cards .radio-card,
  .checkbox-cards .checkbox-card,
  .sort-checkboxes .sort-checkbox-item { min-width: 100%; }

  /* Dept grid label */
  .dept-grid-label { flex: 0 0 70px; font-size: 0.78rem; }
  .dept-grid-header { padding-left: 78px; }

  /* Task table compact */
  .task-table .opt-btn { min-height: 34px; font-size: 0.7rem; }
}

/* ===== Very small phones (≤375px) ===== */
@media (max-width: 375px) {
  .container { padding: 10px; }
  .page-header h1 { font-size: 1rem; }
  .home-hero h2 { font-size: 1.1rem; }
  .report-header h1 { font-size: 1.05rem; }
  .score-ring { width: 100px; height: 100px; }
  .score-ring .score-value { font-size: 1.7rem; }
  .section-card { padding: 14px 10px; }
}

/* ========================================
   Print
   ======================================== */

@media print {
  body {
    background: white;
  }
  .page-header, .report-header, .cta-section {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .cta-section {
    break-inside: avoid;
  }
}
