/* R.E.E.U. — foglio di stile globale. Minimal, leggibile, responsive. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.5;
}

#app {
  width: 100%;
  min-height: 100vh;
}

h1, h2, h3 { line-height: 1.3; }

/* Utility */
.hidden { display: none !important; }

.empty-state {
  color: #999;
  font-size: 14px;
  padding: 16px 0;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 10px;
  font-size: 16px;
  color: #666;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #e0e0e0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.error {
  background: #fee;
  color: #c33;
  padding: 12px;
  border-radius: 4px;
  margin: 12px 0;
  border-left: 4px solid #c33;
}

.section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.section h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

/* App Nav */
.app-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: #2563eb;
  color: white;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 900;
}

.nav-brand {
  font-weight: 700;
  margin-right: auto;
  color: white;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.app-nav .nav-link {
  background: none;
  border: none;
  color: white;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  white-space: nowrap;
}

.app-nav .nav-link:hover,
.app-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.15);
}

.notif-bell-wrap {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: 40px;
  width: 320px;
  max-width: 90vw;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  color: #333;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 950;
}

.notif-item {
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 13px;
}

.notif-item:hover { background: #f5f5f5; }
.notif-item.unread { background: #eff6ff; }
.notif-item strong { display: block; margin-bottom: 4px; font-size: 14px; }
.notif-item p { margin: 0 0 4px; color: #555; }
.notif-item small { color: #999; }

.notif-empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-small {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
  min-height: 40px;
}

.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #d0d0d0; }
.btn-small { padding: 6px 12px; font-size: 12px; min-height: 32px; }
.btn-large { padding: 14px 24px; font-size: 16px; width: 100%; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
}

.form-actions .btn-secondary { flex: 1; }
.form-actions .btn-primary { flex: 2; }

/* Login/Signup */
.login-container, .signup-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card, .signup-card {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-card h1, .signup-card h1 { font-size: 28px; margin-bottom: 8px; color: #2563eb; }
.login-card p, .signup-card p { color: #666; margin-bottom: 24px; }

.divider { text-align: center; color: #999; margin: 20px 0; position: relative; }
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: #ddd;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.signup-link, .login-link { text-align: center; margin-top: 16px; font-size: 14px; }

.role-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.role-card {
  padding: 20px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
}

.role-card:hover { border-color: #2563eb; background: #f0f7ff; }
.role-icon { font-size: 32px; margin-bottom: 8px; }

/* Search */
.search-container { padding: 20px; background: white; min-height: 100vh; }
.search-header { max-width: 1200px; margin: 0 auto 30px; }

.filters-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.filter-input { padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.listing-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: 0.2s;
}

.listing-card:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15); }
.card-image { position: relative; height: 200px; overflow: hidden; background: #eee; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }

.price-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #2563eb;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
}

.card-info { padding: 16px; }
.card-info h3 { font-size: 16px; margin-bottom: 8px; }
.description { font-size: 14px; color: #666; margin-bottom: 12px; }
.specs { display: flex; gap: 16px; font-size: 13px; color: #999; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Dashboard / Pipeline */
.dashboard-container { padding: 20px; max-width: 1200px; margin: 0 auto; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pipeline-column h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-column .count {
  background: #e0e0e0;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
}

.pipeline-cards { display: flex; flex-direction: column; gap: 10px; }

.pipeline-card {
  background: white;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: 0.2s;
}

.pipeline-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }
.pipeline-card .price { color: #2563eb; font-weight: 600; margin: 4px 0; }
.pipeline-card .task-count { font-size: 12px; color: #999; }
.overdue-flag { color: #dc2626; font-weight: 600; }

/* Wedge Upload */
.wedge-container { padding: 20px; max-width: 1200px; margin: 0 auto; }
.wedge-header { margin-bottom: 24px; }
.wedge-header p { color: #666; margin-top: 4px; }

.wedge-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.upload-panel {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.upload-section { margin-bottom: 20px; }
.upload-section label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 8px; }

.drop-zone {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  color: #666;
  font-size: 14px;
}

.drop-zone:hover, .drop-zone.drag-active { border-color: #2563eb; background: #f0f7ff; }

.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f5f5;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}

.file-item .remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 14px;
}

.wedge-results { min-height: 200px; }
.processing { text-align: center; padding: 40px 0; color: #666; }
.job-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin-inline: auto; }

.job-status {
  display: flex;
  justify-content: space-between;
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
}

.result-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.result-images { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.result-images img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; }
.result-card .success { color: #16a34a; }
.result-card .error { color: #dc2626; }

/* Property Detail */
.property-detail-container { max-width: 1000px; margin: 0 auto; padding: 20px; }
.property-header { margin-bottom: 16px; }
.property-header h1 { font-size: 24px; }

.property-photos { margin-bottom: 20px; }
.main-photo { border-radius: 8px; overflow: hidden; height: 360px; background: #eee; margin-bottom: 8px; }
.main-photo img { width: 100%; height: 100%; object-fit: cover; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid img { width: 100%; height: 100px; object-fit: cover; border-radius: 4px; }

.passport { display: flex; flex-direction: column; gap: 10px; }
.passport-item strong { display: inline-block; min-width: 160px; }
.passport-item ul { margin-left: 20px; margin-top: 4px; }

.renovation-timeline, .timeline-events { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.timeline-item { font-size: 14px; padding: 8px 0; border-bottom: 1px solid #eee; }

.renders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.renders-grid img { width: 100%; border-radius: 4px; }

.cta { text-align: center; padding: 24px 20px; }

/* Workspace */
.workspace-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 56px);
  background: white;
}

.workspace-sidebar {
  background: #f9f9f9;
  padding: 20px;
  border-right: 1px solid #ddd;
  overflow-y: auto;
}

.workspace-sidebar h2 { font-size: 14px; text-transform: uppercase; color: #999; margin: 16px 0 8px; }
.workspace-sidebar h2:first-child { margin-top: 0; }

.participants-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.participant { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.participant .avatar { font-size: 16px; }

.workspace-main { padding: 20px; max-width: 900px; }

.workspace-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.workspace-header h1 { font-size: 22px; }

.workspace-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 16px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-content { display: flex; flex-direction: column; gap: 12px; }
.tab-content.hidden { display: none; }

.upload-zone {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: #666;
  transition: 0.2s;
}

.upload-zone:hover, .upload-zone.drag-active { border-color: #2563eb; background: #f0f7ff; }

.documents-list, .tasks-list { display: flex; flex-direction: column; gap: 8px; }

.document-item, .task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9f9f9;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
}

.document-item { justify-content: space-between; }
.doc-info { display: flex; flex-direction: column; gap: 2px; }
.doc-info small { color: #999; }

.risk-flags { color: #dc2626; font-size: 12px; margin-top: 2px; }

.task-item span { flex: 1; }
.status-badge.overdue { background: #fee2e2; color: #dc2626; }
.task-assign { font-size: 12px; padding: 4px 6px; border: 1px solid #ddd; border-radius: 4px; }

.timeline { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; }

/* ============================================================
   CasaAI — design system dedicato al wizard "prima casa", scoped
   sotto .casaai per non toccare il tema blu del resto dell'app.
   ============================================================ */
.casaai {
  --ca-primary: #0ea5e9;
  --ca-primary-dark: #0284c7;
  --ca-bg: #f0f9ff;
  --ca-ink: #0f172a;
  --ca-muted: #64748b;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ca-ink);
}

.casaai-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  background: var(--ca-bg);
  min-height: 100vh;
}

.casaai-card {
  background: white;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.08), 0 8px 24px rgba(14, 165, 233, 0.08);
  margin-bottom: 16px;
}

.casaai-h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; text-wrap: balance; }
.casaai-lede { color: var(--ca-muted); margin-bottom: 20px; font-size: 14px; }

.casaai-btn-primary {
  background: var(--ca-primary);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  min-height: 48px;
  transition: 0.15s;
}

.casaai-btn-primary:hover { background: var(--ca-primary-dark); }

.casaai-btn-secondary {
  background: white;
  color: var(--ca-primary);
  border: 2px solid var(--ca-primary);
  border-radius: 14px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}

.casaai-progress { margin-bottom: 20px; }

.casaai-progress-bar {
  height: 6px;
  background: #e0f2fe;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.casaai-progress-fill { height: 100%; background: var(--ca-primary); transition: width 0.3s; }
.casaai-progress-label { font-size: 13px; color: var(--ca-muted); font-weight: 600; }

.casaai-wizard-nav { display: flex; gap: 12px; margin-top: 24px; }
.casaai-wizard-nav .casaai-btn-secondary { flex: 1; }
.casaai-wizard-nav .casaai-btn-primary { flex: 2; }

.casaai-kpi {
  font-size: 34px;
  font-weight: 800;
  color: var(--ca-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.casaai-kpi-label { font-size: 13px; color: var(--ca-muted); margin-bottom: 4px; }

.casaai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.casaai-kpi-card { background: var(--ca-bg); border-radius: 16px; padding: 16px; }
.casaai-kpi-card .casaai-kpi { font-size: 22px; }

.casaai-tool-list { display: flex; flex-direction: column; gap: 10px; }

.casaai-tool-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ca-bg);
  border-radius: 16px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--ca-ink);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: 0.15s;
}

.casaai-tool-link:hover { background: #e0f2fe; }
.casaai-tool-link span:last-child { color: var(--ca-primary); }

.casaai-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.casaai-checklist-item:last-child { border-bottom: none; }
.casaai-checklist-item.done span { text-decoration: line-through; color: var(--ca-muted); }

.casaai-share-link {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--ca-bg);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
}

.casaai-share-link input { flex: 1; border: none; background: none; font-size: 13px; color: var(--ca-ink); }

@media (max-width: 500px) {
  .casaai-container { padding: 16px 14px 50px; }
  .casaai-card { padding: 22px 18px; border-radius: 18px; }
}

/* Hub */
.hub-container { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }

.hub-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.hub-header h1 { font-size: 24px; }

.hub-section { margin-bottom: 32px; }
.hub-section h2 { font-size: 17px; margin-bottom: 14px; }

.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
  transition: 0.15s;
  cursor: pointer;
}

.hub-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1); transform: translateY(-2px); }
.hub-card strong { font-size: 14.5px; }
.hub-card span { font-size: 12.5px; color: #888; }

.hub-deal-list { display: flex; flex-direction: column; gap: 6px; }

.hub-deal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hub-deal-row:hover { background: #f0f7ff; }

@media (max-width: 600px) {
  .hub-cards { grid-template-columns: 1fr 1fr; }
}

/* Tool pages (mortgage/renovation simulators) */
.tool-container { max-width: 720px; margin: 0 auto; padding: 20px; }
.tool-container h1 { font-size: 24px; margin-bottom: 6px; }
.tool-intro { color: #666; margin-bottom: 24px; }

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.tool-form {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tool-result { min-height: 60px; }

.result-highlight {
  background: #eff6ff;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.result-label { font-size: 13px; color: #666; margin-bottom: 4px; }
.result-value { font-size: 28px; font-weight: 700; color: #2563eb; }

.result-breakdown {
  background: white;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.result-breakdown div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.result-breakdown div:last-child { border-bottom: none; }
.tool-note { font-size: 13px; color: #666; margin-top: 12px; font-style: italic; }
.tool-note a { color: #2563eb; }

.tool-form h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
  margin: 20px 0 10px;
}

.tool-form h3:first-child { margin-top: 0; }

.form-group label input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.afford-badge {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

.afford-badge p { margin-top: 4px; font-weight: 400; font-size: 13px; }
.afford-badge.afford-good { background: #ecfdf3; color: #16a34a; }
.afford-badge.afford-warn { background: #fff7ec; color: #b45309; }
.afford-badge.afford-risky { background: #fee2e2; color: #dc2626; }

.result-note-success {
  color: #16a34a;
  background: #ecfdf3;
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 12px;
  font-size: 14px;
}

.form-group input:disabled { background: #f5f5f5; color: #888; }

@media (max-width: 700px) {
  .tool-layout { grid-template-columns: 1fr; }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.close-btn { position: absolute; top: 12px; right: 12px; font-size: 24px; cursor: pointer; color: #999; }
.close-btn:hover { color: #333; }

.back-btn { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 14px; margin-bottom: 16px; }

/* Install PWA bar */
.install-pwa-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 980;
  background: #1c2733;
  color: white;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.install-pwa-bar span { flex: 1; }
.install-pwa-bar .btn-small { background: rgba(255, 255, 255, 0.15); color: white; }

/* Offline banner */
.offline-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 320px;
  background: #ffa500;
  color: white;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 900;
}

/* ============================================================
   Responsive — mobile first breakpoint at 768px
   ============================================================ */
@media (max-width: 768px) {
  .app-nav { padding: 10px 12px; gap: 8px; }
  .nav-brand { width: 100%; margin-right: 0; margin-bottom: 4px; }
  .app-nav .nav-link { padding: 8px; font-size: 13px; }

  .workspace-layout { grid-template-columns: 1fr; }
  .workspace-sidebar { border-right: none; border-bottom: 1px solid #ddd; }

  .wedge-layout { grid-template-columns: 1fr; }

  .pipeline { grid-template-columns: 1fr 1fr; }

  .role-options { grid-template-columns: 1fr; }

  .login-card, .signup-card { padding: 28px 20px; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .main-photo { height: 220px; }

  .passport-item strong { display: block; min-width: 0; margin-bottom: 2px; }

  .modal-content { padding: 20px; }

  .dashboard-header { flex-direction: column; align-items: stretch; }
  .search-header h1 { font-size: 22px; }
}

@media (max-width: 480px) {
  .pipeline { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: 1fr; }
  .notif-dropdown { width: 90vw; right: -60px; }
}
