/* ── Google Fonts ────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── Design Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg-base: #f5f7fa;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-input: rgba(0, 0, 0, 0.03);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-normal: rgba(0, 0, 0, 0.15);
  --border-bright: rgba(0, 212, 255, 0.45);

  --accent-cyan: #0098e5;
  --accent-purple: #6720db;
  --accent-green: #00b06b;
  --accent-orange: #ff7722;
  --accent-red: #e53935;
  --accent-yellow: #f0b600;

  --text-primary: #1d1d1f;
  --text-secondary: #4b5563;
  --text-muted: #8a94a6;

  --gradient-accent: linear-gradient(135deg, #0098e5 0%, #6720db 100%);
  --gradient-hero: linear-gradient(135deg, #f5f7fa 0%, #e2e8f0 50%, #eff2f7 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.07);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-w: 272px;
  --header-h: 64px;
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.25);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.5);
}

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* ── Keyframes ───────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bgFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(28px, -28px) scale(1.04);
  }

  66% {
    transform: translate(-20px, 22px) scale(0.96);
  }
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.22), 0 0 60px rgba(0, 212, 255, 0.06);
  }

  50% {
    box-shadow: 0 0 48px rgba(0, 212, 255, 0.44), 0 0 100px rgba(0, 212, 255, 0.14);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

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

@keyframes dotBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }

  30% {
    transform: translateY(-6px);
    opacity: 0.55;
  }
}

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

  100% {
    background-position: 200% center;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes barFill {
  from {
    width: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════════════════════════ */
.login-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  background: var(--gradient-hero);
}

/* Background orbs */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.13;
  animation: bgFloat 14s ease-in-out infinite;
}

.orb-1 {
  width: 560px;
  height: 560px;
  background: var(--accent-cyan);
  top: -180px;
  left: -180px;
  animation-delay: 0s;
}

.orb-2 {
  width: 420px;
  height: 420px;
  background: var(--accent-purple);
  bottom: -120px;
  right: -120px;
  animation-delay: -5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #0033ff;
  top: 45%;
  left: 55%;
  animation-delay: -10s;
}

/* Login container */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding: 24px;
  animation: fadeInScale 0.65s ease both;
}

.login-card {
  padding: 50px 44px;
}

/* Logo */
.login-logo {
  text-align: center;
  margin-bottom: 22px;
}

.logo-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: glowPulse 3s ease-in-out infinite;
}

.logo-ring svg {
  width: 38px;
  height: 38px;
  color: #fff;
}

.login-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 38px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}

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

.form-group input:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--gradient-accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0, 212, 255, 0.38);
}

.btn-primary:hover::after {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 17px;
  transition: transform 0.25s ease;
}

.btn-primary:hover .btn-icon {
  transform: translateX(5px);
}

.error-message {
  padding: 11px 14px;
  background: rgba(255, 71, 87, 0.09);
  border: 1px solid rgba(255, 71, 87, 0.28);
  border-radius: var(--radius-sm);
  color: #ff6070;
  font-size: 13px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   HOME PAGE LAYOUT
═══════════════════════════════════════════════════════════════════════════════ */
.home-body {
  overflow: hidden;
  height: 100vh;
}

.app-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
}

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-ring {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.3);
  flex-shrink: 0;
}

.sidebar-logo-ring svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.sidebar-brand {
  font-size: 14px;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.sidebar-tagline {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-section-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px 16px 8px;
  flex-shrink: 0;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
}

.history-item {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  margin-bottom: 3px;
  animation: slideInLeft 0.3s ease both;
}

.history-item:hover {
  background: rgba(0, 212, 255, 0.06);
  border-color: var(--border-subtle);
}

.history-item.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--border-normal);
}

.history-item-classes {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.history-item-date {
  font-size: 10px;
  color: var(--text-muted);
}

.history-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(255, 71, 87, 0.07);
  border: 1px solid rgba(255, 71, 87, 0.18);
  border-radius: var(--radius-sm);
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(255, 71, 87, 0.14);
  border-color: rgba(255, 71, 87, 0.38);
}

/* ── Main Panel ──────────────────────────────────────────────────────────────── */
.main-panel {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--gradient-hero);
}

.main-header {
  padding: 0 30px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.main-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.main-header-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-green);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s ease-in-out infinite;
}

.main-content {
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
}

/* ── Section Label ────────────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ── Upload Zone ─────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-normal);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(0, 212, 255, 0.018);
  position: relative;
}

.upload-zone:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.055);
  box-shadow: 0 0 48px rgba(0, 212, 255, 0.1);
}

.upload-zone.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.16);
}

.upload-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: var(--transition);
}

.upload-zone:hover .upload-icon-wrap {
  background: rgba(0, 212, 255, 0.16);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.2);
}

.upload-icon-wrap svg {
  width: 26px;
  height: 26px;
  color: var(--accent-cyan);
}

.upload-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

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

.image-preview {
  margin-top: 16px;
}

.preview-img {
  max-height: 200px;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-normal);
  object-fit: contain;
}

.upload-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.btn-analyze {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: var(--gradient-accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.38);
}

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

.btn-clear {
  padding: 11px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.btn-clear:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ── AI Stages ───────────────────────────────────────────────────────────────── */
.ai-stages {
  display: none;
}

.ai-stages.active {
  display: block;
  animation: fadeIn 0.4s ease both;
}

.stages-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-glow);
}

.stages-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.stages-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.18);
  border-top-color: var(--accent-cyan);
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

.stages-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.stages-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.stage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
  opacity: 0.28;
}

.stage-item.active {
  opacity: 1;
  background: rgba(0, 212, 255, 0.07);
  border-color: rgba(0, 212, 255, 0.18);
}

