@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* Logo theme variants */
.logo-light { display: none !important; }
.logo-dark { display: inline !important; }
[data-theme="light"] .logo-light { display: inline !important; }
[data-theme="light"] .logo-dark { display: none !important; }

/* ======== DARK THEME (default) — Deep Forest ======== */
:root {
  --bg-primary: #060e0b;
  --bg-secondary: #0a1a14;
  --bg-card: #0f221a;
  --bg-card-hover: #142e23;
  --bg-input: #0b1c14;
  --bg-elevated: #163028;
  --border: #1e3d2f;
  --border-subtle: #163028;
  --border-focus: #2dd4a0;
  --text-primary: #ecf5f0;
  --text-secondary: #8fa89b;
  --text-muted: #5e7d6c;
  --accent: #2dd4a0;
  --accent-hover: #20b888;
  --accent-dim: #1a9c72;
  --accent-glow: rgba(45, 212, 160, 0.10);
  --accent-glow-strong: rgba(45, 212, 160, 0.18);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --gradient-accent: linear-gradient(135deg, #2dd4a0 0%, #0ea572 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(45,212,160,0.12) 0%, rgba(14,165,114,0.06) 100%);
  --gradient-hero: linear-gradient(160deg, #2dd4a0 0%, #0b6e4f 50%, #064e36 100%);
  --shadow: 0 4px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.25);
  --shadow-accent: 0 4px 24px rgba(45,212,160,0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-w: 260px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);
  --overlay-bg: rgba(4,10,7,0.75);
  color-scheme: dark;
}

/* ======== LIGHT THEME — Sage White ======== */
[data-theme="light"] {
  --bg-primary: #f5f8f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f5f2;
  --bg-input: #f0f5f2;
  --bg-elevated: #e8f0eb;
  --border: #d4e0d8;
  --border-subtle: #e0ebe3;
  --border-focus: #0ea572;
  --text-primary: #0a1f14;
  --text-secondary: #4a6356;
  --text-muted: #7d998b;
  --accent: #0ea572;
  --accent-hover: #0b8a5e;
  --accent-dim: #0b7a54;
  --accent-glow: rgba(14, 165, 114, 0.08);
  --accent-glow-strong: rgba(14, 165, 114, 0.14);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --gradient-accent: linear-gradient(135deg, #0ea572 0%, #059669 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(14,165,114,0.08) 0%, rgba(5,150,105,0.04) 100%);
  --gradient-hero: linear-gradient(160deg, #0ea572 0%, #059669 100%);
  --shadow: 0 4px 32px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-accent: 0 4px 24px rgba(14,165,114,0.08);
  --overlay-bg: rgba(10,31,20,0.45);
  color-scheme: light;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', -apple-system, sans-serif;
  letter-spacing: -0.025em;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
button { cursor: pointer; font-family: inherit; }
::selection { background: var(--accent-glow-strong); color: var(--text-primary); }

/* ======== AUTH PAGE ======== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.auth-container::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, rgba(45,212,160,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.auth-container::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  bottom: -200px; left: -100px;
  background: radial-gradient(circle, rgba(14,165,114,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
  animation: authFadeIn 0.5s ease-out;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo { text-align: center; margin-bottom: 36px; }
.auth-logo h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 26px; font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.auth-logo-img {
  width: 120px; height: 120px;
  max-width: 120px; max-height: 120px;
  margin: 0 auto 8px;
  display: block;
  object-fit: contain;
}
.auth-logo p { color: var(--text-muted); font-size: 13px; margin-top: 6px; letter-spacing: 0.02em; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-group input, .form-group select {
  width: 100%; padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ======== BUTTONS ======== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; transition: var(--transition);
  white-space: nowrap; letter-spacing: 0.01em;
  position: relative; overflow: hidden;
}
.btn-primary {
  background: var(--gradient-accent); color: #fff; width: 100%;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  opacity: 0.92; transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(45,212,160,0.2);
}
.btn-secondary {
  background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); border-color: var(--text-muted); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-icon {
  padding: 8px; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); font-size: 16px;
}
.btn-icon:hover { color: var(--text-primary); border-color: var(--text-muted); }

.auth-switch { text-align: center; margin-top: 28px; color: var(--text-muted); font-size: 13px; }
.auth-switch a { font-weight: 600; color: var(--accent); }

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px; display: none;
}
.alert-error {
  background: rgba(248,113,113,0.08); color: #fca5a5;
  border: 1px solid rgba(248,113,113,0.15);
}
.alert-success {
  background: rgba(52,211,153,0.08); color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.15);
}
[data-theme="light"] .alert-error { color: #dc2626; background: rgba(220,38,38,0.06); border-color: rgba(220,38,38,0.12); }
[data-theme="light"] .alert-success { color: #059669; background: rgba(5,150,105,0.06); border-color: rgba(5,150,105,0.12); }

/* ======== LAYOUT ======== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: var(--transition);
}
.sidebar-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 20px; font-weight: 700;
  padding: 0 10px 24px;
  color: var(--accent);
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img {
  width: 30px; height: 30px;
  max-width: 30px; max-height: 30px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.mobile-header img {
  width: 22px; height: 22px;
  max-width: 22px; max-height: 22px;
  border-radius: 5px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  transition: var(--transition); cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  letter-spacing: 0.005em;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px; margin-top: 16px;
}
.user-info { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-email {
  font-size: 11px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: var(--transition);
}
.theme-toggle:hover { background: var(--bg-card); color: var(--text-primary); }
.theme-toggle .icon { font-size: 17px; width: 22px; text-align: center; }

/* ======== MAIN CONTENT ======== */
.main-content {
  margin-left: var(--sidebar-w); flex: 1; padding: 32px;
  min-height: 100vh;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.03em;
}

/* ======== CARDS & STATS ======== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}
.stat-card:hover::after { background: var(--gradient-accent); }
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 30px; font-weight: 700; margin-bottom: 4px;
  letter-spacing: -0.03em;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }

/* Drive storage bar */
.drive-bar-container { margin-top: 10px; }
.drive-bar {
  width: 100%; height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.drive-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--success);
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1), background 0.4s ease;
  min-width: 0%;
}
.drive-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 0.02em;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.02em;
}

/* ======== TABLE ======== */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
th {
  color: var(--text-muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
}
td { white-space: nowrap; }
td:nth-child(5), td:nth-child(6) { white-space: normal; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
tr { transition: var(--transition); }
tr:hover td { background: var(--bg-card-hover); }

.badge {
  display: inline-flex; padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.badge-success { background: rgba(52,211,153,0.12); color: var(--success); }
.badge-warning { background: rgba(251,191,36,0.12); color: var(--warning); }
.badge-danger { background: rgba(248,113,113,0.12); color: var(--danger); }
.badge-info { background: var(--accent-glow); color: var(--accent); }

/* ======== SEARCH ======== */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-bar input {
  flex: 1; padding: 11px 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 13px; outline: none;
  transition: var(--transition);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ======== CONFIG ======== */
.config-section {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; border-bottom: 1px solid var(--border-subtle);
  gap: 16px; flex-wrap: wrap;
}
.config-section:last-child { border-bottom: none; }
.config-info { flex: 1; min-width: 0; }
.config-info h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 600; margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.config-info p { font-size: 13px; color: var(--text-secondary); word-break: break-word; }

/* ======== MODAL ======== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px; width: 100%; max-width: 500px;
  max-height: 85vh; overflow-y: auto;
  transform: scale(0.96) translateY(8px);
  transition: var(--transition-slow); box-shadow: var(--shadow);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; margin-bottom: 24px;
  letter-spacing: -0.02em;
}

/* ======== MOBILE NAV & HEADER ======== */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 6px 0; z-index: 100;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mobile-nav-items { display: flex; justify-content: space-around; }
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px; color: var(--text-muted); font-size: 10px;
  background: none; border: none; cursor: pointer; transition: var(--transition);
  font-weight: 500;
}
.mobile-nav-item .icon { font-size: 20px; }
.mobile-nav-item.active { color: var(--accent); }

.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px; z-index: 100;
  align-items: center; justify-content: space-between;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mobile-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}

/* Spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 44px; margin-bottom: 16px; opacity: 0.7; }
.empty-state h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px; color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ======== PATIENT DETAIL ======== */
.patient-header {
  display: flex; align-items: center; gap: 18px;
  padding: 24px; background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.patient-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-accent);
}
.patient-avatar {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--gradient-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
}
.patient-info h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 19px; margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.patient-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.patient-meta span {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; margin-bottom: 16px; color: var(--text-muted);
}
.breadcrumb a { color: var(--accent); font-weight: 500; }

/* ======== FOLDER BROWSER ======== */
.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.folder-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 14px;
  position: relative;
}
.folder-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}
.folder-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.folder-icon.preop { background: rgba(45,212,160,0.12); }
.folder-icon.surgery { background: rgba(248,113,113,0.12); }
.folder-icon.postop { background: rgba(52,211,153,0.12); }
.folder-icon.other { background: rgba(251,191,36,0.12); }
.folder-details h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
}
.folder-details p { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.add-folder-card {
  background: transparent; border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--text-muted); font-size: 13px; min-height: 84px;
}
.add-folder-card:hover { border-color: var(--accent); color: var(--accent); }

