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

html { font-size: 14px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f9fa;
  color: #1a1a2e;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1e1e2e;
  color: #cdd6f4;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.2s ease;
}

.sidebar-header {
  padding: 1.25rem 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-name {
  color: #cba6f7;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.app-name:hover { text-decoration: none; color: #d6c4fb; }

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: #6c7086;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
}

.sidebar-section-label {
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c7086;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  color: #a6adc8;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #cdd6f4; text-decoration: none; }
.nav-link.active { color: #cba6f7; border-left-color: #cba6f7; background: rgba(203,166,247,0.1); }

.nav-sop { color: #f9e2af !important; }
.nav-sop:hover { color: #fad77b !important; }
.nav-sop.active { border-left-color: #f9e2af; color: #f9e2af; }

.nav-icon { font-size: 0.9rem; }

.nav-project {
  padding-left: 0.75rem;
  font-size: 0.8125rem;
}

.project-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.75rem 0;
  border-top: 1px solid #313244;
}

.nav-logout { color: #f38ba8 !important; }
.nav-logout:hover { color: #ff8ba7 !important; }

/* ─── Main wrap ───────────────────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #374151;
  padding: 0.25rem;
}

.topbar-breadcrumb {
  flex: 1;
  font-size: 0.875rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar-breadcrumb a { color: #6b7280; }
.topbar-breadcrumb a:hover { color: #4f46e5; }
.topbar-breadcrumb span:last-child { color: #111827; font-weight: 500; }
.bc-sep { color: #d1d5db; }

.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ─── Content ─────────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1000px;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}
.card.card-danger { border-color: #fca5a5; }
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}
.mt-4 { margin-top: 1.25rem; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.1s, box-shadow 0.1s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: #4f46e5; color: #fff; border-color: #4338ca; }
.btn-primary:hover { background: #4338ca; }

.btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover { background: #f9fafb; }

.btn-danger { background: #dc2626; color: #fff; border-color: #b91c1c; }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.35rem;
}
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9375rem;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
select.form-input { appearance: auto; }
.form-textarea { resize: vertical; min-height: 120px; }
.form-input-file { padding: 0.35rem 0; border: none; }
.form-hint { font-size: 0.75rem; color: #9ca3af; margin-top: 0.3rem; }

.required { color: #dc2626; }

.form-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem 1rem;
  align-items: end;
}
.form-inline-grid .form-group { margin-bottom: 0; }
.form-group-action { align-self: end; }

.form-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.form-row .form-input { flex: 1; min-width: 120px; }

.form-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #f3f4f6; }

.form-error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.form-notice-banner {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.color-input-wrap { display: flex; gap: 0.5rem; align-items: center; }
.color-picker { width: 42px; height: 38px; padding: 2px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; }
.color-text-input { flex: 1; }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.6;
}
.badge-lg { font-size: 0.8rem; padding: 0.25rem 0.75rem; }
.badge-xs { font-size: 0.65rem; padding: 0.1rem 0.4rem; }

.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-orange  { background: #ffedd5; color: #9a3412; }
.badge-gray    { background: #f3f4f6; color: #374151; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }
.badge-indigo  { background: #e0e7ff; color: #3730a3; }
.badge-teal    { background: #ccfbf1; color: #134e4a; }
.badge-yellow  { background: #fef9c3; color: #713f12; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-green   { background: #dcfce7; color: #14532d; }
.badge-sky     { background: #e0f2fe; color: #075985; }
.badge-emerald { background: #d1fae5; color: #064e3b; }
.badge-rose    { background: #ffe4e6; color: #9f1239; }
.badge-slate   { background: #f1f5f9; color: #334155; }
.badge-violet  { background: #f5f3ff; color: #4c1d95; }
.badge-amber   { background: #fef3c7; color: #78350f; }

/* ─── Tag pills ───────────────────────────────────────────────────────────── */
.tag-pill {
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  color: #374151;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* ─── Login page ──────────────────────────────────────────────────────────── */
body.login-page {
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
}
.login-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ─── Dashboard ───────────────────────────────────────────────────────────── */
.dashboard-search-bar {
  margin-bottom: 2rem;
}
.search-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.search-input { flex: 1; }
.search-wrap-lg .search-input-lg { font-size: 1rem; padding: 0.65rem 1rem; }

/* ─── Project grid ────────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.project-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: #c7d2fe; text-decoration: none; }
.project-card.archived { opacity: 0.65; }

.project-card-accent { height: 4px; }
.project-card-body { padding: 1rem; }
.project-card-name { font-weight: 600; font-size: 0.9375rem; color: #111827; margin-bottom: 0.2rem; }
.project-card-client { font-size: 0.8125rem; color: #6b7280; margin-bottom: 0.5rem; }
.project-card-stats { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }

/* ─── Project list (projects.php) ─────────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: 0; }
.project-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
  flex-wrap: wrap;
}
.project-list-item:last-child { border-bottom: none; }
.project-list-accent { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.project-list-info { flex: 1; min-width: 150px; }
.project-list-name { font-weight: 600; color: #111827; }
.project-list-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.inline-edit-form { width: 100%; padding-top: 0.75rem; }

/* ─── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}
.page-title { font-size: 1.25rem; font-weight: 700; color: #111827; }
.page-subtitle { color: #6b7280; font-size: 0.875rem; margin-top: 0.3rem; }

/* ─── Section titles ──────────────────────────────────────────────────────── */
.section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.section-title:first-child { margin-top: 0; }
.section-title-sm { font-size: 0.875rem; margin-top: 1.25rem; }

/* ─── Project view ────────────────────────────────────────────────────────── */
.project-header {
  border-left: 4px solid #6366f1;
  padding-left: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.project-header-info { flex: 1; }
.project-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.project-client { font-size: 0.875rem; color: #6b7280; margin-left: 0.75rem; }

/* ─── Pinned links ────────────────────────────────────────────────────────── */
.pinned-links-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}
.pinned-link-item {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 0.15rem 0.25rem 0.15rem 0.75rem;
  gap: 0.25rem;
}
.pinned-link {
  font-size: 0.8125rem;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
}
.pinned-link:hover { color: #4f46e5; text-decoration: none; }
.link-delete-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.1rem 0.2rem;
  line-height: 1;
}
.link-delete-btn:hover { color: #ef4444; }
.add-link-form { margin-bottom: 1rem; }

/* ─── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.filter-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.filter-btn:hover { background: #f3f4f6; text-decoration: none; }
.filter-btn.active { background: #ede9fe; border-color: #a78bfa; color: #5b21b6; font-weight: 500; }

/* ─── Entry list ──────────────────────────────────────────────────────────── */
.entry-list { margin-top: 0.5rem; }
.entry-list-header { margin-bottom: 0.5rem; color: #6b7280; font-size: 0.8125rem; }
.entry-count { }

.entry-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.entry-row:last-child { border-bottom: none; }

.entry-title {
  font-weight: 500;
  color: #111827;
  flex: 1;
  min-width: 150px;
}
.entry-title:hover { color: #4f46e5; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.entry-date { margin-left: auto; white-space: nowrap; font-size: 0.8125rem; }
.entry-actions { display: flex; gap: 0.3rem; }
.entry-excerpt { width: 100%; font-size: 0.8125rem; color: #6b7280; margin-top: 0.15rem; }

/* ─── SOP cards ───────────────────────────────────────────────────────────── */
.sop-section { margin-bottom: 1.5rem; }
.sop-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  padding: 0.5rem 0;
  list-style: none;
}
.sop-section-title::marker { display: none; }
.sop-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }

.sop-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 0.9rem 1rem;
}
.sop-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.sop-card-actions { margin-left: auto; display: flex; gap: 0.3rem; }
.sop-trigger-text { font-size: 0.875rem; color: #6b7280; margin-bottom: 0.5rem; }
.sop-steps { margin: 0.4rem 0 0.4rem 1.25rem; font-size: 0.875rem; }
.sop-steps li { margin-bottom: 0.2rem; }
.sop-expected { font-size: 0.8125rem; color: #374151; margin-top: 0.4rem; }

.sop-result-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #f97316;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.sop-result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.sop-keyword { font-size: 0.9375rem; }
.sop-trigger { font-size: 0.875rem; color: #6b7280; margin-bottom: 0.4rem; }
.sop-footer { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; flex-wrap: wrap; }
.sop-actions-inline { margin-left: auto; }

/* ─── Entry view ──────────────────────────────────────────────────────────── */
.entry-view-header {
  border-left: 4px solid #6366f1;
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}
.entry-view-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.entry-project-link a { color: #6b7280; font-size: 0.875rem; }
.entry-project-link a:hover { color: #4f46e5; }
.entry-view-title { font-size: 1.4rem; font-weight: 700; color: #111827; margin-bottom: 0.35rem; }
.entry-view-dates { font-size: 0.8125rem; color: #9ca3af; margin-bottom: 0.75rem; }
.entry-view-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.entry-tags-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1rem; }
.entry-url-bar { margin-bottom: 1rem; }
.entry-url-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #4f46e5;
  font-size: 0.9375rem;
  word-break: break-all;
}
.link-arrow { opacity: 0.6; font-size: 0.8rem; }
.favicon { border-radius: 2px; flex-shrink: 0; }

.entry-body {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  white-space: pre-wrap;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #1a1a2e;
}
.entry-body-empty { color: #9ca3af; }

/* ─── Image gallery ───────────────────────────────────────────────────────── */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  overflow-x: auto;
}
.gallery-thumb img {
  height: 120px;
  width: auto;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  display: block;
}
.image-thumbs { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.image-thumb-item { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.thumb-img { height: 80px; width: auto; object-fit: cover; border-radius: 4px; border: 1px solid #e5e7eb; }
.remove-label { font-size: 0.75rem; color: #dc2626; display: flex; align-items: center; gap: 0.2rem; cursor: pointer; }

/* ─── URL fetch status ────────────────────────────────────────────────────── */
.url-fetch-status { font-size: 0.75rem; color: #6b7280; margin-top: 0.3rem; display: block; }

/* ─── SOP form ────────────────────────────────────────────────────────────── */
.sop-steps-editor { display: flex; flex-direction: column; gap: 0.5rem; }
.sop-step-row { display: flex; align-items: center; gap: 0.5rem; }
.step-num { font-size: 0.8125rem; color: #6b7280; width: 1.25rem; text-align: right; flex-shrink: 0; }
.mt-2 { margin-top: 0.5rem; }

/* ─── Confirm delete ──────────────────────────────────────────────────────── */
.confirm-delete-page { max-width: 560px; }
.delete-target { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.75rem 1rem; margin: 0.75rem 0; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.delete-warning { color: #991b1b; font-size: 0.875rem; margin: 0.5rem 0; }
.confirm-delete-form { display: flex; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ─── Settings ────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.stat-item { text-align: center; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 700; color: #4f46e5; }
.stat-label { font-size: 0.75rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; }
.export-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ─── Empty states ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}
.empty-state h2 { color: #374151; margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1rem; }
.empty-state-inline { padding: 1.25rem; text-align: center; color: #6b7280; font-size: 0.875rem; }

/* ─── Misc ────────────────────────────────────────────────────────────────── */
.meta { font-size: 0.8125rem; color: #6b7280; }
.muted { color: #9ca3af; }
.stat { font-size: 0.8125rem; color: #6b7280; }
.text-muted { color: #6b7280; font-size: 0.875rem; margin-bottom: 0.75rem; }
.inline-form { display: inline; }

.archived-section { margin-top: 2rem; }
.archived-section summary { cursor: pointer; }

.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0 0;
  border-top: 1px solid #f3f4f6;
  margin-top: 0.5rem;
}
.page-info { font-size: 0.8125rem; color: #6b7280; }

.sop-search-header { margin-bottom: 1.25rem; }
.sop-results { margin-top: 1.5rem; }

.search-results-section { margin-top: 1rem; }
.dashboard-projects { margin-top: 0; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .sidebar-close { display: block; }
  .hamburger { display: block; }
  .main-wrap { margin-left: 0; }

  .form-inline-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }

  .content { padding: 1rem; }
  .topbar { padding: 0 1rem; }

  .project-header { flex-direction: column; }
  .project-header-actions { width: 100%; }

  .entry-row { flex-direction: column; align-items: flex-start; }
  .entry-date { margin-left: 0; }

  .confirm-delete-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .search-wrap { flex-wrap: wrap; }
  .search-input { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