.stage-item.done {
  opacity: 1;
  background: rgba(0, 255, 157, 0.05);
}

.stage-icon {
  font-size: 17px;
  flex-shrink: 0;
}

.stage-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
}

.stage-item.active .stage-text {
  color: var(--text-primary);
}

.stage-item.done .stage-text {
  color: var(--accent-green);
}

.stage-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 255, 157, 0.12);
  border: 1px solid rgba(0, 255, 157, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent-green);
  font-weight: 700;
  flex-shrink: 0;
}

.stage-item.done .stage-check {
  display: flex;
}

.stage-dots {
  display: none;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.stage-item.active .stage-dots {
  display: flex;
}

.stage-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: dotBounce 1.1s ease-in-out infinite;
}

.stage-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.stage-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

/* ── Results Section ─────────────────────────────────────────────────────────── */
.results-section {
  display: none;
}

.results-section.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.55s ease both;
  padding-bottom: 40px;
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.image-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.image-card:hover {
  border-color: var(--border-normal);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.image-card-header {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.image-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-annotated {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.dot-grayscale {
  background: #6b7fa0;
}

.dot-negative {
  background: var(--accent-purple);
  box-shadow: 0 0 8px rgba(123, 47, 255, 0.5);
}

.image-card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.image-card img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.35);
}

/* Detected classes */
.detected-classes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
}

.class-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: fadeIn 0.35s ease both;
}

.badge-abnormal_ulcer {
  background: rgba(255, 71, 87, 0.13);
  color: #ff5566;
  border: 1px solid rgba(255, 71, 87, 0.28);
}

.badge-infected {
  background: rgba(255, 140, 66, 0.13);
  color: #ff8c42;
  border: 1px solid rgba(255, 140, 66, 0.28);
}

.badge-ischaemia {
  background: rgba(255, 211, 42, 0.13);
  color: #ffd32a;
  border: 1px solid rgba(255, 211, 42, 0.28);
}

.badge-non_ischaemia {
  background: rgba(123, 47, 255, 0.13);
  color: #9d7bff;
  border: 1px solid rgba(123, 47, 255, 0.28);
}

.badge-normal_healthy {
  background: rgba(0, 255, 157, 0.11);
  color: #00ff9d;
  border: 1px solid rgba(0, 255, 157, 0.28);
}

.badge-not_infected {
  background: rgba(0, 212, 255, 0.11);
  color: #00d4ff;
  border: 1px solid rgba(0, 212, 255, 0.28);
}

.badge-default {
  background: rgba(255, 255, 255, 0.07);
  color: #8892b0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Confidence Bars */
.confidence-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

.card-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-section-title::before {
  content: '';
  width: 3px;
  height: 13px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.confidence-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conf-item {}

.conf-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.conf-class {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.conf-pct {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.conf-bar-bg {
  height: 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.conf-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* AI Doctor Report */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.report-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
}

.report-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.report-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: rgba(0, 212, 255, 0.09);
  border: 1px solid var(--border-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.report-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.report-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.report-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.report-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.report-section-title::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.report-section-title.findings {
  color: var(--accent-cyan);
}

.report-section-title.suggestions {
  color: var(--accent-purple);
}

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

.report-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  animation: fadeIn 0.4s ease both;
}

.report-item.finding {
  border-left-color: var(--accent-cyan);
}

.report-item.suggestion {
  border-left-color: var(--accent-purple);
}

.report-item-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}

.finding .report-item-dot {
  background: var(--accent-cyan);
}

.suggestion .report-item-dot {
  background: var(--accent-purple);
}

.report-item-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Similar Cases */
.similar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.similar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
  animation: fadeIn 0.4s ease both;
}

.similar-card:hover {
  border-color: var(--border-normal);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.similar-card-id {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-family: monospace;
}

.similar-card-classes {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.similar-card-finding {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Feedback */
.feedback-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

.feedback-textarea {
  width: 100%;
  min-height: 86px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font);
  resize: vertical;
  outline: none;
  transition: var(--transition);
  line-height: 1.6;
}

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

.feedback-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08);
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 11px;
}

.btn-feedback {
  padding: 10px 22px;
  background: rgba(0, 212, 255, 0.09);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.4px;
}

.btn-feedback:hover {
  background: rgba(0, 212, 255, 0.18);
  box-shadow: 0 0 22px rgba(0, 212, 255, 0.14);
}

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

.feedback-success {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 5px;
}

.no-detections {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}
/* ── Mobile Sidebar Drawer ─────────────────────────────────────────────────────── */
.btn-mobile-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-base);
  margin-right: 10px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
}
.btn-mobile-menu:hover {
  background: var(--bg);
}

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.active {
  display: block;
  opacity: 1;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-w: 230px;
  }

  .report-body {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .btn-mobile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-status {
    margin-left: auto;
  }

  /* SIDEBAR BECOMES LEFT DRAWER */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px; 
    width: 260px;
    height: 100dvh;
    z-index: 999;
    box-shadow: 5px 0 25px rgba(0,0,0,0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.drawer-open {
    left: 0;
  }

  .main-header {
    padding: 15px;
    gap: 10px;
  }
  
  .main-header-title {
    font-size: 15px;
  }
  
  .main-header-sub {
    display: none; /* Hide subtitle on mobile to save space */
  }

  .header-status, .main-header .btn-primary {
    display: none !important; /* Hide System Online & API Docs on mobile */
  }

  /* Don't break flex layout */
  .home-body, .app-layout {
    height: 100dvh;
    overflow: hidden;
  }

  .main-panel {
    height: 100dvh;
    overflow-y: auto; /* MUST BE AUTO FOR SCROLLING */
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .similar-grid {
    grid-template-columns: 1fr;
  }

  .report-body {
    grid-template-columns: 1fr;
  }
}