/* ==========================================================================
   Roof IQ — Application UI (dashboard, project hub, wizards, report)
   Builds on the tokens defined in styles.css
   ========================================================================== */

.view-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ---- App bar -------------------------------------------------------- */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  background: rgba(5, 7, 15, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.app-bar-logo {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.05rem;
}

.app-bar-logo span {
  color: var(--blue-500);
}

.app-bar-nav {
  display: flex;
  gap: 18px;
  flex: 1;
}

.app-bar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.app-bar-link:hover {
  color: var(--blue-400);
}

.app-bar-ai-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  color: #c4a6ff;
}

.app-bar-ai-btn:hover {
  color: #dcc6ff;
}

button.app-bar-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
}

.app-bar-user {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sync-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-400);
  letter-spacing: 0.04em;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-500);
  box-shadow: 0 0 8px 2px rgba(47, 208, 255, 0.6);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.sync-indicator--degraded {
  color: var(--text-muted);
}

.sync-indicator--degraded .sync-dot {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}

/* "Live in Customer Portal" — shown in the project hub instead of an
   "update the portal" action, since the portal already reads this
   project's data live; see project-hub.js. */
.sync-indicator--portal-live {
  color: #34c77c;
}

.sync-indicator--portal-live .sync-dot {
  background: #34c77c;
  box-shadow: 0 0 8px 2px rgba(52, 199, 124, 0.6);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.view-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px 100px;
}

/* The wizard and full report views are dense, multi-column working
   surfaces (nav + question + live preview, or a wide multi-field doc) —
   the 1240px cap above exists for list-style views like the dashboard,
   not these, so router.js lifts it while one of them is open. */
.view-content--full {
  max-width: none;
}

/* ---- Shared bits ------------------------------------------------------ */

.hub-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(47, 208, 255, 0.1);
  border: 1px solid var(--border-soft);
  color: var(--blue-400);
  font-size: 0.78rem;
  font-weight: 600;
}

.hub-chip--muted {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.hub-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.hub-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.hub-breadcrumb a:hover {
  color: var(--blue-400);
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-soft);
  border-radius: 14px;
  grid-column: 1 / -1;
}

.empty-state a {
  color: var(--blue-400);
}

.btn-ghost {
  background: none;
  border: 1px dashed var(--border-soft);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.btn-ghost:hover {
  border-color: var(--blue-500);
  color: var(--blue-400);
}

/* ---- Dashboard ---------------------------------------------------------- */

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

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Marketing & Literature ---------------------------------------------- */

.marketing-section {
  margin-bottom: 36px;
}

.marketing-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.marketing-section-header h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 8px;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.material-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(19, 27, 74, 0.4), rgba(13, 20, 54, 0.4));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.material-card:hover {
  border-color: var(--blue-500);
  transform: translateY(-2px);
}

.material-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex: none;
}

.material-card-body {
  min-width: 0;
}

.material-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

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

.material-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.material-card-remove {
  position: absolute;
  top: 10px;
  right: 10px;
}

.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

.dashboard-sub {
  color: var(--text-secondary);
  margin-top: 6px;
}

