/* =========================================================
   SPK Seleksi Calon Induk Sapi Bali - Design System
   Palette: Emerald agricultural green + neutral surfaces
   ========================================================= */

:root {
  /* Brand */
  --primary: #059669;
  --primary-dark: #047857;
  --primary-darker: #065F46;
  --primary-light: #10B981;
  --primary-50: #ECFDF5;
  --primary-100: #D1FAE5;
  --primary-200: #A7F3D0;

  /* Accent / status */
  --info: #3B82F6;
  --info-soft: #EFF6FF;
  --warn: #F59E0B;
  --warn-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --success: #16A34A;
  --success-soft: #DCFCE7;

  /* Surfaces */
  --bg: #F6F8FA;
  --bg-soft: #EEF2F5;
  --surface: #FFFFFF;
  --surface-alt: #F9FAFB;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Text */
  --text: #0F172A;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  --text-onprimary: #FFFFFF;

  /* Radii + shadow */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm: 0 2px 6px rgba(15,23,42,0.06);
  --shadow: 0 6px 18px rgba(15,23,42,0.08);
  --shadow-lg: 0 18px 40px rgba(6,95,70,0.12);

  /* Layout */
  --app-max: 480px;
  --sidebar-w: 260px;
  --header-h: 60px;
  --bottom-h: 68px;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* =========================================================
   Mobile app container (mobile-first)
   ========================================================= */
.app-shell {
  min-height: 100vh;
  max-width: var(--app-max);
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  padding-bottom: var(--bottom-h);
}
.app-shell.no-bottom { padding-bottom: 0; }

/* Top header (mobile) */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
.appbar.primary {
  background: linear-gradient(180deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-bottom: none;
}
.appbar .icon-btn { color: inherit; }
.appbar .title { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.appbar .subtitle { font-size: 12px; opacity: .85; margin-top: -2px; }
.appbar .spacer { flex: 1; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.icon-btn:hover { background: rgba(15,23,42,0.06); }
.appbar.primary .icon-btn:hover { background: rgba(255,255,255,0.12); }

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  height: var(--bottom-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color .18s var(--ease);
  position: relative;
}
.bottom-nav a i { font-size: 18px; }
.bottom-nav a.active {
  color: var(--primary-dark);
}
.bottom-nav a.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 32px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: var(--primary);
}
.bottom-nav a.center-fab {
  transform: translateY(-14px);
}
.bottom-nav a.center-fab .fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 24px rgba(6,95,70,0.32);
  font-size: 22px;
  margin-bottom: 2px;
}
.bottom-nav a.center-fab span { font-size: 11px; color: var(--primary-dark); font-weight: 600; }

/* Page content padding */
.page {
  padding: 16px;
}
.page.narrow { padding: 20px 16px; }
.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 18px 0;
}

/* =========================================================
   Card
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card-lg { padding: 20px; border-radius: var(--radius-lg); }
.card-flat { box-shadow: none; }
.card-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
}
.card-primary .muted { color: rgba(255,255,255,0.85); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.muted { color: var(--text-muted); font-size: 13px; }
.mini { font-size: 12px; }
.strong { font-weight: 700; }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.stat .stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-50);
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.stat .stat-icon.blue { background: var(--info-soft); color: var(--info); }
.stat .stat-icon.yellow { background: var(--warn-soft); color: var(--warn); }
.stat .stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat .stat-value {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
}
.stat .stat-label {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
  text-decoration: none;
  min-height: 46px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 15px; min-height: 52px; border-radius: 14px; }
.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; border-radius: 10px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(6,95,70,0.22);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary {
  background: var(--primary-50);
  color: var(--primary-dark);
}
.btn-secondary:hover { background: var(--primary-100); }

.btn-outline {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-50); }

.btn-ghost {
  background: transparent; color: var(--text);
}
.btn-ghost:hover { background: rgba(15,23,42,0.06); }

.btn-dark { background: #0F172A; color: #fff; }
.btn-dark:hover { background: #1E293B; color: #fff; }

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

/* =========================================================
   Forms
   ========================================================= */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.sr-only-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.photo-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 10px;
  border: 1px dashed rgba(5, 150, 105, 0.42);
  border-radius: 14px;
  background: #F0FDF4;
  cursor: pointer;
}

.photo-picker:hover {
  border-color: var(--primary);
  background: #ECFDF5;
}

.photo-preview {
  display: grid;
  place-items: center;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(5, 150, 105, 0.18);
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.photo-title {
  font-weight: 800;
  color: var(--text);
}

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

.gate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gate-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.gate-item:hover {
  border-color: var(--primary-200);
}

.gate-item input {
  display: none;
}

.gate-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  color: transparent;
  background: var(--surface);
  margin-top: 1px;
}

