:root {
  --ink: #172033;
  --muted: #718096;
  --line: #e8edf5;
  --canvas: #f5f7fb;
  --primary: #2563eb;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; padding: 24px 18px; background: #fff; border-right: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 20px; font-weight: 750; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2563eb, #06b6d4); box-shadow: 0 8px 22px #2563eb33; }
.sidebar nav { display: grid; gap: 6px; margin-top: 38px; }
.nav-link { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-radius: 10px; color: #536078; font-weight: 550; }
.nav-link:hover { color: var(--primary); background: #eff6ff; }
.nav-link.active { color: var(--primary); background: #eaf2ff; }
.nav-link i { font-size: 18px; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); }
.sidebar-foot a { color: #64748b; text-decoration: none; font-size: 14px; }
.main-column { flex: 1; min-width: 0; margin-left: 248px; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 35px; }
.mobile-header { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 4px; font-size: 30px; font-weight: 750; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 2px 7px rgba(30, 41, 59, .035); }
.stat-card { min-height: 112px; display: flex; flex-direction: row; gap: 15px; align-items: center; padding: 20px; }
.stat-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.stat-card p { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.stat-card strong { font-size: 21px; letter-spacing: -.02em; }
.panel { overflow: hidden; }
.panel .card-header { min-height: 62px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.panel h2, .project-card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.panel .card-header a { font-size: 14px; text-decoration: none; }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: 14px 18px; border-color: var(--line); }
.table thead th { color: #718096; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; background: #fafbfc; white-space: nowrap; }
.empty { padding: 42px !important; text-align: center; color: var(--muted) !important; }
.filter-bar { display: flex; flex-direction: row; gap: 13px; padding: 16px; }
.filter-bar label { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.filter-grow { flex: 1; min-width: 180px; }
.report-filter { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 12px; padding: 16px; }
.report-filter label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.report-filter-actions { display: flex; align-items: end; gap: 7px; }
.report-participants { font-size: 13px; }
.report-participants > :not(caption) > * > * { padding: 12px 10px; }
.report-participants td:not(:first-child),
.report-details td:first-child { white-space: nowrap; }
.status-form { min-width: 145px; }
.evidence-gallery,
.photo-gallery { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 130px; }
.evidence-link,
.js-photo-preview { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: var(--primary); background: #eff6ff; border: 1px solid #dbeafe; border-radius: 7px; font-size: 12px; font-weight: 600; line-height: 1.35; text-decoration: none; white-space: nowrap; }
.evidence-link:hover,
.js-photo-preview:hover { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.evidence-link:focus-visible,
.js-photo-preview:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }
.js-photo-preview { cursor: pointer; }
#photoModal .modal-dialog { width: min(920px, calc(100% - 24px)); max-width: 920px; margin-right: auto; margin-left: auto; }
#photoModal .modal-content { overflow: hidden; border: 0; border-radius: 16px; box-shadow: 0 22px 70px rgba(15, 23, 42, .22); }
#photoModal .modal-header,
#photoModal .modal-footer { padding: 14px 18px; border-color: var(--line); }
#photoModal .modal-body { padding: 18px; background: #f8fafc; }
#photoModalImage { display: block; width: 100%; max-height: min(68vh, 760px); object-fit: contain; border-radius: 10px; background: #e8edf5; }
.photo-modal-actions,
.photo-reassign-form { display: flex; align-items: end; gap: 10px; width: 100%; }
.photo-modal-actions .form-control,
.photo-reassign-form .form-control { min-width: 0; }
.photo-modal-actions .btn,
.photo-reassign-form .btn { flex: 0 0 auto; }
.user-action { min-width: 175px; display: grid; gap: 7px; }
.project-card { padding: 20px; }
.project-card h2 { margin-top: 22px; }
.project-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #2563eb; background: #eaf2ff; font-size: 20px; }
.project-meta { display: flex; gap: 20px; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.project-meta span { display: grid; }
.project-meta b { color: var(--ink); font-size: 15px; }
.form-panel { padding: 22px; }
.form-panel > h2 { margin-bottom: 20px; }
.btn { border-radius: 9px; font-weight: 600; }
.form-control, .form-select { border-color: #dce3ee; border-radius: 9px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 10% 10%, #dbeafe, transparent 35%), radial-gradient(circle at 90% 85%, #cffafe, transparent 36%), #f8fafc; }
.login-card { width: min(430px, 100%); padding: 38px; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.8); border-radius: 22px; box-shadow: 0 24px 70px rgba(30,64,175,.14); backdrop-filter: blur(12px); }
.login-card .brand-mark { margin-bottom: 24px; }
.login-card h1 { font-size: 28px; font-weight: 760; }
.mobile-nav { display: grid; align-content: start; gap: 6px; }
.participant-list { display: grid; }
.participant-row { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.participant-row:last-child { border-bottom: 0; }
.participant-row div { min-width: 0; }
.participant-row strong, .participant-row span { display: block; }
.participant-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.participant-row > b { white-space: nowrap; font-size: 14px; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-column { margin-left: 0; }
  .mobile-header { height: 68px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
  .mobile-header .brand-mark { width: 34px; height: 34px; }
  .content { padding: 22px 16px; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar > div { flex: 1 1 160px; }
  .report-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .btn { width: 100%; }
  .login-card { padding: 28px 22px; }
  #photoModal .modal-dialog { width: calc(100% - 16px); margin: 8px auto; }
  #photoModal .modal-body { padding: 10px; }
  #photoModalImage { max-height: 60vh; }
  .photo-modal-actions,
  .photo-reassign-form { align-items: stretch; flex-direction: column; }
  .photo-modal-actions .btn,
  .photo-reassign-form .btn { width: 100%; }
  .report-filter { grid-template-columns: 1fr; }
  .report-filter-actions { align-items: stretch; flex-direction: column; }
}

@media (min-width: 901px) and (max-width: 1350px) {
  .report-filter { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
}
