:root {
  font-family: Inter, system-ui, Arial;
  background: var(--bg-main);
  color: var(--text-main);
}

html, body, #root {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-main);
  color: var(--text-main);
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='900'%20viewBox='0%200%20240%20900'%20fill='none'%3E%3Cpath%20d='M120%2040%20C%2095%20130%20145%20220%20120%20310%20C%2095%20400%20145%20490%20120%20580%20C%2095%20670%20145%20760%20120%20850'%20stroke='%23ffffff'%20stroke-opacity='0.07'%20stroke-width='6'%20stroke-linecap='round'/%3E%3Ccircle%20cx='120'%20cy='110'%20r='10'%20fill='%23d17645'%20fill-opacity='0.08'/%3E%3Ccircle%20cx='120'%20cy='210'%20r='9'%20fill='%23d17645'%20fill-opacity='0.07'/%3E%3Ccircle%20cx='120'%20cy='310'%20r='9'%20fill='%23d17645'%20fill-opacity='0.07'/%3E%3Ccircle%20cx='120'%20cy='410'%20r='9'%20fill='%23d17645'%20fill-opacity='0.07'/%3E%3Ccircle%20cx='120'%20cy='510'%20r='9'%20fill='%23d17645'%20fill-opacity='0.07'/%3E%3Ccircle%20cx='120'%20cy='610'%20r='10'%20fill='%23d17645'%20fill-opacity='0.08'/%3E%3Ccircle%20cx='120'%20cy='710'%20r='10'%20fill='%23d17645'%20fill-opacity='0.08'/%3E%3C/svg%3E"),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.028) 0,
      rgba(255, 255, 255, 0.028) 1px,
      transparent 1px,
      transparent 32px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.028) 0,
      rgba(255, 255, 255, 0.028) 1px,
      transparent 1px,
      transparent 32px
    ),
    repeating-radial-gradient(
      circle at -18% 18%,
      transparent 0 18px,
      rgba(209, 118, 69, 0.14) 18px 19px,
      transparent 19px 36px
    ),
    radial-gradient(
      circle at 30% 22%,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.0) 60%
    );
  background-size:
    260px 900px,
    32px 32px,
    32px 32px,
    260px 260px,
    1px 1px;
  background-position:
    left 8% center,
    0 0,
    0 0,
    0 0,
    1px 1px;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 52%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

#root {
  position: relative;
  z-index: 1;
}

input,
select,
button,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

.app { min-height: 100vh; }
.header { padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); display:flex; gap:12px; align-items: baseline; }
.brand { font-weight: 700; letter-spacing: 0.3px; }
.subtitle { opacity: 0.7; }
.container { padding: 24px; max-width: 1200px; margin: 0 auto; }

.bf-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.bf-page--wide {
  max-width: 1400px;
}

.bf-page--full {
  max-width: none;
}

.bf-page--compact {
  gap: 8px;
}

.bf-page--compact .bf-page-header {
  gap: 10px;
}

.bf-page--compact .bf-page-title {
  font-size: 1.35rem;
}

.bf-page--compact .bf-page-subtitle {
  margin-top: 2px;
}

.bf-page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.bf-page-header--center {
  align-items: center;
}

.bf-page-title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.2px;
}

.bf-page-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.bf-landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow: hidden;
}

.bf-landing::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    radial-gradient(520px 320px at 30% 20%, rgba(249, 115, 22, 0.22), transparent 70%),
    radial-gradient(460px 300px at 70% 65%, rgba(251, 191, 36, 0.18), transparent 72%);
  filter: blur(24px);
  opacity: 0.9;
  animation: bf-landing-pulse 7.5s ease-in-out infinite;
  pointer-events: none;
}

.bf-landing-inner {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 30px 34px;
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.42);
  box-shadow:
    0 30px 80px rgba(8, 12, 32, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.bf-landing.is-exiting .bf-landing-inner {
  opacity: 0;
  transform: translateY(-6px) scale(0.995);
}

.bf-landing-visual {
  position: relative;
  width: 178px;
  height: 178px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 24px 46px rgba(249, 115, 22, 0.22));
  animation: bf-landing-float 6.5s ease-in-out infinite;
}

.bf-landing-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bf-landing-spine {
  fill: none;
  stroke: rgba(238, 242, 255, 0.88);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.18));
}

.bf-landing-vertebra {
  fill: rgba(238, 242, 255, 0.95);
  stroke: rgba(249, 115, 22, 0.6);
  stroke-width: 1.4;
  animation: bf-landing-vertebra-pulse 3.4s ease-in-out infinite;
}