.gate-item:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-dark);
  font-weight: 800;
}

.gate-item:has(input:checked) .gate-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.gate-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gate-title {
  font-weight: 850;
}

.gate-desc {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.gate-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

.gate-status-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #BBF7D0;
}

.gate-status-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #FECACA;
}

.range-control {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.range-head strong {
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 900;
}

.range-input {
  width: 100%;
  accent-color: var(--primary);
}

.range-input:disabled {
  opacity: 0.55;
}
.form-control,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  min-height: 48px;
}
.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.input-group {
  position: relative;
}
.input-group .form-control { padding-left: 44px; }
.input-group .input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-group .input-suffix {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.input-group.has-suffix .form-control { padding-right: 50px; }

/* Radio / checkbox as pill card */
.pill-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.pill-group label {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: var(--surface);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  transition: all .18s var(--ease);
}
.pill-group label:hover { border-color: var(--primary-200); }
.pill-group input { display: none; }
.pill-group input:checked + span,
.pill-group label.selected {
  color: var(--primary-dark);
}
.pill-group label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-dark);
  font-weight: 600;
}
.pill-group label i { color: var(--text-muted); }
.pill-group label:has(input:checked) i { color: var(--primary); }

/* BCS scale */
.bcs-scale {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 6px;
}
.bcs-scale label {
  aspect-ratio: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
  transition: all .18s var(--ease);
}
.bcs-scale input { display: none; }
.bcs-scale label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.bcs-radio-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.bcs-radio-card {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: flex-start;
  min-height: 58px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.bcs-radio-card:hover {
  border-color: var(--primary-200);
}
.bcs-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bcs-radio-mark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  margin-top: 1px;
  position: relative;
  background: #fff;
}
.bcs-radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.10);
}
.bcs-radio-card:has(input:focus-visible) {
  outline: 3px solid rgba(5, 150, 105, 0.18);
}
.bcs-radio-card:has(input:checked) .bcs-radio-mark {
  border-color: var(--primary);
}
.bcs-radio-card:has(input:checked) .bcs-radio-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--primary);
}
.bcs-radio-body {
  display: grid;
  gap: 3px;
}
.bcs-radio-title {
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}
.bcs-radio-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.fenotip-section {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.section-head,
.fenotip-component-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.fenotip-component {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-alt);
}
.fenotip-component.is-complete {
  border-color: var(--primary-200);
  background: var(--primary-50);
}
.fenotip-title {
  font-weight: 800;
  color: var(--text);
}
.fenotip-subtitle,
.fenotip-progress {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.fenotip-progress {
  white-space: nowrap;
  font-weight: 700;
}
.fenotip-check-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.fenotip-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: flex-start;
  min-height: 56px;
  padding: 11px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.fenotip-check:hover {
  border-color: var(--primary-200);
}
.fenotip-check input {
  display: none;
}
.fenotip-check:has(input:checked) {
  border-color: var(--primary);
  background: #fff;
}
.fenotip-check:has(input:checked) .gate-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.fenotip-check-title {
  display: block;
  color: var(--text);
  font-weight: 750;
  line-height: 1.35;
}
.fenotip-check-title small {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--warning-50);
  color: var(--warning);
  font-size: 10px;
  font-weight: 800;
}
.fenotip-check-desc {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.bcs-detail {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
}
.bcs-detail-title {
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.bcs-detail-row + .bcs-detail-row {
  margin-top: 8px;
}
.bcs-detail-row span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}
.bcs-detail-row p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-strong); border-radius: 999px;
  transition: .2s var(--ease);
}
.switch .slider:before {
  content: ""; position: absolute; height: 20px; width: 20px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: .2s var(--ease);
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* =========================================================
   Badges
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-primary { background: var(--primary-50); color: var(--primary-dark); border-color: var(--primary-100); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: #DBEAFE; }
.badge-warn { background: var(--warn-soft); color: #B45309; border-color: #FDE68A; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #FECACA; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #BBF7D0; }
.badge-dark { background: #0F172A; color: #fff; border-color: #0F172A; }

.badge-lg { padding: 8px 14px; font-size: 13px; border-radius: 12px; }

/* Category badge (result) */
.cat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}
.cat-sangat-unggul { background: var(--primary); color: #fff; }
.cat-unggul { background: var(--info); color: #fff; }
.cat-cukup { background: var(--warn); color: #fff; }
.cat-tidak { background: var(--danger); color: #fff; }

/* =========================================================
   Stepper
   ========================================================= */
.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 4px;
}
.step-dot {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  transition: background .3s var(--ease);
}
.step-dot.active { background: var(--primary); }
.step-dot.done { background: var(--primary-light); }

.step-meta {
  padding: 4px 16px 12px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.step-meta .label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.step-meta .title { font-size: 15px; font-weight: 700; }

.wizard-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
}
.wizard-nav.single { grid-template-columns: 1fr; }

/* =========================================================
   Lists / result cards
   ========================================================= */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease);
}
.list-item:hover { box-shadow: var(--shadow-sm); }
.list-item .avatar {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--primary-50); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.list-item .body { flex: 1; min-width: 0; }
.list-item .body .title { font-weight: 700; font-size: 14px; }
.list-item .body .meta { color: var(--text-muted); font-size: 12px; }
.list-item .end { text-align: right; }

/* Result score circle */
.score-circle {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--p, 82%), rgba(255,255,255,0.2) 0);
  display: flex; align-items: center; justify-content: center;
  margin: 8px auto 14px;
  position: relative;
}
.score-circle::before {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}
.score-circle .val {
  position: relative;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.score-circle .lbl {
  position: relative; margin-top: -4px;
  font-size: 11px; color: rgba(255,255,255,0.85);
  font-weight: 500;
}

/* Score bar per kriteria */
.score-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.score-row + .score-row { border-top: 1px dashed var(--border); }
.score-row .name { flex: 1; font-size: 13px; font-weight: 500; }
.score-row .bar {
  width: 100px; height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden;
}
.score-row .bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 999px;
}
.score-row .val { font-weight: 700; font-size: 13px; width: 40px; text-align: right; }

/* Input summary */
.step-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.method-card,
.summary-card {
  background: var(--surface-alt);
}
.summary-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--primary-50);
  color: var(--primary-dark);
}
.method-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.method-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.method-option:hover {
  border-color: var(--primary-200);
}
.method-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 2px rgba(5,150,105,0.10);
}
.method-option input {
  display: none;
}
.method-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--bg-soft);
  color: var(--text-muted);
}
.method-option:has(input:checked) .method-mark {
  background: var(--primary);
  color: #fff;
}
.method-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.method-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}
.method-desc {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}
.review-section {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.summary-head + .review-section {
  padding-top: 0;
  border-top: none;
}
.review-section + .review-section {
  margin-top: 14px;
}
.review-section-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.review-section-title i {
  color: var(--primary-dark);
}
.input-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.summary-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.summary-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.summary-label i {
  width: 16px;
  text-align: center;
  color: var(--primary-dark);
}
.summary-value {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* =========================================================
   Table
   ========================================================= */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-alt); }
