/* ============================================================
   MeisterDepot – Clean Editorial Light Design System
   A refined, magazine-quality investment tracking interface.
   ============================================================ */

/* ----- Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ----- CSS Variables ----- */
:root {
  /* Typography */
  --font-display: 'DM Serif Display', serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* Editorial palette – warm off-white foundation */
  --page-bg: #f8f6f3;
  --surface: #ffffff;
  --surface-hover: #f3f1ed;
  --surface-border: #e8e4de;
  --surface-border-light: #f0ede8;

  /* Text */
  --text-primary: #1a1816;
  --text-secondary: #6b6560;
  --text-muted: #9e9791;
  --text-inverse: #ffffff;

  /* Accent – deep teal (understated, premium) */
  --accent: #1a6b5c;
  --accent-hover: #145a4d;
  --accent-light: #e5f3ef;
  --accent-subtle: rgba(26, 107, 92, 0.08);

  /* Semantic colors – muted, editorial */
  --positive: #3a7d5e;
  --positive-bg: #edf6f1;
  --negative: #c4524a;
  --negative-bg: #fef0ef;
  --warning: #c4953a;
  --warning-bg: #fdf6e8;
  --info: #4a7a9c;
  --info-bg: #edf3f7;

  /* Chart colors – for Chart.js */
  --chart-colors: #1a6b5c #c4953a #4a7a9c #c4524a #8a6b8a #6b8a6b #c48a3a #5a7a8a #8a5a5a #6b7a5a;

  /* Shadows – ultra-subtle */
  --shadow-sm: 0 1px 3px rgba(26, 24, 22, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 24, 22, 0.06);
  --shadow-lg: 0 8px 24px rgba(26, 24, 22, 0.08);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 350ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ----- Base Reset & Typography ----- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--page-bg);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.4rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.3rem; }
h4 { font-size: 1.125rem; margin-bottom: 0.3rem; }

p { margin-top: 0; margin-bottom: 0.75rem; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); text-decoration: underline; }

small, .text-small { font-size: 0.8125rem; color: var(--text-muted); }

/* ----- Layout ----- */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .page-container { padding: 0 24px; }
}

@media (min-width: 1200px) {
  .page-container { padding: 0 32px; }
}

.page-header {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .page-header { padding: 32px 0 24px; margin-bottom: 28px; }
}

.page-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

@media (min-width: 768px) {
  .page-header h2 { font-size: 1.75rem; }
}

.page-header .subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.section {
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ============================================================
   Navigation
   ============================================================ */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  padding: 0;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .navbar-inner { padding: 0 24px; }
}

@media (min-width: 1200px) {
  .navbar-inner { padding: 0 32px; }
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.navbar-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.navbar-brand small {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-left: 4px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.navbar-nav .nav-item {
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
}

.navbar-nav .nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
  text-decoration: none;
}

.navbar-nav .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Dropdown in navbar */
.navbar-nav .dropdown-toggle::after {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  content: "";
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.navbar-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 220px;
  padding: 8px 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.navbar-nav .dropdown-menu.show {
  display: block;
}

.navbar-nav .dropdown-menu .dropdown-header {
  display: block;
  padding: 8px 16px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.navbar-nav .dropdown-menu .dropdown-item {
  display: block;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.navbar-nav .dropdown-menu .dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--accent);
  text-decoration: none;
}

.navbar-nav .dropdown-menu .dropdown-divider {
  height: 0;
  margin: 6px 12px;
  border-top: 1px solid var(--surface-border-light);
}

.navbar .navbar-toggler {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.25rem;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-border-light);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (min-width: 768px) {
  .card-header { padding: 16px 20px; }
}

.card-body {
  padding: 16px;
}

@media (min-width: 768px) {
  .card-body { padding: 20px; }
}

.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--surface-border-light);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .card-footer { padding: 12px 20px; }
}

/* Metric cards (dashboard stat cards) */
.metric-card {
  position: relative;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

@media (min-width: 768px) {
  .metric-card { padding: 20px; }
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.metric-card .metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-card .metric-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text-primary);
  line-height: 1;
}

.metric-card .metric-change {
  font-size: 0.8125rem;
  margin-top: 6px;
}

.metric-card .metric-change.up { color: var(--positive); }
.metric-card .metric-change.down { color: var(--negative); }

/* ============================================================
   Tables
   ============================================================ */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--page-bg);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
}

@media (min-width: 768px) {
  thead th { padding: 12px 16px; }
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

@media (min-width: 768px) {
  tbody td { padding: 14px 16px; }
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-hover);
}

tfoot td {
  padding: 12px 16px;
  font-weight: 600;
  border-top: 1px solid var(--surface-border);
  background: var(--page-bg);
}

.text-end { text-align: right; }
.text-center { text-align: center; }

/* Badge-style table cells */
.badge-pct {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pct.positive { background: var(--positive-bg); color: var(--positive); }
.badge-pct.negative { background: var(--negative-bg); color: var(--negative); }
.badge-pct.neutral { background: var(--accent-light); color: var(--accent); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .btn { padding: 8px 18px; font-size: 0.8125rem; }
}

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

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--surface-border);
}
.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-sm { padding: 5px 12px; font-size: 0.75rem; }
.btn-lg { padding: 12px 24px; font-size: 0.9375rem; }