/* ======== PHOTO GALLERY ======== */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.photo-thumb {
  aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition); position: relative;
}
.photo-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.photo-thumb:hover img { transform: scale(1.06); }
.photo-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  padding: 28px 10px 8px; font-size: 10px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

/* ======== PHOTO DELETE BUTTON ======== */
.photo-thumb-click {
  width: 100%; height: 100%; cursor: pointer;
}
.photo-thumb-click img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease;
}
.photo-thumb:hover .photo-thumb-click img { transform: scale(1.06); }

.photo-delete-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(220, 38, 38, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
  opacity: 0; transform: scale(0.8);
  transition: all 0.25s ease;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.photo-thumb:hover .photo-delete-btn {
  opacity: 1; transform: scale(1);
}
.photo-delete-btn:hover {
  background: rgba(220, 38, 38, 0.95);
  transform: scale(1.12) !important;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}
.photo-delete-btn:active {
  transform: scale(0.95) !important;
}

/* ======== DELETE TOAST ======== */
.delete-toast {
  position: fixed;
  bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  z-index: 3000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
  text-align: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.delete-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ======== LIGHTBOX ======== */
.lightbox {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.94); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius-sm); object-fit: contain; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: white; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.15); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: white; font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.12); }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }
.lightbox-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.45); font-size: 13px; font-weight: 500;
  letter-spacing: 0.05em;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ======== SETUP WIZARD ======== */