.dashboard-search {
  margin-bottom: 28px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.invite-link-row {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
}
.invite-link-row input {
  flex: 1;
}

.dashboard-search input {
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
}

.dashboard-search input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(47, 208, 255, 0.15);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.project-card {
  display: block;
  background: linear-gradient(180deg, rgba(19, 27, 74, 0.4), rgba(13, 20, 54, 0.4));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  border-color: var(--blue-500);
  transform: translateY(-2px);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card-top h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.company-badge {
  flex: none;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.company-badge--ASN {
  background: rgba(47, 208, 255, 0.14);
  color: var(--blue-400);
}

.company-badge--ASE {
  background: rgba(255, 176, 32, 0.14);
  color: #ffb020;
}

.project-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 10px 0 14px;
}

.project-card-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-progress {
  display: grid;
  grid-template-columns: 58px 1fr 32px;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mini-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.mini-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
}

/* ---- Modal --------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 12, 0.7);
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--navy-850), var(--navy-900));
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.modal-card--wide {
  max-width: 640px;
}

.signing-modal-card {
  position: relative;
  max-width: 900px;
  height: min(85vh, 900px);
  display: flex;
  padding: 0;
  overflow: hidden;
}
.signing-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.signing-modal-close.icon-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy-900);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.modal-sub {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

/* `display: flex` above wins specificity over the browser's default
   `[hidden] { display: none }`, so a hidden label inside a modal would
   otherwise stay visible as an empty flex row. */
.modal-card label[hidden] {
  display: none;
}

.modal-card input {
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  outline: none;
}

.modal-card input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(47, 208, 255, 0.15);
}

.form-error {
  color: #ff6b7a;
  font-size: 0.8rem;
}

.company-picker {
  border: none;
  padding: 0;
  margin: 0;
}

.company-picker legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 0;
}

.company-picker-options {
  display: flex;
  gap: 8px;
}

.company-option {
  flex: 1;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.company-option input {
  accent-color: var(--blue-500);
  width: auto !important;
  padding: 0 !important;
}

.company-option:has(input:checked) {
  border-color: var(--blue-500);
  color: var(--text-primary);
  background: rgba(47, 208, 255, 0.1);
}

.company-option.is-disabled-option {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- New/Existing Customer toggle (Send to Customer modals) ------------- */

.sort-buttons {
  display: flex;
  gap: 8px;
}

.sort-btn {
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.sort-btn:hover {
  border-color: var(--blue-500);
  color: var(--blue-400);
}

.sort-btn.is-active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #04101f;
}

/* ---- Report picker (Send Report to Customer modal) ---------------------- */
/* A dedicated list for potentially dozens of properties — the shared
   .company-picker above assumes 2-3 equal-width items and breaks down
   (everything squeezed to slivers) once there are more than a handful. */

.report-picker {
  border: none;
  padding: 0;
  margin: 0;
}

.report-picker legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 0;
}

.report-picker #report-search {
  margin-bottom: 8px;
}

.report-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.report-picker-sep {
  color: var(--text-tertiary);
}

.report-picker-count {
  margin-left: auto;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
}

.report-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 6px;
}

.report-picker-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background 0.12s ease, color 0.12s ease;
}

.report-picker-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.report-picker-item input {
  accent-color: var(--blue-500);
  width: auto !important;
  padding: 0 !important;
  flex-shrink: 0;
}

.report-picker-item:has(input:checked) {
  background: rgba(47, 208, 255, 0.1);
  color: var(--text-primary);
}

.report-picker-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-picker-item-wo {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.report-picker-item.is-disabled-option {
  opacity: 0.5;
  cursor: not-allowed;
}

.report-picker-item.is-search-hidden {
  display: none !important;
}

.report-picker-empty {
  margin: 10px 2px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* ---- PDF import ------------------------------------------------------------ */

.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.import-pdf-btn {
  width: 100%;
  text-align: center;
}

.hub-header {
  position: relative;
}

.hub-import-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* All three glow buttons already share height/padding/font — this just
   keeps their widths from stair-stepping with label length, so the row
   reads as one matched set instead of three different-sized buttons. */
.hub-import-actions .btn-import-report,
.hub-import-actions #hub-send-customer-btn,
.hub-import-actions #hub-preview-portal-btn {
  min-width: 180px;
  text-align: center;
}

/* Electric orange, matching .btn-photo-report's palette elsewhere in the
   app — a soft pulsing glow draws the eye to this as the one place to
   bring in an already-completed report. */
.hub-import-actions .btn-import-report {
  width: auto;
  margin-top: 0;
  background: linear-gradient(135deg, #ff8a1e, #ff5c00);
  color: #2a0e00;
  border: none;
  border-radius: 9px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  animation: import-report-glow 2.4s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-import-actions .btn-import-report:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(255, 122, 26, 0.7);
}

@keyframes import-report-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 122, 26, 0.35); }
  50% { box-shadow: 0 0 26px rgba(255, 122, 26, 0.65); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-import-actions .btn-import-report {
    animation: none;
    box-shadow: 0 0 16px rgba(255, 122, 26, 0.45);
  }
}

