/* Dashboard — saved projects */
.dash-wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 22px; }
.dash-head h1 { font-size: 30px; margin: 0; letter-spacing: -0.01em; }
.dash-head p { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.proj-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.proj-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,49,34,.10); }
.proj-thumb { aspect-ratio: 4/3; background: #eef2ee; overflow: hidden; }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-body { padding: 14px 16px 16px; }
.proj-name { font-weight: 800; font-size: 16px; margin: 0 0 6px; color: #1c2b22; }
.proj-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.kind-badge { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #eef5ee; color: #2e5b3f; border: 1px solid #cfdccf; }
.kind-badge.hard { background: #f3efe6; color: #7a5b2e; border-color: #e0d5bd; }
.status-pill { font-size: 12px; font-weight: 700; }
.status-pill.ready { color: #2e7d46; }
.status-pill.draft { color: #8a7a2e; }
.status-pill.failed { color: #a33; }
.proj-actions { display: flex; gap: 8px; margin-top: 12px; }
.empty-state { text-align: center; padding: 70px 20px; background: #fff; border: 1px dashed var(--line); border-radius: 16px; }
.empty-state h2 { margin: 0 0 8px; font-size: 22px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }
/* detail view */
.back-link { display: inline-block; margin: 6px 0 14px; font-size: 14px; font-weight: 700; color: var(--green); text-decoration: none; }
.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.detail-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.detail-card h3 { margin: 0 0 4px; font-size: 18px; }
.detail-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ba-cell { position: relative; border-radius: 10px; overflow: hidden; }
.ba-cell img { width: 100%; height: auto; display: block; aspect-ratio: auto; object-fit: contain; }
.ba-tag { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: rgba(20,30,24,.72); color: #fff; }
.detail-plan img { width: 100%; border-radius: 10px; display: block; }
.spec-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.spec-dl dt { color: var(--muted); font-weight: 600; }
.spec-dl dd { margin: 0; font-weight: 700; color: #1c2b22; }
.code-symbol { display: inline-flex; align-items: center; }
.code-symbol svg { display: block; width: 40px; height: 40px; }
.legend-table td:first-child { text-align: center; width: 52px; }
.takeoff-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.takeoff-table th, .takeoff-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.takeoff-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.danger-btn { background: none; border: none; color: #a33; font-size: 13px; font-weight: 700; cursor: pointer; padding: 8px 0; }
.danger-btn:hover { text-decoration: underline; }
.dash-loading { text-align: center; padding: 60px 20px; color: var(--muted); }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

/* ---------- dashboard shell: sidebar + content ---------- */
.dash-shell { display: flex; align-items: flex-start; max-width: 1440px; margin: 0 auto; }
.dash-side { width: 232px; flex: 0 0 232px; padding: 26px 0 60px 22px; position: sticky; top: 76px; max-height: calc(100vh - 76px); overflow-y: auto; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 10px;
  color: #33463a; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.dash-nav a:hover { background: #f0f4f0; }
.dash-nav a.active { background: #e7f0e7; color: var(--green); }
.dash-nav .ni { width: 22px; text-align: center; }
.dash-main { flex: 1; min-width: 0; max-width: 1120px; padding: 26px 22px 90px; }
.credits-pill { font-size: 13px; font-weight: 700; background: #eef5ee; border: 1px solid #cfdccf;
  color: #2e5b3f; border-radius: 999px; padding: 7px 13px; white-space: nowrap; }
/* segmented tabs (designs) */
.seg-tabs { display: inline-flex; gap: 4px; background: #eef1ee; border-radius: 999px; padding: 4px; margin: 4px 0 18px; }
.seg-tabs a { padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; color: #5a6a60;
  text-decoration: none; }
.seg-tabs a.active { background: #fff; color: var(--green); box-shadow: 0 1px 4px rgba(20,49,34,.12); }
/* toast */
.dash-toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 12px); background: #1e2b23;
  color: #fff; font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: 12px; z-index: 200;
  opacity: 0; transition: opacity .3s ease, transform .3s ease; pointer-events: none; max-width: 90vw; }
.dash-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* base plan cards */
.bp-thumb { display: flex; align-items: center; justify-content: center; background: #e9efe9; min-height: 120px; }
.bp-glyph { font-size: 44px; opacity: .55; }
/* billing */
.credit-big { font-size: 52px; font-weight: 800; color: var(--green); line-height: 1.1; margin: 4px 0 8px; }
/* ---------- plant library (in-dashboard) ---------- */
.plib-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 4px; }
.lib-search { flex: 1 1 260px; display: flex; }
.lib-search input { width: 100%; padding: 11px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  font: inherit; font-size: 15px; }
.lib-search input:focus { outline: none; border-color: var(--green2); }
.lib-theme select { padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit;
  font-size: 14px; background: #fff; max-width: 240px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: thin; }
.chip { flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip[aria-pressed="true"] small { color: #d9e8d9; }
.lib-count { color: var(--muted); font-size: 14px; margin: 14px 0 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 10px 0 8px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease; display: flex; flex-direction: column; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,49,34,.10); }
.pcard .ph { aspect-ratio: 4/3; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .ph .init { font-size: 44px; font-weight: 800; color: var(--green2); opacity: .35; }
.pcard .bd { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard h3 { font-size: 16px; margin: 0; }
.pcard .bot { font-style: italic; color: var(--muted); font-size: 13px; }
.pcard .facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fact { font-size: 12px; background: var(--soft); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.catbadge { align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green); background: #e9f2e8; border-radius: 999px; padding: 4px 11px; }
.loadmore { text-align: center; padding: 26px 0 40px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.modal-veil { position: fixed; inset: 0; background: #101a1080; display: none; align-items: flex-start;
  justify-content: center; z-index: 60; padding: 36px 16px; overflow-y: auto; }
.modal-veil.open { display: flex; }
.modal { background: #fff; border-radius: 18px; max-width: 720px; width: 100%; overflow: hidden; box-shadow: 0 24px 70px rgba(10,25,18,.25); }
.modal .mphoto { max-height: 320px; overflow: hidden; background: var(--soft); }
.modal .mphoto img { width: 100%; height: 100%; max-height: 320px; object-fit: cover; }
.modal .mbody { padding: 26px 30px 30px; }
.modal h2 { margin-bottom: 2px; }
.modal .bot { font-style: italic; color: var(--muted); margin-bottom: 14px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 22px; margin: 16px 0; }
.mgrid dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.mgrid dd { margin: 2px 0 0; font-size: 14.5px; }
.modal h4 { margin: 20px 0 6px; font-size: 15px; }
.modal ul { margin: 0 0 8px; padding-left: 20px; font-size: 14.5px; }
.modal .close { float: right; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  width: 36px; height: 36px; font-size: 18px; cursor: pointer; line-height: 1; }
.warn { background: #fdf3ec; border: 1px solid #f0d9c2; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-top: 12px; }
/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .dash-shell { flex-direction: column; }
  .dash-side { width: auto; flex: none; position: static; max-height: none; padding: 12px 16px 0; }
  .dash-nav { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .dash-nav a { flex: 0 0 auto; white-space: nowrap; }
  .dash-main { padding: 18px 16px 70px; max-width: none; }
}

/* projects list view (owner, 2026-10-19): rows with a small CAD-only
   thumbnail instead of the full board grid — much faster to load. */
.proj-list { display: flex; flex-direction: column; gap: 10px; }
.proj-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; transition: box-shadow .12s ease; }
.proj-row:hover { box-shadow: 0 6px 18px rgba(20,49,34,.10); }
.proj-check { display: flex; align-items: center; padding: 6px 2px; cursor: pointer; }
.proj-check input { width: 18px; height: 18px; accent-color: #2e5b3f; cursor: pointer; }
.proj-thumb-sm { width: 104px; height: 72px; flex: 0 0 auto; background: #eef2ee; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.proj-thumb-sm img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.proj-main { flex: 1 1 auto; min-width: 0; }
.proj-main .proj-name { margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-open { font-size: 26px; color: var(--muted); flex: 0 0 auto; }
.list-toolbar { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.sel-all-label { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; cursor: pointer; }
.sel-all-label input { width: 17px; height: 17px; accent-color: #2e5b3f; }
.del-sel { background: #a33; border-color: #a33; }
.del-sel:disabled { opacity: .45; cursor: default; }
.bp-thumb { position: relative; }
.bp-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Shared project and site-plan list actions. */
.row-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-delete { min-height: 44px; padding: 8px; flex-shrink: 0; }
.row-delete:disabled { opacity: .45; cursor: default; }
.proj-row:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
@media (max-width: 600px) {
  .dash-main { width: 100%; box-sizing: border-box; }
  .proj-row { gap: 8px; padding: 10px; flex-wrap: wrap; }
  .proj-thumb-sm { width: 64px; height: 52px; }
  .proj-main { flex-basis: calc(100% - 110px); }
  .row-actions { margin-left: auto; }
  .list-toolbar { flex-wrap: wrap; }
}