.wizard-container {
  max-width: 560px;
  margin: 48px auto;
  padding: 0 16px;
}
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 44px;
  padding: 0 20px;
}
.wizard-step-indicator {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.4s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  font-family: 'Outfit', sans-serif;
}
.wizard-step-indicator.active {
  border-color: var(--accent);
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(45,212,160,0.25);
  animation: wizardPulse 2.5s ease-in-out infinite;
}
.wizard-step-indicator.done {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.wizard-connector {
  flex: 1; height: 2px;
  background: var(--border);
  transition: background 0.5s ease;
  max-width: 80px;
}
.wizard-connector.done { background: var(--success); }
@keyframes wizardPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(45,212,160,0.25); }
  50% { box-shadow: 0 0 32px rgba(45,212,160,0.4); }
}

.wizard-step {
  display: none;
  animation: wizardFadeIn 0.4s ease;
}
.wizard-step.active { display: block; }
@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  text-align: center;
  box-shadow: var(--shadow);
}
.wizard-card .wizard-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: block;
}
.wizard-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px; font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}
.wizard-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
  margin-bottom: 8px;
}
.wizard-card .btn {
  margin-top: 24px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}
.wizard-card .btn-lg {
  padding: 14px 32px;
  font-size: 15px;
}

.wizard-instructions {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
  text-align: left;
}
.wizard-instructions .instruction-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
}
.wizard-instructions .instruction-step:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}
.wizard-instructions .step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
}
.wizard-instructions .step-text {
  font-size: 13px;
  color: var(--text-secondary);
  padding-top: 3px;
}
.wizard-instructions .step-text strong { color: var(--text-primary); }