/* "Look at the Portal" / "Send to Customer" — same size as .btn-import-report,
   each with its own pulsing glow so they read as the hub's other two
   one-click actions. */
.hub-import-actions #hub-send-customer-btn,
.hub-import-actions #hub-preview-portal-btn {
  width: auto;
  margin-top: 0;
  border-radius: 9px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-import-actions #hub-send-customer-btn:hover,
.hub-import-actions #hub-preview-portal-btn:hover {
  transform: translateY(-1px);
}

.hub-import-actions #hub-send-customer-btn {
  background: #34c77c;
  color: #06241a;
  border: none;
  animation: send-customer-glow 2.4s ease-in-out infinite;
}

.hub-import-actions #hub-send-customer-btn:hover {
  box-shadow: 0 0 28px rgba(52, 199, 124, 0.7);
}

.hub-import-actions #hub-preview-portal-btn {
  background: #ffffff;
  color: #11151c;
  border: none;
  animation: preview-portal-glow 2.4s ease-in-out infinite;
}

.hub-import-actions #hub-preview-portal-btn:hover {
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.7);
}

@keyframes send-customer-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(52, 199, 124, 0.35); }
  50% { box-shadow: 0 0 26px rgba(52, 199, 124, 0.65); }
}

@keyframes preview-portal-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 0 26px rgba(255, 255, 255, 0.65); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-import-actions #hub-send-customer-btn {
    animation: none;
    box-shadow: 0 0 16px rgba(52, 199, 124, 0.45);
  }
  .hub-import-actions #hub-preview-portal-btn {
    animation: none;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.45);
  }
}

.import-card {
  max-width: 480px;
}

.photo-import-card {
  max-width: 760px;
}

.ai-rewrite-card {
  max-width: 720px;
}

.ai-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.ai-compare-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-compare-col label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ai-readonly-text {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  min-height: 120px;
  white-space: pre-wrap;
}

.ai-compare-col textarea {
  min-height: 120px;
}

.ai-key-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.integrations-field {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.integrations-field:last-of-type {
  border-bottom: none;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--blue-500);
  text-decoration: underline;
  cursor: pointer;
}

.photo-import-page-divider {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin: 18px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.photo-import-page-divider:first-child {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

.photo-import-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 6px;
}

.photo-import-row {
  display: grid;
  grid-template-columns: 24px 90px 1fr;
  gap: 12px;
  align-items: start;
  padding: 6px 4px;
  border-radius: 8px;
}

.photo-import-row.is-excluded {
  opacity: 0.4;
}

.photo-import-thumb {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

.photo-import-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-import-fields textarea {
  grid-column: 1 / -1;
  min-height: 50px;
}

.photo-import-fields .doc-input {
  padding: 7px 9px;
  font-size: 0.82rem;
}

.import-card--review {
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
}

.import-card--loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 50px 30px;
  text-align: center;
}

.import-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(47, 208, 255, 0.2);
  border-top-color: var(--blue-500);
  animation: spin 0.9s linear infinite;
}

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

.import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  border: 1.5px dashed var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.import-dropzone:hover,
.import-dropzone.is-dragover {
  border-color: var(--blue-500);
  color: var(--blue-400);
}

.import-dropzone.is-dragover {
  background: rgba(47, 208, 255, 0.06);
}

.import-dropzone-icon {
  font-size: 1.6rem;
}

.import-field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
  margin: 6px 0 4px;
}

.import-field-row {
  display: grid;
  grid-template-columns: 24px 150px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 8px;
}

.import-field-row.is-excluded {
  opacity: 0.4;
}

.import-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-500);
}

.import-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.import-field-value {
  padding: 7px 10px;
  font-size: 0.85rem;
}