.btn-danger {
  background: var(--negative);
  color: var(--text-inverse);
  border-color: var(--negative);
}
.btn-danger:hover {
  background: #b04840;
  color: var(--text-inverse);
  text-decoration: none;
}

.btn-dark {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}
.btn-dark:hover {
  background: #000;
  color: var(--text-inverse);
  text-decoration: none;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control, .form-select, input[type="text"], input[type="email"],
input[type="password"], input[type="number"], textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus,
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.input-group {
  display: flex;
  align-items: center;
}

.input-group .form-control {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .input-group-text {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--page-bg);
  border: 1px solid var(--surface-border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-check-label {
  font-size: 0.875rem;
  cursor: pointer;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-danger { background: var(--negative-bg); color: var(--negative); border-color: var(--negative-bg); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bg); }
.alert-success { background: var(--positive-bg); color: var(--positive); border-color: var(--positive-bg); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-bg); }

/* ============================================================
   Stats bars / summary row
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
  }
}

.stat-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  display: block;
}

.stat-card .stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.stat-card.stat-primary { border-left: 3px solid var(--accent); }
.stat-card.stat-info { border-left: 3px solid var(--info); }
.stat-card.stat-positive { border-left: 3px solid var(--positive); }
.stat-card.stat-warning { border-left: 3px solid var(--warning); }

/* ============================================================
   Color swatches (category picker)
   ============================================================ */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-option {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: var(--accent); }

/* ============================================================
   Dropdowns (general, non-navbar)
   ============================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 4px;
  content: "▾";
  font-size: 0.7em;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  display: none;
  min-width: 180px;
  padding: 6px 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.dropdown-menu.show { display: block; }

.dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--accent);
  text-decoration: none;
}

.dropdown-item.text-danger { color: var(--negative); }
.dropdown-item.text-danger:hover { color: #b04840; }
.dropdown-item.disabled { opacity: 0.4; pointer-events: none; }

.dropdown-divider {
  height: 0;
  margin: 4px 10px;
  border-top: 1px solid var(--surface-border-light);
}

/* ============================================================
   Badges & Labels
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-info { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--positive-bg); color: var(--positive); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--negative-bg); color: var(--negative); }
.badge-secondary { background: var(--surface-border); color: var(--text-secondary); }

/* ============================================================
   Layout Helpers
   ============================================================ */
.d-flex { display: flex; }
.d-flex-wrap { flex-wrap: wrap; }
.d-inline { display: inline; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.ms-auto { margin-left: auto; }
.p-0 { padding: 0; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.py-5 { padding-top: 40px; padding-bottom: 40px; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--positive); }
.text-danger { color: var(--negative); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--accent); }
.small { font-size: 0.8125rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded-circle { border-radius: 50%; }
.border-0 { border: none; }

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

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
}

/* ============================================================
   Responsive Nav
   ============================================================ */
@media (max-width: 767px) {
  .navbar .navbar-toggler {
    display: block;
  }
  .navbar-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--surface-border);
    border-top: 1px solid var(--surface-border);
    padding: 0;
    height: auto;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  .navbar-nav.show {
    display: flex;
  }
  .navbar-nav .nav-item {
    height: auto;
    width: 100%;
  }
  .navbar-nav .nav-link {
    height: auto;
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-border-light);
    font-size: 1rem;
  }
  .navbar-nav .nav-link.active {
    border-bottom: 1px solid var(--accent);
  }
  .navbar-nav .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    width: 100%;
    padding: 0;
  }
  .navbar-nav .dropdown-menu .dropdown-header {
    padding: 10px 16px 4px;
    font-size: 0.6875rem;
  }
  .navbar-nav .dropdown-menu .dropdown-item {
    padding: 10px 16px 10px 28px;
    border-bottom: 1px solid var(--surface-border-light);
  }
  .navbar-nav .dropdown-menu .dropdown-divider {
    margin: 0 12px;
  }
  .navbar li.ms-auto {
    margin-left: 0 !important;
  }
  .navbar li.ms-auto form {
    width: 100%;
  }
  .navbar li.ms-auto form button {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 0;
  }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn var(--transition-slow) both;
}

.fade-in-delay-1 { animation-delay: 50ms; }
.fade-in-delay-2 { animation-delay: 100ms; }
.fade-in-delay-3 { animation-delay: 150ms; }
.fade-in-delay-4 { animation-delay: 200ms; }

/* ============================================================
   AI Report Styling
   ============================================================ */
.ai-report {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.ai-report h1, .ai-report h2, .ai-report h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.ai-report p {
  margin-bottom: 0.5rem;
}

.ai-report strong {
  color: var(--accent);
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ============================================================
   Page Load Animation Override (prevents flash)
   ============================================================ */
body:not(.loaded) .fade-in {
  opacity: 0;
  animation: none;
}

.fade-in {
  animation: fadeIn 350ms cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

/* Mobile-touch: ensure no horizontal overflow on any page */
body {
  overflow-x: hidden;
  width: 100%;
}

img, canvas, video, svg, iframe, table, pre, code {
  max-width: 100%;
}

canvas {
  height: auto !important;
}

/* Better touch targets on mobile */
@media (max-width: 767px) {
  .btn, .nav-link, .dropdown-item {
    min-height: 44px;
  }
  .form-control, .form-select {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .navbar { display: none; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .page-header { border-bottom: 2px solid #333; }
}