.bf-landing-svg circle:nth-of-type(1) { animation-delay: -0.4s; }
.bf-landing-svg circle:nth-of-type(2) { animation-delay: -0.1s; }
.bf-landing-svg circle:nth-of-type(3) { animation-delay: -0.6s; }
.bf-landing-svg circle:nth-of-type(4) { animation-delay: -0.2s; }
.bf-landing-svg circle:nth-of-type(5) { animation-delay: -0.5s; }

.bf-landing-brace {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0.9;
  filter: drop-shadow(0 0 18px rgba(249, 115, 22, 0.38));
  animation: bf-landing-brace-glow 4.8s ease-in-out infinite;
}

.bf-landing-brace--left {
  animation-delay: -0.6s;
}

.bf-landing-brace--right {
  animation-delay: -1.1s;
}

.bf-landing-pad {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.88;
  filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.32));
  animation: bf-landing-pad-pulse 3.8s ease-in-out infinite;
}

.bf-landing-mark {
  display: flex;
  align-items: center;
  gap: 0;
}

.bf-landing-wordmark {
  font-size: clamp(28px, 4.4vw, 34px);
  font-weight: 800;
  letter-spacing: 0.3px;
}

.bf-landing-slogan {
  margin: 2px 0 0;
  color: var(--text-muted);
  max-width: 46ch;
  font-size: 1.02rem;
}

.bf-landing-progress {
  width: min(220px, 62vw);
  height: 7px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 6px;
}

.bf-landing-progress-bar {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.9), rgba(249, 115, 22, 0.95));
  animation: bf-landing-sweep 1.6s ease-in-out infinite;
}

@keyframes bf-landing-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes bf-landing-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.01);
  }
}

@keyframes bf-landing-brace-glow {
  0%,
  100% {
    opacity: 0.72;
    filter: drop-shadow(0 0 14px rgba(249, 115, 22, 0.3));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 24px rgba(249, 115, 22, 0.5));
  }
}

@keyframes bf-landing-vertebra-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes bf-landing-pad-pulse {
  0%,
  100% {
    opacity: 0.76;
  }
  50% {
    opacity: 1;
  }
}

@keyframes bf-landing-sweep {
  0% {
    transform: translateX(-120%);
  }
  60% {
    transform: translateX(210%);
  }
  100% {
    transform: translateX(210%);
  }
}

@media (max-width: 720px) {
  .bf-landing-inner {
    padding: 26px 26px;
    border-radius: 20px;
  }

  .bf-landing-visual {
    width: 154px;
    height: 154px;
  }
}

.bf-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bf-spacer {
  flex: 1 1 auto;
}

.bf-flex-1 {
  flex: 1 1 auto;
  min-width: 0;
}

.bf-col-tight {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bf-row-gap-16 {
  display: flex;
  gap: 16px;
}

.bf-row-end-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.bf-mt-6 {
  margin-top: 6px;
}

.bf-mt-8 {
  margin-top: 8px;
}

.bf-mt-10 {
  margin-top: 10px;
}

.bf-mt-12 {
  margin-top: 12px;
}

.bf-mt-14 {
  margin-top: 14px;
}

.bf-mb-6 {
  margin-bottom: 6px;
}

.bf-mb-8 {
  margin-bottom: 8px;
}

.bf-empty {
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed var(--border-soft);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.bf-dashed-panel {
  padding: 24px;
  border-radius: 10px;
  border: 1px dashed var(--border-soft);
  background: rgba(255,255,255,0.06);
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
  box-shadow:
    0 10px 30px rgba(10, 15, 35, 0.35),
    0 0 32px rgba(210, 225, 255, 0.08);
}

.row { display:flex; align-items:center; }
.row.space { justify-content: space-between; }
.row.right { justify-content: flex-end; }
.row.gap { gap: 10px; }
.row.center { align-items: center; }
.row.wrap { flex-wrap: wrap; }

.input {
  flex:1;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.25);
  color: var(--text-main);
}

.input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: rgba(0,0,0,0.32);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.10);
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.btn:hover:not(:disabled) {
  background: rgba(209, 118, 69, 0.14);
  border-color: rgba(209, 118, 69, 0.35);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn.primary {
  background: var(--accent-primary);
  border-color: transparent;
  color: #0b1020;
  font-weight: 700;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-secondary);
}

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

.btn.subtle {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-soft);
}

.btn.subtle:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(209, 118, 69, 0.08);
  border-color: rgba(209, 118, 69, 0.3);
}

.btn.small {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 9px;
}

.bf-btn-fixed {
  min-width: 112px;
}