.import-field-row--photos {
  align-items: flex-start;
}

.import-photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-photo-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}

.import-subheading {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--blue-400);
  margin: 18px 0 8px;
}

.import-repair-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.import-repair-row {
  display: grid;
  grid-template-columns: 24px repeat(4, 1fr);
  gap: 8px;
  align-items: center;
}

.import-repair-row--head {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 4px;
}

.import-repair-row.is-excluded {
  opacity: 0.4;
}

.import-repair-row .doc-input {
  padding: 7px 9px;
  font-size: 0.8rem;
}

/* ---- Project hub --------------------------------------------------------- */

.hub-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

.hub-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.hub-company-select {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 176, 32, 0.1);
  border: 1px solid rgba(255, 176, 32, 0.3);
  color: #ffb020;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.hub-pm-actions {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(227, 157, 55, 0.08);
  border: 1px solid rgba(227, 157, 55, 0.3);
}

.hub-pm-actions h4 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e39d37;
  margin-bottom: 10px;
}

.hub-pm-actions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-pm-actions-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hub-pm-actions-list li::before {
  content: "→ ";
  color: #e39d37;
}

.hub-pm-actions-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-right: auto;
}

.hub-pm-actions-list a:hover {
  color: var(--blue-400);
}

.hub-pm-skip-btn {
  font-size: 0.78rem;
  white-space: nowrap;
}

.hub-pm-actions--done {
  margin-top: 28px;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.hub-roles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.role-card {
  background: rgba(19, 27, 74, 0.35);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.role-card-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.role-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.role-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 18px;
  flex: 1;
}

.role-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 6px;
}

.role-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
}

.role-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: block;
}

.role-card-btn {
  text-align: center;
  text-decoration: none;
}