.wizard-code {
  font-family: 'Outfit', monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--accent);
  background: var(--bg-input);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 14px 24px;
  display: inline-block;
  margin: 16px 0;
  user-select: all;
}

.wizard-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.wizard-status .spinner { width: 16px; height: 16px; }

.wizard-skip {
  display: block;
  margin: 20px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
  transition: var(--transition);
}
.wizard-skip:hover { color: var(--text-secondary); }

.wizard-summary { text-align: left; margin-top: 24px; }
.wizard-summary-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}
.wizard-summary-item:last-child { border-bottom: none; }
.wizard-summary-item .summary-icon { font-size: 20px; width: 32px; text-align: center; flex-shrink: 0; }
.wizard-summary-item .summary-status { margin-left: auto; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.wizard-summary-item .summary-status.success { color: var(--success); }
.wizard-summary-item .summary-status.skipped { color: var(--text-muted); }

/* ======== VIDEO OVERLAY ======== */
.photo-thumb.is-video::after {
  content: '▶';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.lightbox video {
  max-width: 90vw; max-height: 85vh;
  border-radius: var(--radius-sm);
  outline: none;
}

/* ======== PHOTO COMPARISON ======== */
.compare-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 1500; display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.compare-overlay.active { opacity: 1; visibility: visible; }
.compare-container {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 1100px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.compare-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.compare-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px; font-weight: 700;
  letter-spacing: -0.02em;
}
.compare-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.compare-close:hover { color: var(--text-primary); border-color: var(--text-muted); }

.compare-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  min-height: 400px;
}
.compare-panel {
  padding: 20px;
  border-right: 1px solid var(--border);
}
.compare-panel:last-child { border-right: none; }
.compare-panel-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.compare-panel-header .panel-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
}
.compare-panel-header select {
  flex: 1; padding: 8px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 12px; outline: none;
}
.compare-main-image {
  width: 100%; aspect-ratio: 4/3;
  background: var(--bg-input); border-radius: var(--radius);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; border: 1px solid var(--border);
}
.compare-main-image img, .compare-main-image video {
  width: 100%; height: 100%; object-fit: contain;
}
.compare-placeholder {
  color: var(--text-muted); font-size: 13px; text-align: center;
  padding: 40px 20px;
}
.compare-placeholder .icon { font-size: 36px; margin-bottom: 12px; opacity: 0.6; }

.compare-thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px;
}
.compare-thumb {
  aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  cursor: pointer; border: 2px solid transparent;
  transition: var(--transition);
}
.compare-thumb:hover { border-color: var(--accent); }
.compare-thumb.selected { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.compare-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ======== FULLSCREEN COMPARISON ======== */
.fs-compare {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #000; z-index: 2000;
  display: none; flex-direction: column;
}
.fs-compare.active { display: flex; }
.fs-compare-close {
  position: absolute; top: 16px; right: 20px; z-index: 10;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: white; padding: 8px 20px; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s;
}
.fs-compare-close:hover { background: rgba(255,255,255,0.15); }
.fs-compare-body {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px; padding: 3px;
  min-height: 0; overflow: hidden;
}
.fs-compare-panel {
  position: relative; display: flex;
  align-items: center; justify-content: center;
  overflow: hidden; background: #050a07;
  border-radius: 4px;
  padding: 48px 8px;
  min-height: 0;
}
.fs-compare-panel img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  position: relative; z-index: 1;
}
.fs-watermark-top {
  position: absolute; top: 16px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 20px; font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 6px 20px; border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
  z-index: 10; pointer-events: none;
  white-space: nowrap;
}
.fs-watermark-bottom {
  position: absolute; bottom: 16px; right: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px; font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 5px 16px; border-radius: 6px;
  backdrop-filter: blur(4px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  z-index: 10; pointer-events: none;
  font-style: italic;
  white-space: nowrap;
}

/* ======== RESPONSIVE — TABLET (768-1024px) ======== */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; padding: 24px 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .patient-header { flex-wrap: wrap; }
  .patient-header > div:last-child { margin-left: 0; width: 100%; }
}