.bf-btn-regular {
  font-weight: 700;
}

.muted { opacity: 0.7; margin-top: 8px; }
.muted--tight { margin-top: 0; }
.muted--small { font-size: 12px; }

.bf-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bf-strong {
  font-weight: 900;
}

.bf-dashboard-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.bf-controls-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.bf-controls-group--search {
  flex: 1 1 280px;
  min-width: 220px;
}

.bf-control-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.bf-search-input {
  width: min(100%, 520px);
  align-self: flex-start;
}

.bf-select {
  height: 45px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.22);
  color: var(--text-main);
  font-weight: 600;
}

.bf-select:focus {
  outline: none;
  border-color: var(--border-strong);
  background: rgba(0,0,0,0.3);
}

.bf-case-count {
  flex: 1 1 100%;
  text-align: right;
  margin-top: 4px;
}

.bf-table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .bf-controls-group--search {
    flex: 1 1 100%;
    min-width: 0;
  }

  .bf-search-input {
    width: 96%;
  }
}

@media (max-width: 720px) {
  .bf-controls-group {
    flex: 1 1 100%;
  }

  .bf-case-count {
    text-align: left;
  }
}

.error { margin-top: 12px; padding: 10px; border-radius: 10px; background: rgba(255,0,0,0.12); border: 1px solid rgba(255,0,0,0.25); }
.notice { margin-top: 12px; padding: 10px; border-radius: 10px; background: rgba(0,170,255,0.12); border: 1px solid rgba(0,170,255,0.25); }

.landmark-layout { display:grid; grid-template-columns: 320px 1fr; gap: 14px; margin-top: 14px; }
.panel { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 14px; }
.list { margin: 10px 0 0; padding-left: 18px; }
.list li { margin: 10px 0; }
.list li.active .label { font-weight: 700; }
.label { margin-bottom: 4px; }
.meta { opacity: 0.7; font-size: 12px; }
.pill { opacity: 0.8; font-size: 12px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); }

.canvasWrap { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px; }
.imgWrap { position: relative; display: inline-block; cursor: crosshair; }
.xray { max-width: 100%; border-radius: 12px; display:block; }
.overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.hint { margin-top: 8px; opacity: 0.7; font-size: 12px; }

.table { width:100%; border-collapse: collapse; margin-top: 14px; }
.table thead th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.table tbody td {
  text-align:left;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.table tbody tr {
  transition: background 120ms ease;
}

.table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}

.table td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.summary { display:flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }

.bf-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.bf-summary-item {
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.04);
}

.bf-summary-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bf-summary-value {
  font-weight: 800;
}

.tag { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.10); font-size: 12px; }
.tag.pending { opacity: 0.8; }
.tag.running { border-color: rgba(124,156,255,0.55); background: rgba(124,156,255,0.16); }
.tag.done { border-color: rgba(0,255,140,0.35); background: rgba(0,255,140,0.10); }
.tag.waiting_for_landmarks { border-color: rgba(124,156,255,0.5); background: rgba(124,156,255,0.12); }

.bf-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.06);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
  letter-spacing: 0.2px;
}

.bf-status-badge.is-created,
.bf-status-badge.is-processing {
  background: var(--accent-primary);
  border-color: transparent;
  color: #0b1020;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.35);
}

.bf-status-badge.is-failed {
  background: rgba(251, 113, 133, 0.18);
  border-color: rgba(251, 113, 133, 0.45);
  color: #ffd1da;
}

/* ========================================
   Rigo Shell Generator Styles
   ======================================== */

/* Shell Generation Page Layout */
.rigo-shell-page {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 16px;
  min-height: calc(100vh - 120px);
}

@media (max-width: 1200px) {
  .rigo-shell-page {
    grid-template-columns: 280px 1fr 320px;
  }
}

@media (max-width: 992px) {
  .rigo-shell-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 400px auto;
  }
}

/* Two column layout (no right panel) */
.rigo-shell-page--two-col {
  grid-template-columns: 360px 1fr;
}

@media (max-width: 1200px) {
  .rigo-shell-page--two-col {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 992px) {
  .rigo-shell-page--two-col {
    grid-template-columns: 1fr;
    grid-template-rows: auto 500px;
  }
}

/* Rigo Panels */
.rigo-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.rigo-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.rigo-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rigo-panel-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

/* 3D Viewer Container */
.rigo-viewer-container {
  position: relative;
  background: #111827;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  min-height: 400px;
}

.rigo-viewer-canvas {
  width: 100%;
  height: 100%;
}

.rigo-viewer-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
}