.hub-report-link {
  display: inline-block;
  color: var(--blue-400);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.hub-report-link:hover {
  color: var(--blue-400);
  text-decoration: underline;
}

.hub-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.hub-footer-actions .btn-primary {
  width: auto;
}

.hub-footer-download-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Electric orange, deliberately smaller than .btn-primary (the main PDF
   download) so it reads as the secondary action next to it. */
.btn-photo-report {
  background: linear-gradient(135deg, #ff8a1e, #ff5c00);
  color: #2a0e00;
  border: none;
  border-radius: 9px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0;
  box-shadow: 0 0 16px rgba(255, 122, 26, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-photo-report:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(255, 122, 26, 0.55);
}

.report-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.report-view-header .btn-primary {
  width: auto;
  flex: none;
}

.report-view-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Wizard --------------------------------------------------------------- */

.wizard-shell {
  display: grid;
  /* The preview panel tracks the actual window width (~30% of it) instead
     of being capped at a fixed pixel range, so it keeps feeling like "the
     right third of the screen" on anything from a laptop to an ultrawide,
     not just a fixed 400-520px slice of it. */
  grid-template-columns: 260px minmax(0, 1fr) minmax(360px, 30vw);
  gap: 24px;
  align-items: start;
}

.wizard-nav {
  position: sticky;
  top: 90px;
  background: rgba(19, 27, 74, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}

.wizard-nav-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.wizard-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wizard-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.wizard-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.wizard-nav-item.is-active {
  background: rgba(47, 208, 255, 0.1);
  color: var(--text-primary);
}

.nav-check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.wizard-nav-item.is-answered .nav-check {
  background: var(--blue-600);
  color: #04101f;
}

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.wizard-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
  transition: width 0.25s ease;
}

.wizard-card {
  background: rgba(19, 27, 74, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 32px;
  min-height: 220px;
}

.wizard-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.wizard-card-head h2 {
  margin-bottom: 0;
}

.wizard-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.wizard-skipped-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
}

.wizard-help {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 22px;
}

.wizard-empty-note {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.wizard-report-panel {
  position: sticky;
  top: 90px;
  background: rgba(8, 12, 31, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 18px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}

.wizard-report-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 14px;
}

/* ---- Report document ------------------------------------------------------ */

.report-view-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.report-doc {
  background: rgba(19, 27, 74, 0.25);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 36px;
}

.report-doc--panel {
  background: transparent;
  border: none;
  padding: 0;
}

.report-masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border-soft);
}

.report-brand-mark {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
}

.report-brand-mark b {
  color: var(--blue-500);
  font-weight: 800;
}

.report-brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.report-brand-contact {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
  margin-top: 2px;
}

.report-masthead-ids {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.report-masthead-ids .doc-field {
  min-width: 180px;
}

.report-section {
  margin-bottom: 34px;
  padding: 14px;
  border-radius: 12px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.report-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--blue-400);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.report-section--active {
  background: rgba(47, 208, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(47, 208, 255, 0.35), var(--glow);
}

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

.doc-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.doc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.doc-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assist-trigger-btn {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(168, 123, 250, 0.35);
  background: rgba(168, 123, 250, 0.12);
  color: #c4a6ff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.assist-trigger-btn:hover {
  border-color: rgba(168, 123, 250, 0.6);
  background: rgba(168, 123, 250, 0.2);
}

.pm-notes-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.pm-notes-field .assist-trigger-btn {
  align-self: flex-start;
}

.doc-optional {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

.recommendation-suggestion {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(47, 208, 255, 0.08);
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recommendation-suggestion strong {
  color: var(--text-primary);
}

.recommendation-suggestion .btn-ghost {
  margin-top: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.doc-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(47, 208, 255, 0.15);
}

.doc-textarea {
  min-height: 90px;
  resize: vertical;
}

/* The maintenance scope-of-work textarea starts pre-filled with ~15
   lines of built-in default copy — tall enough to read/edit without
   immediately having to resize it. */
[data-section-field="maintenancePlans.scopeOfWork"] .doc-textarea {
  min-height: 280px;
  font-family: inherit;
}

/* Grade dropdowns: color-coded per letter so a grade is easy to spot and
   pick while grading, matching the same colors used in the exported PDF.
   The option list also gets an explicit solid background — native <select>
   popups often render with the OS's own default (frequently white)
   regardless of the closed box's dark theme, which left light-colored
   option text unreadable against it. */
.grade-select {
  font-weight: 700;
}

.grade-select option {
  background: var(--navy-800);
  color: var(--text-primary);
  font-weight: 600;
}

.grade-select option[value="A"] { color: #34c77c; }
.grade-select option[value="B"] { color: #6fd08a; }
.grade-select option[value="C"] { color: #e0b23d; }
.grade-select option[value="D"] { color: #e3833f; }
.grade-select option[value="F"] { color: #f2555a; }
.grade-select option[value="N/A"] { color: var(--text-muted); }

/* ---- Repairs table ---------------------------------------------------------- */

.repairs-table-wrap {
  overflow-x: auto;
}

.repairs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.repairs-table th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.repairs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.doc-input--cell {
  padding: 8px 10px;
  font-size: 0.85rem;
  min-width: 110px;
}

.cell-readonly {
  color: var(--text-secondary);
  padding: 4px 0;
}

.cell-actions {
  width: 32px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 6px;
}

.icon-btn:hover {
  color: #ff6b7a;
  background: rgba(255, 107, 122, 0.08);
}

.icon-btn--danger {
  color: #ff8787;
}

.empty-row td {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px 10px;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-critical { background: rgba(255, 82, 82, 0.15); color: #ff6b6b; }
.badge-high { background: rgba(255, 159, 67, 0.15); color: #ff9f43; }
.badge-medium { background: rgba(255, 212, 59, 0.15); color: #ffd43b; }
.badge-low { background: rgba(81, 207, 102, 0.15); color: #51cf66; }
.badge-neutral { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

/* ---- Maintenance plan pricing --------------------------------------------- */

.plan-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.plan-price-card {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.plan-price-card--plus {
  border-color: rgba(47, 208, 255, 0.35);
}

.plan-price-card--elite {
  border-color: rgba(255, 176, 32, 0.5);
  background: rgba(255, 176, 32, 0.05);
}

.plan-price-tier {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.plan-price-tier span {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.plan-price-computed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* The Annual/Total prices default to the Savings % math but a PM can type
   an exact figure into either one instead — see planPriceEditableHtml() /
   onFieldEvent's data-plan-price-total branch in report.js. */
.plan-price-editable {
  gap: 10px;
  margin-top: 4px;
}

.plan-price-reset {
  align-self: flex-start;
}

/* ---- Capital planning budgets ---------------------------------------------- */

.capital-context {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(47, 208, 255, 0.08);
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.capital-context strong {
  color: var(--text-primary);
}

.doc-field--suggested label {
  color: var(--blue-400);
}

.budgets-grid {
  display: grid;
  /* auto-fit lets this wrap to fewer columns automatically whenever its
     actual container is narrow — not just at small viewports. A fixed
     `repeat(5, 1fr)` looked fine on the full-width report page but
     squeezed each input to a sliver in the wizard, where this grid lives
     inside a much narrower column (nav + main + live-preview panels
     split the screen three ways well before the viewport itself gets
     "small"). */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.price-field-with-estimate {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.price-field-with-estimate .doc-field {
  flex: 1;
  min-width: 0;
}

/* Capital Planning's budget fields put the bare <input> directly inside
   here (no nested .doc-field, unlike the maintenance-plan price field
   above) — without its own flex-basis, a plain flex item defaults to
   shrinking toward its intrinsic minimum, which collapsed these to a
   near-zero-width sliver whenever the container was narrow (e.g. the
   wizard's input column, next to the live report preview panel). */
.price-field-with-estimate input {
  flex: 1;
  min-width: 0;
}

.estimate-trigger-btn {
  flex: none;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(47, 208, 255, 0.08);
  color: var(--blue-400);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.estimate-trigger-btn:hover {
  border-color: var(--blue-500);
  background: rgba(47, 208, 255, 0.16);
}

/* ---- Pricing estimator ------------------------------------------------------ */

.estimator-card {
  max-width: 960px;
  max-height: 88vh;
  overflow-y: auto;
}

.estimator-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
  margin-top: 8px;
}

.estimator-subheading {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--blue-400);
  margin: 20px 0 8px;
}

.estimator-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.estimator-task-row {
  display: grid;
  grid-template-columns: 1fr 90px 110px 28px;
  gap: 8px;
  align-items: center;
}

.estimator-task-row--head {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.estimator-task-row .doc-input {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.estimator-reference {
  margin-top: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
}

.estimator-reference summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.estimator-reference-note {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.estimator-reference-list {
  list-style: none;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.estimator-reference-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.estimator-reference-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.estimator-reference-link {
  text-decoration: none;
  opacity: 0.75;
  filter: grayscale(1);
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.estimator-reference-link:hover,
.estimator-reference-link:focus-visible {
  opacity: 1;
  filter: none;
}

.estimator-breakdown {
  position: sticky;
  top: 0;
  background: rgba(19, 27, 74, 0.35);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.estimator-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.estimator-line--muted {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.estimator-line--total {
  color: var(--text-primary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}

.estimator-line--grand {
  color: var(--blue-400);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  padding-top: 12px;
}

.estimator-apply-btn {
  width: 100%;
  margin-top: 16px;
}

/* ---- Inspection scorecard & photos ---------------------------------------- */

.scorecard-detail-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scorecard-detail-card {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.015);
}

.scorecard-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.scorecard-detail-head h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
}

.doc-input--inline {
  width: auto;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.photo-slot {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 260px;
}

.photo-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 12px;
  border: 1.5px dashed var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.photo-upload-btn:hover,
.photo-upload-btn.is-dragover {
  border-color: var(--blue-500);
  color: var(--blue-400);
}

.photo-upload-btn.is-dragover {
  background: rgba(47, 208, 255, 0.06);
}

.photo-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  line-height: 0;
}

.photo-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(5, 7, 15, 0.75);
  color: #fff;
}

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.photo-gallery-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-gallery-item .photo-preview img {
  max-height: 120px;
}

.photo-gallery-item .doc-input {
  padding: 6px 8px;
  font-size: 0.78rem;
}

.photo-gallery-add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border: 1.5px dashed var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.photo-gallery-add:hover,
.photo-gallery-add.is-dragover {
  border-color: var(--blue-500);
  color: var(--blue-400);
}

.photo-gallery-add.is-dragover {
  background: rgba(47, 208, 255, 0.06);
}

.photo-appendix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.photo-appendix-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.photo-appendix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.photo-appendix-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-400);
}

.photo-appendix-item .photo-slot {
  max-width: none;
}

/* ---- Responsive ------------------------------------------------------------ */

@media (max-width: 1200px) {
  .wizard-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .wizard-report-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .wizard-shell {
    grid-template-columns: 1fr;
  }
  .wizard-nav {
    position: static;
    max-height: none;
  }
  .hub-roles {
    grid-template-columns: 1fr;
  }
  .doc-grid,
  .doc-grid--3 {
    grid-template-columns: 1fr;
  }
  .plan-pricing-grid {
    grid-template-columns: 1fr;
  }
  .view-content {
    padding: 28px 18px 80px;
  }
  .app-bar {
    padding: 14px 18px;
    flex-wrap: wrap;
  }
  .app-bar-user {
    display: none;
  }
  .company-picker-options {
    flex-direction: column;
  }
  .scorecard-detail-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-field-label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .ai-compare {
    grid-template-columns: 1fr;
  }
  .estimator-grid {
    grid-template-columns: 1fr;
  }
  .estimator-breakdown {
    position: static;
  }
  .estimator-task-row {
    grid-template-columns: 1fr 70px 90px 24px;
    font-size: 0.8rem;
  }
  .estimator-reference-list {
    grid-template-columns: 1fr;
  }
  .price-field-with-estimate {
    flex-direction: column;
    align-items: stretch;
  }
  .photo-appendix-grid {
    grid-template-columns: 1fr;
  }
  .photo-import-row {
    grid-template-columns: 20px 1fr;
    grid-template-areas: "check thumb" "fields fields";
    row-gap: 8px;
  }
  .photo-import-row .import-check { grid-area: check; }
  .photo-import-row .photo-import-thumb { grid-area: thumb; width: 100%; height: auto; max-height: 140px; }
  .photo-import-row .photo-import-fields { grid-area: fields; grid-template-columns: 1fr; }
  .import-field-row {
    grid-template-columns: 20px 1fr;
    grid-template-areas: "check label" "value value";
    row-gap: 4px;
  }
  .import-field-row .import-check { grid-area: check; }
  .import-field-row .import-field-label { grid-area: label; }
  .import-field-row .import-field-value { grid-area: value; }
  .import-repair-row,
  .import-repair-row--head {
    grid-template-columns: 20px 1fr;
    grid-template-areas:
      "check issue"
      ".     location"
      ".     priority"
      ".     budget";
    row-gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .import-repair-row--head {
    display: none;
  }
  .import-repair-row .import-check { grid-area: check; }
  .import-repair-row input[data-repair-field="issue"] { grid-area: issue; }
  .import-repair-row input[data-repair-field="location"] { grid-area: location; }
  .import-repair-row input[data-repair-field="priority"] { grid-area: priority; }
  .import-repair-row input[data-repair-field="budget"] { grid-area: budget; }
}

/* ==========================================================================
   RBAC / workflow — badges, dashboard widgets, filters, hub panel,
   version history, presence banner, admin users table
   ========================================================================== */

.badge-success { background: rgba(81, 207, 102, 0.15); color: #51cf66; }
.badge-info { background: rgba(47, 208, 255, 0.15); color: var(--blue-400); }
.badge-warning { background: rgba(255, 212, 59, 0.15); color: #ffd43b; }
.badge-danger { background: rgba(255, 82, 82, 0.15); color: #ff6b6b; }

.btn-danger {
  border-color: rgba(255, 82, 82, 0.4);
  color: #ff8787;
}
.btn-danger:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.repairs-table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---- Dashboard summary widgets ------------------------------------------ */

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

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, rgba(19, 27, 74, 0.4), rgba(13, 20, 54, 0.4));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stat-card:hover {
  border-color: var(--blue-500);
  transform: translateY(-2px);
}

.stat-card-count {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dashboard-widgets-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dashboard-widget {
  background: rgba(19, 27, 74, 0.25);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
}

.dashboard-widget h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.admin-activity-line {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-activity-line:last-child {
  border-bottom: none;
}

/* ---- Project Library filters --------------------------------------------- */

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-pill {
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill:hover {
  border-color: var(--blue-500);
  color: var(--blue-400);
}

.filter-pill.is-active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #04101f;
}

.advanced-filters {
  margin-bottom: 20px;
}

.advanced-filters summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.advanced-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.advanced-filters-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.advanced-filters-grid select,
.advanced-filters-grid input {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.project-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.project-card--needs-review {
  border-color: rgba(255, 212, 59, 0.4);
}

/* ---- Project hub: workflow panel, presence, versions --------------------- */

.presence-banner {
  background: rgba(81, 207, 102, 0.1);
  border: 1px solid rgba(81, 207, 102, 0.3);
  color: #8ce99a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.presence-banner--locked {
  background: rgba(255, 212, 59, 0.08);
  border-color: rgba(255, 212, 59, 0.3);
  color: #ffd43b;
  margin: 0 0 20px;
}

.hub-panel {
  background: rgba(19, 27, 74, 0.25);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

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

.meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.meta-row-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hub-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.review-notes-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 14px;
}

.review-notes-field textarea {
  min-height: 70px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-body);
  resize: vertical;
}

.review-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.review-history h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.review-history-entry {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.review-history-notes {
  color: var(--text-muted);
  margin-top: 2px;
}

.version-history-panel {
  margin-bottom: 24px;
}

.version-history-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
}

/* ---- Admin users table ---------------------------------------------------- */

.admin-users-table-wrap {
  overflow-x: auto;
}

.admin-users-table {
  min-width: 900px;
}

.admin-activity-cell {
  max-width: 240px;
}

.is-disabled-row {
  opacity: 0.5;
}

/* ---- Help assistant, powered by Claude ---------------------------------- */
/* Sits just under the shared .modal-overlay z-index (50) — hidden behind an
   open modal rather than floating over it, and above ordinary page content. */

.help-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #04101f;
  border: none;
  border-radius: 10px 0 0 10px;
  padding: 16px 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  cursor: pointer;
  box-shadow: var(--glow);
}

.help-tab:hover {
  filter: brightness(1.08);
}

.help-panel {
  position: fixed;
  right: 46px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 44;
  width: 340px;
  max-width: calc(100vw - 64px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--navy-850), var(--navy-900));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.help-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
}

.help-panel-close:hover {
  color: var(--text-primary);
}

.help-panel-messages {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-msg {
  font-size: 0.86rem;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 88%;
  white-space: pre-wrap;
}

.help-msg--assistant {
  background: rgba(47, 208, 255, 0.08);
  color: var(--text-secondary);
  align-self: flex-start;
}

.help-msg--user {
  background: rgba(47, 208, 255, 0.18);
  color: var(--text-primary);
  align-self: flex-end;
}

.help-panel-quick {
  padding: 0 16px;
  flex-shrink: 0;
}

.help-panel-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.help-panel-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.86rem;
}

.help-panel-form .btn-primary {
  padding: 9px 16px;
  font-size: 0.86rem;
}

@media (max-width: 520px) {
  .help-panel {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .dashboard-stats,
  .dashboard-widgets-row,
  .advanced-filters-grid,
  .hub-panel-grid {
    grid-template-columns: 1fr;
  }
}