/* ======== RESPONSIVE — MOBILE (<=768px) ======== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 68px 16px 80px; }
  .mobile-nav { display: block; }
  .mobile-header { display: flex; }
  .page-header h2 { font-size: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 24px; }
  .auth-card { padding: 28px; }
  .search-bar { flex-direction: column; }
  .config-section { flex-direction: column; align-items: flex-start; }
  .config-section .btn { width: 100%; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .folder-grid { grid-template-columns: 1fr; }
  .patient-header { flex-direction: column; align-items: flex-start; }
  .patient-header > div:last-child { margin-left: 0; }
  .modal { padding: 24px; margin: 12px; }
  .card { padding: 18px; }
  th, td { padding: 8px 10px; font-size: 12px; }
  .compare-body { grid-template-columns: 1fr; }
  .compare-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .compare-panel:last-child { border-bottom: none; }
  .compare-container { max-height: 95vh; }
  .fs-compare-body { grid-template-columns: 1fr; }
  .fs-watermark-top { font-size: 16px; }
  .fs-watermark-bottom { font-size: 13px; }
}

/* ======== RESPONSIVE — SMALL MOBILE (<=480px) ======== */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header .btn { width: 100%; }
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .folder-grid { grid-template-columns: 1fr; }
  .breadcrumb { font-size: 12px; }
  .photo-delete-btn {
    opacity: 0.7; transform: scale(0.85);
    width: 28px; height: 28px; font-size: 12px;
  }
  .delete-toast { bottom: 80px; font-size: 12px; padding: 12px 18px; }
}

/* ======== IMPORT TUTORIAL ======== */
.tutorial-container {
  margin-bottom: 28px;
}

/* Tutorial Animations */
@keyframes tutorialSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tutorialSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}
@keyframes tutorialStepHighlight {
  0% { box-shadow: 0 0 0 0 var(--accent-glow-strong); }
  50% { box-shadow: 0 0 0 6px var(--accent-glow); }
  100% { box-shadow: var(--shadow-sm); }
}
@keyframes tutorialFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tutorial Hero */
.tutorial-hero {
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.tutorial-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-accent);
}
.tutorial-hero::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  top: -120px; right: -60px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.tutorial-hero-content { flex: 1; position: relative; z-index: 1; }
.tutorial-hero-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.tutorial-hero-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.tutorial-hero-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  max-width: 480px;
}
.tutorial-hero-icon {
  font-size: 64px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

/* Tutorial Progress Bar */
.tutorial-progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 20px;
  margin-bottom: 32px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary);
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.tutorial-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px 8px;
}
.tutorial-progress-step:hover { transform: translateY(-2px); }
.tps-number {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  font-family: 'Outfit', sans-serif;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.35s ease;
}
.tutorial-progress-step.active .tps-number {
  border-color: var(--accent);
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
}
.tutorial-progress-step.done .tps-number {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.tps-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tutorial-progress-step.active .tps-label { color: var(--accent); }
.tutorial-progress-step.done .tps-label { color: var(--success); }
.tutorial-progress-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 60px;
  margin: 0 4px;
  margin-bottom: 20px;
}

/* Tutorial Steps */
.tutorial-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  transition: var(--transition);
  animation: tutorialFadeInUp 0.5s ease;
}
.tutorial-step:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
.tutorial-step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--gradient-subtle);
}
.tutorial-step-number {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--gradient-accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  font-family: 'Outfit', sans-serif;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}
.tutorial-step-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.tutorial-step-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tutorial-step-body {
  padding: 24px 28px;
}