.rigo-viewer-control-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.rigo-viewer-control-btn:hover {
  background: rgba(209, 118, 69, 0.18);
  color: #f8fafc;
}

.rigo-viewer-control-btn.active {
  background: var(--accent-primary);
  color: #0b1020;
}

/* Upload Component */
.rigo-upload-zone {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(249, 115, 22, 0.04);
  display: block;
}

.rigo-upload-zone:hover {
  border-color: var(--accent-primary);
  background: rgba(249, 115, 22, 0.08);
}

.rigo-upload-zone.dragging {
  border-color: var(--accent-primary);
  background: rgba(249, 115, 22, 0.14);
  transform: scale(1.01);
}

.rigo-upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--accent-primary);
}

.rigo-upload-text {
  font-size: 0.9375rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.rigo-upload-hint {
  font-size: 0.8125rem;
  color: #64748b;
}

.rigo-upload-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.rigo-upload-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.rigo-upload-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

/* Progress Steps */
.rigo-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rigo-progress-step {
  display: flex;
  gap: 12px;
}

.rigo-progress-step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rigo-progress-step.active .rigo-progress-step-indicator {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: #0b1020;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.35);
}

.rigo-progress-step.completed .rigo-progress-step-indicator {
  border-color: #22c55e;
  background: #16a34a;
  color: white;
}

.rigo-progress-step-content {
  flex: 1;
  padding-top: 4px;
}

.rigo-progress-step-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.rigo-progress-step-description {
  font-size: 0.8125rem;
  color: #64748b;
}

/* Analysis Results */
.rigo-analysis-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.rigo-analysis-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.rigo-analysis-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
}

.rigo-analysis-value.highlight {
  color: var(--accent-primary);
}

.rigo-analysis-value.success {
  color: #4ade80;
}

.rigo-analysis-value.warning {
  color: #fbbf24;
}

.rigo-analysis-description {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 4px;
}

.rigo-analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Status message */
.rigo-status-message {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text-main);
}

/* Buttons */
.rigo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.rigo-btn-primary {
  background: var(--accent-primary);
  color: #0b1020;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 0 20px rgba(209, 118, 69, 0.25);
}

.rigo-btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 0 30px rgba(209, 118, 69, 0.35);
}

.rigo-btn-secondary {
  background: rgba(51, 65, 85, 0.5);
  color: #f1f5f9;
  border: 1px solid rgba(255,255,255,0.15);
}

.rigo-btn-secondary:hover {
  background: rgba(209, 118, 69, 0.14);
  border-color: rgba(209, 118, 69, 0.3);
}

.rigo-btn-lg {
  padding: 16px 24px;
  font-size: 1rem;
}

.rigo-btn-block {
  width: 100%;
}

.rigo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Loading States */
.rigo-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: rigo-spin 0.8s linear infinite;
  display: inline-block;
}

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

.rigo-loading-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: rigo-shimmer 1.5s infinite;
  border-radius: 8px;
}

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

/* ========================================
   Shell Editor (SculptGL) Styles
   ======================================== */

.shell-editor-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  min-height: 600px;
}

.shell-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  flex-shrink: 0;
}

.shell-editor-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.shell-editor-actions {
  display: flex;
  gap: 10px;
}

.shell-editor-container {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: #1a1a2e;
  margin: 8px 0;
  min-height: 0;
}

.shell-editor-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.shell-editor-tips {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 12px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.shell-editor-tips strong {
  color: var(--accent-primary);
}

.shell-editor-tips span {
  padding: 3px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

/* ========================================
   Dashboard Upload Zone & Case Cards
   ======================================== */

.bf-upload-zone {
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(249, 115, 22, 0.04);
}

.bf-upload-zone:hover {
  border-color: var(--accent-primary);
  background: rgba(249, 115, 22, 0.08);
}

.bf-upload-zone--active {
  border-color: var(--accent-primary);
  background: rgba(249, 115, 22, 0.14);
  transform: scale(1.01);
}

.bf-upload-zone--uploading {
  cursor: wait;
  pointer-events: none;
}

.bf-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bf-upload-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-primary);
  font-size: 32px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.bf-upload-text {
  font-size: 1rem;
  color: var(--text-main);
  margin: 0;
}

.bf-upload-text strong {
  color: var(--accent-primary);
}

.bf-upload-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.bf-upload-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: bf-spin 0.8s linear infinite;
  margin-bottom: 8px;
}

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

.bf-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text-main);
}

.bf-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.bf-case-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bf-case-card:hover {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-2px);
}

.bf-case-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bf-case-card-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bf-case-card-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.bf-case-card-status--brace_generated {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.bf-case-card-status--processing_brace {
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent-primary);
}

