/* FitTrack 365 – Premium SaaS UI */

:root {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-soft: #eef1f6;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --warning: #d97706;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --glass: rgba(255, 255, 255, 0.72);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.2);
  --transition: 180ms ease;
}

[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-elevated: #141821;
  --bg-soft: #1a1f2b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #243044;
  --border-strong: #334155;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --glass: rgba(20, 24, 33, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(5, 150, 105, 0.06), transparent 50%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 0.5rem; font-weight: 650; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; color: var(--text-secondary); }

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform var(--transition);
}

.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
}

.sidebar-overlay.show { display: block; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1rem; }
.brand-text span { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-link i { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.theme-toggle:hover { background: var(--bg-soft); color: var(--text); }
[data-theme="light"] .icon-light { display: none; }
[data-theme="dark"] .icon-dark { display: none; }

.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.page-heading {
  font-size: 1.1rem;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.content {
  padding: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.card-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.card-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.progress-hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 45%, #0ea5e9 100%);
  color: #fff;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.28);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.progress-hero::after {
  content: '';
  position: absolute;
  inset: auto -20% -60% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.progress-hero h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
  position: relative;
}

.progress-hero p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  position: relative;
}

.progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  position: relative;
}

.progress-bar-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: #fff;
  border-radius: 999px;
  width: 0;
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Forms */
.form-card { max-width: 720px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

textarea.form-control { min-height: 110px; resize: vertical; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn i { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 0.85rem; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn i { width: 20px; height: 20px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Auth / Wizard */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(800px 400px at 20% 0%, rgba(37, 99, 235, 0.15), transparent),
    radial-gradient(700px 400px at 90% 100%, rgba(14, 165, 233, 0.12), transparent),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.auth-card.wide { max-width: 560px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.wizard-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.wizard-step {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}

.wizard-step.active { background: var(--primary); }
.wizard-step.done { background: var(--success); }

.wizard-step-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-soft);
  font-weight: 650;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: var(--primary-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.delta-pos { color: var(--danger); }
.delta-neg { color: var(--success); }
.delta-zero { color: var(--text-muted); }

/* Calendar */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-dow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 6px 0;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-soft);
  color: var(--text-muted);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.cal-day:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--text); }
.cal-day.empty { background: transparent; cursor: default; pointer-events: none; }
.cal-day.has-entry {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.25);
}
.cal-day.today { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal-day .cal-weight { font-size: 0.65rem; font-weight: 500; opacity: 0.85; }

/* Chart */
.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.chip.active, .chip:hover {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
}

.chart-box {
  position: relative;
  width: 100%;
  height: 280px;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.gallery-item:hover img { transform: scale(1.04); }

.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Milestones */
.milestone-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.milestone-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: transform var(--transition), box-shadow var(--transition);
}

.milestone-card.achieved {
  background: var(--success-soft);
  border-color: rgba(5, 150, 105, 0.3);
}

.milestone-card.unlock-anim {
  animation: milestoneUnlock 700ms ease;
}

@keyframes milestoneUnlock {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(5, 150, 105, 0); }
  100% { transform: scale(1); }
}

.milestone-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  color: var(--text-muted);
  flex-shrink: 0;
}

.milestone-card.achieved .milestone-icon {
  background: var(--success);
  color: #fff;
}

.milestone-weight { font-size: 1.25rem; font-weight: 700; }
.milestone-status { font-size: 0.85rem; color: var(--text-secondary); }

/* Backup list */
.backup-list { display: flex; flex-direction: column; gap: 10px; }
.backup-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.section-title {
  font-size: 1.05rem;
  margin: 8px 0 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.search-input { flex: 1; min-width: 180px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--text-muted);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: toastIn 250ms ease;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }

.toast-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  display: none;
  place-items: center;
  z-index: 500;
}
.loading-overlay.show { display: grid; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.mood-scale {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mood-scale label {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  position: relative;
}

.mood-scale input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.mood-scale label:has(input:checked) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Modern photo upload */
.upload-zone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--bg-elevated), var(--bg-soft));
  min-height: 180px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.upload-zone:hover,
.upload-zone:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--ring);
  outline: none;
}

.upload-zone.dragover {
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary-soft);
  transform: scale(1.01);
}

.upload-zone.has-image {
  border-style: solid;
  border-color: var(--border);
  cursor: default;
  min-height: 240px;
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  text-align: center;
  min-height: 180px;
}

.upload-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 4px;
}

.upload-icon i { width: 24px; height: 24px; }

.upload-title {
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.upload-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.4;
}

.upload-preview-wrap {
  position: relative;
  width: 100%;
  min-height: 240px;
  background: #0b0d12;
}

.upload-preview {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.upload-preview-actions {
  position: absolute;
  inset: auto 12px 12px auto;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.upload-action-btn {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  color: #0f172a;
}

[data-theme="dark"] .upload-action-btn {
  background: rgba(20, 24, 33, 0.9);
  color: #f1f5f9;
}

.upload-action-btn.btn-danger {
  background: rgba(220, 38, 38, 0.95);
  color: #fff;
}

.upload-view {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 420px;
  background: var(--bg-soft);
}

.upload-view img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 280ms ease;
}

.upload-view:hover img { transform: scale(1.03); }

.upload-view-hint {
  position: absolute;
  inset: auto 12px 12px auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.upload-view-hint i { width: 14px; height: 14px; }

@media (min-width: 900px) {
  .upload-preview { height: 320px; }
  .upload-view img { height: 300px; }
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: 0; }
.detail-label { color: var(--text-secondary); font-size: 0.9rem; }
.detail-value { font-weight: 600; text-align: right; }

.stack-gap { display: flex; flex-direction: column; gap: 16px; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

/* Desktop */
@media (min-width: 900px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    transform: none;
  }

  .sidebar-overlay { display: none !important; }
  .menu-btn { display: none; }
  .user-chip { display: block; }

  .content { padding: 24px 28px 40px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid.dense { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid.two { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .milestone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-box { height: 380px; }
  .cal-day .cal-weight { font-size: 0.7rem; }
}

@media (min-width: 1100px) {
  .stats-grid.dense { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .app-shell.no-nav .main-wrap { width: 100%; }
}