/* Tutorial Checklist */
.tutorial-checklist {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.tutorial-check-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.tutorial-check-item:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.tutorial-check-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.tutorial-check-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}
.tutorial-check-item p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Tutorial Tips & Warnings */
.tutorial-tip, .tutorial-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-top: 16px;
}
.tutorial-tip {
  background: var(--accent-glow);
  border: 1px solid rgba(45,212,160,0.15);
}
.tutorial-warning {
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.15);
}
.tutorial-tip-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Tutorial Substeps */
.tutorial-substeps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 20px;
}
.tutorial-substep {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.tutorial-substep:last-child { border-bottom: none; }
.tutorial-substep-num {
  width: 32px; height: 24px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
}
.tutorial-substep strong {
  color: var(--text-primary);
}

/* Tutorial Table Example */
.tutorial-table-example {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.tutorial-table-example table {
  width: 100%;
  border-collapse: collapse;
}
.tutorial-table-example th {
  background: var(--bg-elevated);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--accent);
}
.tutorial-table-example td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.tutorial-table-example tr:last-child td {
  border-bottom: none;
}
.tutorial-table-example tr:hover td {
  background: var(--accent-glow);
}

/* Tutorial Folder Tree */
.tutorial-folder-tree {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  font-size: 14px;
}
.tutorial-folder-item {
  padding: 6px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.tutorial-folder-item.root {
  font-size: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}
.tutorial-folder-item.l1 {
  padding-left: 28px;
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.tutorial-folder-item.l1::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.tutorial-folder-item.l2 {
  padding-left: 28px;
  font-size: 13px;
  color: var(--text-secondary);
}
.tutorial-folder-item.muted {
  opacity: 0.5;
}
.tutorial-folder-children {
  padding-left: 8px;
  margin-top: 2px;
}
.folder-emoji {
  font-size: 16px;
}
.folder-tag {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-left: 8px;
}
.folder-tag-sm {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* Tutorial Images */
.tutorial-image-container {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-input);
}
.tutorial-image-container img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  background: var(--bg-input);
}
.tutorial-image-caption {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

/* Tutorial FAQ */
.tutorial-faq {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 24px;
}
.tutorial-faq h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.tutorial-faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}
.tutorial-faq-item:last-child { margin-bottom: 0; }
.tutorial-faq-item:hover {
  border-color: var(--accent);
}
.tutorial-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  gap: 12px;
}
.tutorial-faq-arrow {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.tutorial-faq-item.open .tutorial-faq-arrow {
  transform: rotate(90deg);
  color: var(--accent);
}
.tutorial-faq-a {
  max-height: 0;
  overflow: hidden;
  padding: 0 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  transition: all 0.35s ease;
}
.tutorial-faq-item.open .tutorial-faq-a {
  max-height: 600px;
  padding: 0 18px 16px;
}

/* ======== TUTORIAL RESPONSIVE ======== */
@media (max-width: 768px) {
  .tutorial-hero {
    flex-direction: column;
    padding: 28px 20px 24px;
    text-align: center;
  }
  .tutorial-hero-content p { max-width: none; }
  .tutorial-hero-icon { font-size: 48px; }
  .tutorial-progress-bar {
    padding: 8px 8px;
    gap: 0;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .tps-label { font-size: 8px; }
  .tps-number { width: 30px; height: 30px; font-size: 12px; }
  .tutorial-progress-connector { max-width: 24px; min-width: 12px; }
  .tutorial-step-header { padding: 18px 16px; gap: 12px; }
  .tutorial-step-number { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
  .tutorial-step-header h3 { font-size: 15px; }
  .tutorial-step-body { padding: 18px 16px; }
  .tutorial-faq { padding: 20px 16px; }
  .tutorial-folder-tree { padding: 14px 16px; font-size: 13px; }
  .tutorial-table-example { font-size: 12px; }
  .tutorial-table-example th, .tutorial-table-example td { padding: 8px 10px; }
  .tutorial-image-container img { max-height: 240px; }
}

/* ===== Importación: selector de origen + numeritos de paso ===== */
.step-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; color: #fff; }
.import-src { opacity: .6; }
.import-src.active { opacity: 1; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