.bf-case-card-status--brace_failed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.bf-case-card-status--created,
.bf-case-card-status--uploaded {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.bf-case-card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.bf-case-card-angles {
  display: flex;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bf-case-card-angles span {
  padding: 4px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
}

/* ========================================
   Cases Row List
   ======================================== */

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

.bf-case-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bf-case-row:hover {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.3);
}

.bf-case-row--deleting {
  opacity: 0.5;
  pointer-events: none;
}

/* Thumbnail */
.bf-case-thumb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-soft);
}

.bf-case-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bf-case-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Case Info */
.bf-case-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bf-case-row-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bf-case-row-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Menu */
.bf-case-menu-container {
  position: relative;
  flex-shrink: 0;
}

.bf-case-menu-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.bf-case-menu-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
}

.bf-case-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 140px;
  background: #1e1e1e;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  overflow: hidden;
}

.bf-case-dropdown-item {
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bf-case-dropdown-item:hover {
  background: rgba(255,255,255,0.08);
}

.bf-case-dropdown-item--danger {
  color: #f87171;
}

.bf-case-dropdown-item--danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.bf-case-menu-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: bf-spin 0.6s linear infinite;
}

.bf-case-row-status {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.bf-case-row-status--brace_generated {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.bf-case-row-status--processing_brace {
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent-primary);
}

.bf-case-row-status--brace_failed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.bf-case-row-status--created,
.bf-case-row-status--uploaded {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.bf-case-row-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bf-case-row-angles {
  padding: 2px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
}

/* ========================================
   Case Detail Page
   ======================================== */

.bf-case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.bf-case-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.bf-case-header-right {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.bf-back-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.bf-back-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-main);
}

.bf-case-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.bf-case-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.bf-case-status--brace_generated {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.bf-case-status--processing_brace {
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent-primary);
}

.bf-case-status--brace_failed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.bf-case-status--created,
.bf-case-status--uploaded {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.bf-case-date {
  color: var(--text-muted);
}

.bf-case-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bf-case-xray-section,
.bf-case-analysis-section,
.bf-case-downloads {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
}

.bf-xray-container {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.bf-xray-image {
  max-width: 100%;
  max-height: 500px;
  border-radius: 12px;
  object-fit: contain;
}

.bf-xray-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed var(--border-soft);
  border-radius: 12px;
  color: var(--text-muted);
}

.bf-viz-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.bf-viz-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  object-fit: contain;
}

.bf-cobb-angles,
.bf-rigo-classification,
.bf-curve-type {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.bf-cobb-angles h3,
.bf-rigo-classification h3,
.bf-curve-type h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
}

.bf-angles-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.bf-angle-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bf-angle-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.bf-angle-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.bf-rigo-type {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.bf-rigo-desc {
  color: var(--text-muted);
  margin: 0;
}

.bf-curve-type span {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
}

.bf-downloads-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.bf-download-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 8px;
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.bf-download-btn:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.5);
}

/* Processing Indicator */
.bf-processing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 12px;
  color: var(--accent-primary);
  font-weight: 500;
}

.bf-processing-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: bf-spin 0.8s linear infinite;
}

/* Generate Section */
.bf-generate-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.bf-generate-btn {
  padding: 14px 28px;
  font-size: 1rem;
}

/* Analysis Info Grid */
.bf-analysis-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.bf-analysis-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}

.bf-analysis-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bf-analysis-info-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Classification Row */
.bf-classification-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.bf-classification-row .bf-rigo-classification,
.bf-classification-row .bf-curve-type {
  flex: 1;
  min-width: 200px;
  margin: 0;
  padding: 0;
  border: none;
}

.bf-curve-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Visualization Section */
.bf-case-viz-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
}

.bf-case-viz-section .bf-viz-container {
  margin-top: 16px;
  margin-bottom: 0;
}

.bf-case-viz-section .bf-viz-image {
  max-height: 600px;
  width: 100%;
  object-fit: contain;
}

/* Download Hint */
.bf-download-hint {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Download Cards Grid */
.bf-downloads-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bf-download-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.bf-download-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--accent-primary);
}

.bf-download-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.bf-download-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bf-download-card-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-all;
}

.bf-download-card-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bf-download-card-actions {
  display: flex;
  gap: 8px;
}