.table .cell-num { font-variant-numeric: tabular-nums; text-align: right; }

/* =========================================================
   Filter chips
   ========================================================= */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* =========================================================
   Empty state / alert
   ========================================================= */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty i { font-size: 36px; color: var(--text-faint); margin-bottom: 10px; }
.empty .title { font-weight: 700; color: var(--text); margin-bottom: 4px; }

.alert {
  display: flex; gap: 12px; padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-info { background: var(--info-soft); border-color: #DBEAFE; color: #1E3A8A; }
.alert-warn { background: var(--warn-soft); border-color: #FDE68A; color: #78350F; }
.alert-danger { background: var(--danger-soft); border-color: #FECACA; color: #7F1D1D; }
.alert-success { background: var(--success-soft); border-color: #BBF7D0; color: #14532D; }

/* =========================================================
   Modal
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s var(--ease);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 20px 20px 20px 20px;
  padding: 22px 20px 20px;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slideUp .28s var(--ease);
  margin-bottom: 20px;
}
.modal .modal-title { font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.modal .modal-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.modal .modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-50); color: var(--primary);
  margin-bottom: 12px; font-size: 22px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Loading */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner.dark { border-color: rgba(15,23,42,0.15); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Landing page (mobile hero)
   ========================================================= */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 400px at 90% -20%, rgba(255,255,255,0.15), transparent),
    linear-gradient(160deg, #065F46 0%, #047857 55%, #059669 100%);
  color: #fff;
  padding: 26px 20px 32px;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; right: -60px; bottom: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.hero-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.hero-brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(8px);
}
.hero-brand .name { font-weight: 700; letter-spacing: -0.01em; }
.hero-brand .name small { display: block; font-size: 11px; opacity: 0.75; font-weight: 500; }

.hero h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 8px 0 12px;
  font-weight: 800;
}
.hero .lead {
  font-size: 14px; opacity: 0.92; margin-bottom: 22px;
  max-width: 90%;
}
.hero-actions { display: flex; flex-direction: column; gap: 10px; }
.hero-actions .btn-primary { background: #fff; color: var(--primary-darker); box-shadow: 0 12px 30px rgba(0,0,0,0.15); }
.hero-actions .btn-primary:hover { background: #F0FDF4; }
.hero-actions .btn-outline { border-color: rgba(255,255,255,0.4); color: #fff; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }
.hero-actions .btn-ghost { color: rgba(255,255,255,0.9); }
.hero-actions .btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

.section {
  padding: 24px 16px;
}
.section h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.section .lead {
  color: var(--text-muted); font-size: 13px; margin-bottom: 16px;
}
.benefit-list { display: grid; gap: 10px; }
.benefit {
  display: flex; gap: 12px; padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.benefit .icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-50); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.benefit .body .title { font-weight: 700; font-size: 14px; }
.benefit .body .desc { color: var(--text-muted); font-size: 13px; }

.flow-list { display: flex; flex-direction: column; gap: 0; }
.flow-item {
  display: flex; gap: 14px; padding: 4px 0;
  position: relative;
}
.flow-item .num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
  z-index: 2;
}
.flow-item .line {
  position: absolute; left: 16px; top: 34px; bottom: -6px;
  width: 2px; background: var(--primary-100);
}
.flow-item:last-child .line { display: none; }
.flow-item .body { padding: 4px 0 20px; }
.flow-item .body .title { font-weight: 700; font-size: 14px; }
.flow-item .body .desc { color: var(--text-muted); font-size: 13px; }

.criteria-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.criteria-chip {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  font-weight: 500;
}
.criteria-chip i { color: var(--primary); }

.footer {
  padding: 24px 16px 100px;
  background: #0B2E24;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  text-align: center;
}
.footer .brand {
  color: #fff; font-weight: 700; margin-bottom: 4px;
}
.footer .links {
  margin: 12px 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
}
.footer a { color: rgba(255,255,255,0.8); }
.footer a:hover { color: #fff; }
.footer .copy { font-size: 12px; opacity: 0.6; margin-top: 12px; }

/* =========================================================
   Auth pages
   ========================================================= */
.auth-shell {
  min-height: 100vh;
  max-width: var(--app-max);
  margin: 0 auto;
  background: var(--surface);
  padding: 22px 22px 40px;
  display: flex; flex-direction: column;
}
.auth-back {
  align-self: flex-start;
  padding: 8px 12px 8px 0;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
}
.auth-logo {
  width: 60px; height: 60px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 18px 0 22px;
  box-shadow: 0 12px 26px rgba(6,95,70,0.25);
}
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 22px;
}
.auth-tabs a {
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .18s var(--ease);
}
.auth-tabs a.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.auth-footer {
  margin-top: auto;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 22px;
}

/* =========================================================
   Admin desktop layout
   ========================================================= */
.admin-body {
  background: var(--bg);
  min-height: 100vh;
}
.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
.sidebar {
  display: none;
}
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 30;
}
.admin-topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
}
.admin-topbar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.admin-topbar .spacer { flex: 1; }
.admin-topbar .user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--surface-alt);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.admin-topbar .user-chip .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}

.admin-main {
  padding: 20px 16px 40px;
}

@media (min-width: 900px) {
  body.admin-body { background: var(--bg); }
  .admin-layout {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
  .sidebar {
    display: flex; flex-direction: column;
    background: #0B2E24;
    color: rgba(255,255,255,0.85);
    padding: 22px 16px;
    position: sticky; top: 0;
    height: 100vh;
  }
  .sidebar .sb-brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 24px;
  }
  .sidebar .sb-brand .logo {
    width: 38px; height: 38px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
  }
  .sidebar .sb-brand .name { color: #fff; font-weight: 700; }
  .sidebar .sb-brand .name small { display: block; font-size: 11px; opacity: 0.7; font-weight: 500; }
  .sidebar .sb-section {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    margin: 18px 8px 8px;
  }
  .sidebar .sb-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
  }
  .sidebar .sb-item i { width: 20px; text-align: center; }
  .sidebar .sb-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
  .sidebar .sb-item.active { background: var(--primary); color: #fff; }
  .sidebar .sb-footer { margin-top: auto; padding-top: 16px; font-size: 12px; opacity: 0.6; }

  .admin-topbar { border-radius: 0; }
  .admin-main { padding: 26px 30px 40px; }
  .admin-topbar .brand { display: none; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .criteria-grid { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
  .app-shell { max-width: 100%; padding-bottom: 0; }
  .bottom-nav { display: none; }
}

/* Utilities */
.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.grid-2c { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3c { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pbbh-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-alt);
}
.pbbh-panel + .pbbh-panel,
.pbbh-panel + .alert {
  margin-top: 12px;
}
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-primary { color: var(--primary-dark); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

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

@media (min-width: 420px) {
  .input-summary {
    grid-template-columns: 1fr 1fr;
  }
}