.bf-action-btn {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.bf-action-download {
  background: var(--accent-primary);
  color: #fff;
}

.bf-action-download:hover {
  background: #ea580c;
  color: #fff;
}

.bf-action-editor {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.bf-action-editor:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.bf-editor-hint {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bf-editor-hint code {
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  color: #a5b4fc;
}

/* ========================================
   Detailed Analysis Styles
   ======================================== */

.bf-detailed-analysis {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bf-analysis-block {
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.bf-analysis-block h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 16px;
}

.bf-block-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* Cobb Angles Detailed */
.bf-cobb-detailed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bf-cobb-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.bf-cobb-name {
  font-size: 0.875rem;
  color: var(--text-main);
}

.bf-cobb-value {
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}

.bf-cobb-value.severity-normal {
  color: #4ade80;
}

.bf-cobb-value.severity-mild {
  color: #fbbf24;
}

.bf-cobb-value.severity-moderate {
  color: #f97316;
}

.bf-cobb-value.severity-severe {
  color: #ef4444;
}

.bf-cobb-severity {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  min-width: 80px;
  text-align: center;
}

/* Classification Grid */
.bf-classification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.bf-classification-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
}

.bf-classification-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bf-classification-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.bf-curve-badge {
  color: var(--accent-primary);
}

.bf-rigo-badge {
  color: #60a5fa;
}

.bf-classification-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Brace Details Grid */
.bf-brace-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.bf-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.bf-detail-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bf-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Pressure Zones */
.bf-pressure-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.bf-zone-item {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.15);
}

.bf-zone-item.bf-zone-pressure {
  border-left: 4px solid #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.bf-zone-item.bf-zone-relief {
  border-left: 4px solid #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.bf-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.bf-zone-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.bf-zone-value {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.bf-zone-value.bf-pressure {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.bf-zone-value.bf-relief {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.bf-zone-reason {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bf-patch-info {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* ========================================
   Login Page Styles
   ======================================== */

.bf-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-main);
}

.bf-login-container {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.bf-login-header {
  text-align: center;
  margin-bottom: 32px;
}

.bf-login-brand {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text-main);
  margin: 0 0 8px;
}

.bf-login-subtitle {
  color: var(--text-muted);
  margin: 0;
}

.bf-login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bf-login-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.875rem;
}

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

.bf-form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.bf-form-input {
  height: 48px;
  padding: 0 16px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.bf-form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.bf-form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(221, 130, 80, 0.2);
}

.bf-form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bf-login-btn {
  height: 48px;
  margin-top: 8px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--accent-primary);
  color: #0b1020;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.bf-login-btn:hover:not(:disabled) {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.bf-login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.bf-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bf-login-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: bf-spin 0.8s linear infinite;
}

.bf-login-hint {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.bf-login-hint code {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  color: var(--accent-secondary);
}

/* ========================================
   Home Page Styles
   ======================================== */

.bf-home-page {
  min-height: 100vh;
  background: var(--bg-main);
  overflow-x: hidden;
}

/* Hero Section */
.bf-hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 60px 40px;
  position: relative;
}

.bf-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 400px at 30% 40%, rgba(221, 130, 80, 0.12), transparent 70%),
    radial-gradient(500px 350px at 70% 60%, rgba(96, 122, 155, 0.1), transparent 70%);
  pointer-events: none;
}

.bf-hero-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.bf-hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  margin: 0 0 20px;
}

.bf-hero-accent {
  color: var(--accent-primary);
  display: block;
}

.bf-hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 32px;
}

.bf-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.bf-hero-btn {
  height: 48px;
  padding: 0 28px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bf-hero-btn--primary {
  background: var(--accent-primary);
  color: #0b1020;
  box-shadow: 0 4px 20px rgba(221, 130, 80, 0.3);
}

.bf-hero-btn--primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(221, 130, 80, 0.4);
}

.bf-hero-btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.bf-hero-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-strong);
}

.bf-hero-visual {
  position: relative;
  z-index: 1;
  width: 260px;
  height: 380px;
  flex-shrink: 0;
}

.bf-hero-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 20px 40px rgba(221, 130, 80, 0.15));
}

.bf-hero-spine {
  animation: heroSpinePulse 4s ease-in-out infinite;
}

.bf-hero-vertebra {
  animation: heroVertebraPulse 3s ease-in-out infinite;
}

.bf-hero-brace {
  animation: heroBraceGlow 5s ease-in-out infinite;
}

@keyframes heroSpinePulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.5; }
}

@keyframes heroVertebraPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes heroBraceGlow {
  0%, 100% { opacity: 0.5; stroke-width: 3; }
  50% { opacity: 0.8; stroke-width: 4; }
}

/* Features Section */
.bf-features {
  padding: 60px 40px;
  background: rgba(0, 0, 0, 0.15);
}

.bf-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.bf-feature-card {
  padding: 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  transition: all 0.2s ease;
}

.bf-feature-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(221, 130, 80, 0.3);
  transform: translateY(-4px);
}

.bf-feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(221, 130, 80, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.bf-feature-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 10px;
}

.bf-feature-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Workflow Section */
.bf-workflow {
  padding: 60px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.bf-section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin: 0 0 40px;
}

.bf-workflow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.bf-workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  min-width: 140px;
}

.bf-workflow-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #0b1020;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(221, 130, 80, 0.3);
}

.bf-workflow-content {
  text-align: center;
}

.bf-workflow-content h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
}

.bf-workflow-content p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.bf-workflow-connector {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), rgba(221, 130, 80, 0.3));
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .bf-hero {
    flex-direction: column;
    text-align: center;
    padding: 40px 24px;
    min-height: auto;
  }

  .bf-hero-visual {
    width: 200px;
    height: 280px;
    order: -1;
  }

  .bf-hero-actions {
    justify-content: center;
  }

  .bf-workflow-steps {
    flex-direction: column;
  }

  .bf-workflow-connector {
    width: 2px;
    height: 24px;
    background: linear-gradient(180deg, var(--accent-primary), rgba(221, 130, 80, 0.3));
  }
}

/* Footer */
.bf-home-footer {
  padding: 24px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border-soft);
}

.bf-home-footer strong {
  color: var(--accent-primary);
}

/* ========================================
   User Menu (Header)
   ======================================== */

.bf-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bf-user-name {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.bf-logout-btn {
  height: 32px;
  padding: 0 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bf-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ========================================
   Loading Screen
   ======================================== */

.bf-loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-main);
  color: var(--text-muted);
}

.bf-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(221, 130, 80, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: bf-spin 0.8s linear infinite;
}

/* ========================================
   Admin Dashboard Styles
   ======================================== */

.bf-admin-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.bf-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.bf-admin-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.bf-admin-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.bf-admin-loading,
.bf-admin-error {
  padding: 20px;
  text-align: center;
  border-radius: 12px;
}

.bf-admin-loading {
  color: var(--text-muted);
}

.bf-admin-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  margin-bottom: 16px;
}

/* Stats Grid */
.bf-admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.bf-admin-stat-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  text-align: center;
}

.bf-admin-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.bf-admin-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Charts Row */
.bf-admin-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.bf-admin-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.bf-admin-card h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.bf-admin-card-subtitle {
  margin: -12px 0 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Status Distribution */
.bf-admin-status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bf-admin-status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bf-admin-status-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.bf-admin-status-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bf-admin-status-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.bf-admin-status-name {
  color: var(--text-muted);
  text-transform: capitalize;
}

.bf-admin-status-count {
  color: var(--text-main);
  font-weight: 600;
}

/* Rigo Distribution */
.bf-admin-rigo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.bf-admin-rigo-item {
  text-align: center;
  padding: 12px;
  background: rgba(221, 130, 80, 0.1);
  border: 1px solid rgba(221, 130, 80, 0.3);
  border-radius: 10px;
}

.bf-admin-rigo-type {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.bf-admin-rigo-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Cobb Angle Stats */
.bf-admin-cobb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bf-admin-cobb-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 16px;
}

.bf-admin-cobb-header {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 12px;
  text-align: center;
}

.bf-admin-cobb-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bf-admin-cobb-stat {
  display: flex;
  justify-content: space-between;
}

.bf-admin-cobb-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bf-admin-cobb-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Processing Stats */
.bf-admin-processing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bf-admin-processing-stat {
  text-align: center;
}

.bf-admin-processing-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bf-admin-processing-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Body Scan Stats */
.bf-admin-bodyscan-stats {
  display: flex;
  gap: 24px;
  align-items: center;
}

.bf-admin-bodyscan-chart {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bf-admin-bodyscan-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent-primary);
  transition: height 0.3s ease;
}

.bf-admin-bodyscan-percentage {
  position: relative;
  z-index: 1;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.bf-admin-bodyscan-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bf-admin-bodyscan-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bf-admin-bodyscan-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.bf-admin-bodyscan-dot--with {
  background: var(--accent-primary);
}

.bf-admin-bodyscan-dot--without {
  background: rgba(255, 255, 255, 0.3);
}

/* Quick Links */
.bf-admin-quick-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bf-admin-link-btn {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bf-admin-link-btn:hover {
  background: rgba(221, 130, 80, 0.1);
  border-color: rgba(221, 130, 80, 0.4);
}

.bf-admin-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

/* Admin Tables */
.bf-admin-table-container {
  overflow-x: auto;
}

.bf-admin-table {
  width: 100%;
  border-collapse: collapse;
}

.bf-admin-table th,
.bf-admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

.bf-admin-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bf-admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.bf-admin-row-disabled {
  opacity: 0.5;
}

.bf-admin-sortable {
  cursor: pointer;
}

.bf-admin-sortable:hover {
  color: var(--text-main);
}

.bf-admin-cell-username {
  font-weight: 600;
  color: var(--text-main);
}

.bf-admin-cell-caseid code {
  font-size: 0.8125rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
}

.bf-admin-cell-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bf-admin-cell-time {
  font-size: 0.75rem;
  opacity: 0.7;
}

.bf-admin-cell-cobb {
  font-size: 0.8125rem;
}

.bf-admin-cobb-inline {
  display: flex;
  gap: 8px;
}

.bf-admin-cobb-inline span {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* Role and Status Badges */
.bf-admin-role-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.bf-admin-role-admin {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.bf-admin-role-user {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.bf-admin-role-viewer {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.bf-admin-status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bf-admin-status-active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.bf-admin-status-inactive {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.bf-admin-case-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.bf-status-success { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.bf-status-warning { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.bf-status-error { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.bf-status-info { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.bf-status-default { background: rgba(156, 163, 175, 0.2); color: #9ca3af; }

.bf-admin-rigo-badge {
  padding: 4px 10px;
  background: rgba(221, 130, 80, 0.2);
  color: var(--accent-primary);
  border-radius: 6px;
  font-weight: 600;
}

.bf-admin-badge-yes {
  color: #4ade80;
}

.bf-admin-badge-no {
  color: var(--text-muted);
}

/* Actions */
.bf-admin-actions {
  display: flex;
  gap: 8px;
}

.bf-admin-action-btn {
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bf-admin-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.bf-admin-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bf-admin-action-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Filters */
.bf-admin-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bf-admin-search-form {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.bf-admin-search-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9375rem;
}

.bf-admin-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.bf-admin-filter-select {
  height: 40px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9375rem;
}

/* Pagination */
.bf-admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.bf-admin-page-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Empty State */
.bf-admin-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

/* Modal */
.bf-admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.bf-admin-modal {
  width: 100%;
  max-width: 480px;
  background: #1e1e2e;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 24px;
}

.bf-admin-modal h2 {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.bf-admin-form-error {
  padding: 12px;
  margin-bottom: 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.875rem;
}

.bf-admin-form-group {
  margin-bottom: 16px;
}

.bf-admin-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.bf-admin-form-group input,
.bf-admin-form-group select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9375rem;
}

.bf-admin-form-group input:focus,
.bf-admin-form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.bf-admin-form-group input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bf-admin-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Activity Log */
.bf-admin-activity-list {
  display: flex;
  flex-direction: column;
}

.bf-admin-activity-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}

.bf-admin-activity-item:last-child {
  border-bottom: none;
}

.bf-admin-activity-icon {
  padding-top: 4px;
}

.bf-admin-activity-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.bf-action-success .bf-admin-activity-dot,
.bf-action-success { background: rgba(34, 197, 94, 0.3); }
.bf-action-danger .bf-admin-activity-dot,
.bf-action-danger { background: rgba(239, 68, 68, 0.3); color: #f87171; }
.bf-action-warning .bf-admin-activity-dot,
.bf-action-warning { background: rgba(251, 191, 36, 0.3); }
.bf-action-info .bf-admin-activity-dot,
.bf-action-info { background: rgba(59, 130, 246, 0.3); }
.bf-action-default .bf-admin-activity-dot,
.bf-action-default { background: rgba(156, 163, 175, 0.3); }

.bf-admin-activity-content {
  flex: 1;
  min-width: 0;
}

.bf-admin-activity-header {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.bf-admin-activity-action {
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.bf-admin-activity-entity {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.bf-admin-activity-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bf-admin-activity-user {
  font-weight: 500;
  color: var(--text-main);
}

.bf-admin-activity-details {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
}

.bf-admin-activity-detail {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  color: var(--text-muted);
}

.bf-admin-activity-detail strong {
  color: var(--text-main);
}

@media (max-width: 768px) {
  .bf-admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bf-admin-charts-row {
    grid-template-columns: 1fr;
  }
  
  .bf-admin-cobb-grid {
    grid-template-columns: 1fr;
  }
  
  .bf-admin-processing-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .bf-admin-table {
    font-size: 0.8125rem;
  }
  
  .bf-admin-table th,
  .bf-admin-table td {
    padding: 10px 8px;
  }
}