/* =========================================================
   GoVerify – gv.css (single source of truth)
   Full width everywhere + consistent gutters
   ========================================================= */

/* -------------------------
   Tokens
------------------------- */
:root{
  /* Layout */
  --gv-gutter: clamp(14px, 2vw, 28px);

  /* Theme (fallbacks; you can override per-theme if you want) */
  --gv-bg: #f4f7fd;
  --gv-surface: #ffffff;
  --gv-border: #e5e7eb;
  --gv-primary: #2563eb;
  --gv-primary-soft: #dbeafe;
  --gv-primary-dark: #1d4ed8;
  --gv-text-main: #111827;
  --gv-text-muted: #6b7280;
}

/* -------------------------
   Base reset
------------------------- */
*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--gv-bg);
  color: var(--gv-text-main);
  line-height: 1.5;
  overflow-x: hidden; /* avoid accidental sideways scroll */
}

a{ text-decoration: none; color: inherit; }

/* -------------------------
   App shell
------------------------- */
.page{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main{ flex: 1; }

/* -------------------------
   Full-width sections everywhere
------------------------- */
.section{
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2rem var(--gv-gutter) 2.4rem;
  min-width: 0;
}

@media (max-width: 900px){
  .section{ padding: 1.75rem 1.1rem 2rem; }
}

/* -------------------------
   Headings / page header
------------------------- */
.section-header{ margin-bottom: 1.1rem; }

.section-eyebrow{
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gv-text-muted);
  font-weight: 700;
}

.section-title{
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.section-subtitle{
  font-size: 0.9rem;
  color: var(--gv-text-muted);
}

.muted{ color: var(--gv-text-muted); }

/* -------------------------
   Cards + tables
------------------------- */
.card{
  background: var(--gv-surface);
  border-radius: 0.9rem;
  border: 1px solid var(--gv-border);
  padding: 1rem;
  font-size: 0.9rem;
  min-width: 0;

  /* Make wide content scroll inside card */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Long strings don’t blow up cards */
.card, .card *{
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* GoVerify tables */
table.gv-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.gv-table th, .gv-table td{
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--gv-border);
  text-align: left;
}

.gv-table thead{ background: #f9fafb; }

.gv-table th{
  font-weight: 700;
  color: #4b5563;
  font-size: 0.8rem;
}

/* Prevent table cells from forcing viewport width;
   the card scroll handles overflow. */
.card table.gv-table th,
.card table.gv-table td{
  white-space: nowrap;
}

/* -------------------------
   Buttons (site-wide)
------------------------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}

.btn:disabled,
.btn[disabled]{ opacity: 0.6; cursor: not-allowed; }

.btn-sm{ padding: 8px 12px; font-size: 0.9rem; border-radius: 10px; }

.btn-primary{
  background: var(--gv-primary);
  color: #fff;
  border-color: var(--gv-primary);
}
.btn-primary:hover{ background: var(--gv-primary-dark); border-color: var(--gv-primary-dark); }

.btn-outline{
  background: #fff;
  color: var(--gv-text-main);
  border-color: #d0d5dd;
}
.btn-outline:hover{ background: #f8fafc; }

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

/* -------------------------
   Forms (light)
------------------------- */
.form{ width: 100%; }

.form-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
@media (max-width: 860px){
  .form-grid{ grid-template-columns: 1fr; }
}

.form-field{ display: flex; flex-direction: column; }

.label{
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 6px 0;
}

.input, .select, .textarea{
  width: 100%;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
  outline: none;
}

.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(0,0,0,0.30);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

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

.hint{
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--gv-text-muted);
}

.check-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.02);
}

.form-actions{
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}
.form-actions .btn{ min-width: 140px; }

/* =========================================================
   Header (GoVerify Topbar)
========================================================= */
.gv-topbar{
  position: sticky;
  top: 0;
  z-index: 9999;             /* header always on top */
  background: #fff;
  border-bottom: 1px solid #e6eaf0;
}

.gv-topbar__inner{
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px var(--gv-gutter);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.gv-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gv-brand__logo{
  width: 70px;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

.gv-brand__text{ min-width: 0; }

.gv-brand__title{
  font-weight: 900;
  font-size: 18px;
  line-height: 1.05;
}

.gv-brand__tagline{
  margin-top: 2px;
  font-size: 15px;
  color: #667085;
  white-space: nowrap;
}

.gv-topbar__right{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Desktop nav */
.gv-nav{
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.gv-nav__link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  color: var(--gv-text-main);
  white-space: nowrap;
  position: relative;
  z-index: 10000; /* clickable above overlays */
}

.gv-nav__link:hover{ background: #f1f5f9; }

.gv-nav__link.is-active,
.gv-dd.is-active > .gv-nav__link--summary{
  background: var(--gv-primary-soft);
  color: var(--gv-primary-dark);
}

/* Dropdown */
.gv-dd{ position: relative; }
.gv-dd summary{ list-style: none; cursor: pointer; }
.gv-dd summary::-webkit-details-marker{ display: none; }

.gv-nav__link--summary{ display: inline-flex; align-items: center; gap: 6px; }
.gv-dd__chev{ font-size: 12px; opacity: 0.75; }

/* Hide menus unless <details open> */
.gv-dd .gv-dd__menu{ display: none; }
.gv-dd[open] .gv-dd__menu{ display: block; }

.gv-dd__menu{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--gv-surface);
  border: 1px solid var(--gv-border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .12);
  z-index: 10001;
}

.gv-dd__menu--right{ left: auto; right: 0; }

.gv-dd__item{
  display: flex;
  align-items: center;
  padding: 10px 10px;
  border-radius: 10px;
  font-weight: 800;
  color: var(--gv-text-main);
}

.gv-dd__item:hover{ background: #f1f5f9; }

.gv-dd__sep{
  height: 1px;
  background: var(--gv-border);
  margin: 6px 6px;
}

.gv-userchip{ display: inline-flex; align-items: center; gap: 8px; }
.gv-userchip__name{ max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hamburger */
.gv-burger{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gv-burger:hover{ background: #f8fafc; }

.gv-burger__lines{
  width: 22px;
  height: 2px;
  background: #111827;
  position: relative;
  border-radius: 2px;
  display: inline-block;
}

.gv-burger__lines::before,
.gv-burger__lines::after{
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #111827;
  border-radius: 2px;
}

.gv-burger__lines::before{ top: -7px; }
.gv-burger__lines::after{ top: 7px; }

/* Hide burger on desktop; show desktop nav */
@media (min-width: 981px){
  .gv-burger{ display: none; }
}

/* Hide desktop nav on mobile */
@media (max-width: 980px){
  .gv-nav--desktop{ display: none; }
}

/* =========================================================
   Mobile Menu
========================================================= */
[hidden]{ display: none !important; }

.gv-mobile-menu{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.45);
  z-index: 8000; /* below header */
  display: flex;
  justify-content: center;
  padding: 14px;

  /* key: don't steal clicks unless open */
  pointer-events: none;
}
.gv-mobile-menu.is-open{ pointer-events: auto; }

body.gv-menu-open{ overflow: hidden; }

.gv-mobile-menu__panel{
  width: min(520px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 16px 50px rgba(0,0,0,0.18);
  padding: 14px;
  align-self: flex-start;
}

.gv-mobile-menu__top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.gv-mobile-menu__brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gv-mobile-menu__logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.gv-mobile-menu__title{ font-weight: 900; font-size: 16px; line-height: 1.1; }
.gv-mobile-menu__subtitle{ font-size: 12px; color: #667085; white-space: nowrap; }

.gv-mobile-menu__close{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.gv-mobile-menu__close:hover{ background: #f8fafc; }

.gv-mobile-menu__user{
  font-size: 13px;
  color: #475467;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0 12px;
}

.gv-mobile-menu__nav{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gv-mobile-menu__link{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  font-size: 14px;
  color: #111827;
}

.gv-mobile-menu__link:hover{ background: #f8fafc; }

.gv-mobile-menu__link.is-active{
  background: #eef4ff;
  border-color: rgba(29,78,216,0.25);
  color: #1d4ed8;
  font-weight: 900;
}

.gv-mobile-menu__actions{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  gap: 10px;
}

/* =========================================================
   Drawer (filters/settings/profile)
========================================================= */
body.gv-drawer-open{ overflow: hidden; }

.gv-drawer-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.35);
  z-index: 8000; /* below header */
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.gv-drawer-backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}

.gv-drawer{
  position: fixed;
  top: 0;
  right: 0;
  width: min(86vw, 360px);
  height: 100%;
  background: var(--gv-surface);
  border-left: 1px solid var(--gv-border);
  transform: translateX(100%);
  transition: transform 180ms ease;
  z-index: 8001;
  display: flex;
  flex-direction: column;

  pointer-events: none;
}
.gv-drawer.is-open{
  transform: translateX(0);
  pointer-events: auto;
}

.gv-drawer__head{
  padding: 16px;
  border-bottom: 1px solid var(--gv-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gv-drawer__title{
  font-weight: 900;
  font-size: 1.05rem;
}

.gv-drawer__body{
  padding: 14px 16px;
  overflow: auto;
}

.gv-drawer__item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--gv-text-main);
  font-weight: 900;
}

/* =========================================================
   Responsive Table → Cards helpers (tools pages)
========================================================= */
.gv-table-wrap{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gv-cards{ display: none; }

.gv-card{
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
}

.gv-card__top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gv-card__title{
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.15;
}

.gv-card__subtitle{
  margin-top: 2px;
  font-size: 0.92rem;
  color: #667085;
}

.gv-card__pills{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.gv-pill{
  background: #eef4ff;
  color: #1d4ed8;
  border: 1px solid rgba(29,78,216,0.22);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.84rem;
}

.gv-card__actions{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.gv-card__actions .btn{ width: 100%; min-height: 44px; }

@media (max-width: 720px){
  .gv-table-wrap{ display: none; }
  .gv-cards{ display: block; }
}

/* =========================================================
   Tool tiles / search row / progress
========================================================= */
.gv-tool-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
@media (min-width: 900px){
  .gv-tool-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}

.gv-tool-card{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: 18px;
  background: var(--gv-surface);
  border: 1px solid var(--gv-border);
  color: var(--gv-text-main);
  min-height: 126px;
}

.gv-tool-card__icon{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1px solid var(--gv-border);
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.gv-tool-card__title{
  font-weight: 900;
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.15;
}

.gv-tool-card__sub{
  color: var(--gv-text-muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

.gv-tool-card__meta{
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gv-chip{
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 0.82rem;
  background: var(--gv-primary-soft);
  color: var(--gv-primary-dark);
  border: 1px solid #bfdbfe;
}

.gv-progress-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.gv-progress{
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.gv-progress > span{
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gv-primary);
  border-radius: 999px;
}

.gv-progress-meta{
  min-width: 64px;
  text-align: right;
  font-weight: 900;
  color: var(--gv-text-muted);
  font-size: 0.9rem;
}

.gv-search-filter-row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.gv-search-input{
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--gv-border);
  padding: 10px 12px;
  font-size: 1rem;
  outline: none;
  background: #fff;
}

.gv-icon-btn{
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--gv-border);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

/* =========================================================
   Inspections – Run UI
========================================================= */
.gv-insp{ width: 100%; }

.insp-run-card{ margin-top: 0.75rem; }

.insp-progress{
  margin: 10px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.insp-progress__bar{
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.insp-progress__bar > span{
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gv-primary);
}

.insp-progress__meta{
  min-width: 90px;
  text-align: right;
  font-weight: 900;
  color: #667085;
  font-size: 0.9rem;
}

.insp-section{
  border: 1px solid var(--gv-border);
  border-radius: 16px;
  background: var(--gv-surface);
  padding: 14px;
  margin-bottom: 12px;
}

.insp-section__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.insp-section__title{
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.15;
}

.insp-section__sub{
  margin-top: 4px;
  font-size: 0.9rem;
  color: #667085;
}

.insp-section__actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.insp-item{
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 12px 0;
}
.insp-item:first-of-type{
  border-top: none;
  padding-top: 6px;
}

.insp-item__top{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.insp-item__text{
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.25;
}

.insp-item__meta{
  margin-top: 4px;
  font-size: 0.85rem;
  color: #667085;
}

.insp-actions{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.insp-btn{
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
}

.insp-btn.is-active{
  color: #fff;
  border-color: transparent;
}

.insp-btn--pass.is-active{ background: #16a34a; }
.insp-btn--fail.is-active{ background: #dc2626; }
.insp-btn--na.is-active{ background: #9ca3af; }

.insp-fail-panel{
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid rgba(220,38,38,0.25);
  background: rgba(220,38,38,0.06);
  padding: 10px;
}

.insp-fail-panel textarea{
  width: 100%;
  min-height: 72px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  padding: 10px 12px;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
}

.insp-fail-panel textarea:focus{
  border-color: rgba(0,0,0,0.28);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.insp-snag-toggle{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 900;
  color: #111827;
}

.insp-snag-toggle input{
  width: 18px;
  height: 18px;
}

.insp-required{
  color: #ef4444;
  font-weight: 900;
  margin-left: 4px;
}

.insp-sticky-footer{
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 14px;
  padding-top: 12px;
  background: linear-gradient(to top, #fff 72%, rgba(255,255,255,0));
}

.insp-footer-bar{
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.insp-footer-left{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.insp-footer-left .muted{ color: #667085; font-size: 0.9rem; }

@media (max-width: 720px){
  .insp-footer-bar{
    flex-direction: column;
    align-items: stretch;
  }
  .insp-footer-bar .btn{
    width: 100%;
    justify-content: center;
  }
}

/* =========================
   Inspection – response buttons
   ========================= */

.insp-actions--set {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.insp-btn--opt.is-active {
  background: #2563eb;
}

.insp-comment {
  width: 100%;
  margin-top: 10px;
  min-height: 60px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  padding: 10px 12px;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}
/* =========================
   Inspection – Procore-style rows + coloured pills
   ========================= */

.insp-section {
  margin-top: 14px;
}

.insp-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 0;
}

.insp-section__title {
  font-weight: 900;
  font-size: 1.05rem;
}

.insp-section__sub {
  color: rgba(17,24,39,0.55);
  font-weight: 700;
  margin-top: 2px;
}

/* each checklist line looks like a table row */
.insp-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.insp-item__text {
  margin: 0;
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.35;
}

.insp-required {
  color: #dc2626;
  margin-left: 6px;
}

/* right side buttons */
.insp-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

/* pill buttons */
.insp-btn {
  min-width: 74px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #e5e7eb;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.insp-btn:hover {
  filter: brightness(0.98);
}

/* active colours */
.insp-btn--pass.is-active {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.insp-btn--fail.is-active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.insp-btn--na.is-active {
  background: #6b7280;
  border-color: #6b7280;
  color: #fff;
}

/* fail comment area should span full width under the row */
.insp-fail-panel {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(220,38,38,0.25);
  background: rgba(220,38,38,0.06);
}

.fail-comment {
  width: 100%;
  min-height: 70px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.14);
  padding: 10px 12px;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}

.insp-snag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-weight: 800;
  color: #334155;
}

/* mobile: keep buttons visible and not squashed */
@media (max-width: 680px) {
  .insp-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .insp-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}


/* =========================
   Inspections – mobile layout fix
   ========================= */

.inspection-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.inspection-item__label {
  flex: 1 1 auto;
  min-width: 0;                 /* critical: lets text wrap properly */
  overflow-wrap: anywhere;      /* prevents overflow without letter-stacking */
  word-break: normal;
}

.inspection-item__controls {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Mobile: stack label + controls so label isn't squeezed */
@media (max-width: 640px) {
  .inspection-item {
    flex-direction: column;
    gap: 10px;
  }

  .inspection-item__controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* If your Yes/No/NA buttons are in a group, let them fill the row nicely */
  .inspection-item__controls .btn,
  .inspection-item__controls button {
    flex: 1 1 90px;
  }

  /* Optional: shove “Activity” to its own line on mobile */
  .inspection-item__activity {
    width: 100%;
    justify-content: flex-start;
  }
}

/* =========================================================
   Footer
========================================================= */
.footer{
  border-top: 1px solid var(--gv-border);
  background: var(--gv-surface);
  padding: 1rem var(--gv-gutter) 1.4rem;
  font-size: 0.78rem;
  color: var(--gv-text-muted);
}

.footer-inner{
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-links{
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
/* =========================================================
   Weld Log (welds/index.html)
   ========================================================= */

.page-head{
  display:flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.page-head-actions{
  display:flex;
  align-items:center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 768px){
  .page-head{
    flex-direction: column;
    align-items: flex-start;
  }
  .page-head-actions{
    width: 100%;
    justify-content: flex-start;
  }
}

/* Filter pills */
.filter-bar{
  display:flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.filter-pill{
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  min-height: 36px;
}

.filter-pill.active{
  border-color: var(--gv-primary);
  background: var(--gv-primary);
  color: #fff;
}

/* QC % pill */
.qc-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.qc-pill--good{ background:#dcfce7; border-color:#16a34a; color:#166534; }
.qc-pill--ok{   background:#fef3c7; border-color:#f59e0b; color:#92400e; }
.qc-pill--bad{  background:#fee2e2; border-color:#ef4444; color:#b91c1c; }

/* Kebab actions (reusable) */
.actions-cell{ position: relative; text-align: right; width: 40px; }

.actions-btn{
  border: none;
  outline: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding-bottom: 4px;
}
.actions-btn:hover{ background:#d1d5db; }

.actions-menu{
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  min-width: 150px;
  box-shadow: 0 14px 28px rgba(15,23,42,0.18);
  display: none;
  padding: 4px 0;
  z-index: 60;
}

.actions-menu.is-open{ display:block; }

.actions-menu button{
  width: 100%;
  padding: 9px 12px;
  border: none;
  outline: none;
  background: transparent;
  text-align: left;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
}
.actions-menu button:hover{ background:#f3f4f6; }
.actions-menu button.danger{ color:#b91c1c; }

/* Weld cards (mobile) */
.weld-card-top{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.weld-card-left{
  display:flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.weld-card-title .line1{
  font-size: 0.95rem;
  line-height: 1.2;
}
.weld-card-title .line2{
  margin-top: 2px;
  color: var(--gv-text-muted);
  font-size: 0.9rem;
}
.weld-card-title .muted{
  color: var(--gv-text-muted);
  font-weight: 700;
  margin-left: 6px;
}

/*=====================================================/
WELD LOG CARD ACTIONS
/======================================================/
.weld-card-actions{ position: relative; flex: 0 0 auto; }

/* On cards, drop menu below kebab */
.weld-card-actions .actions-menu{
  top: 18px;
  transform: none;
}

.weld-card-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin: 12px 0 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--gv-border);
}

.weld-card-grid .k{
  display:block;
  color: var(--gv-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.weld-card-grid .v{
  display:block;
  margin-top: 2px;
  font-weight: 800;
  color: var(--gv-text-main);
  font-size: 0.9rem;
  word-break: break-word;
}

.btn-block{
  width: 100%;
  min-height: 44px;
}

/* Weld log bar inside the table card */
.weld-log-bar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--gv-border);
}

.weld-log-bar__title{
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.1;
}

.weld-log-bar__sub{
  margin-top: 2px;
  font-size: .9rem;
}

.weld-log-bar__right{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

/* Small buttons (if you already have btn-sm elsewhere, keep one definition only) */
.btn-sm{
  padding: 8px 12px;
  border-radius: 12px;
  font-size: .9rem;
}

/* tighten filter bar spacing now that it sits under a header */
.weld-log-card .filter-bar{
  padding-top: 10px;
}

/* =========================
   Inspection – Activity + modal
   ========================= */


.insp-activity {
  display: inline-flex;
  align-items: center;
}

.insp-activity-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111827;
}

.insp-activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
}

.insp-activity-btn.has-activity .insp-activity-dot {
  background: #2563eb;
}

.insp-activity-btn:hover {
  background: rgba(0,0,0,0.03);
}

/* Modal */
.insp-modal[hidden] { display: none; }

.insp-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.insp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.insp-modal__panel {
  position: absolute;
  right: 18px;
  top: 18px;
  bottom: 18px;
  width: min(560px, calc(100vw - 36px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.insp-modal__head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.insp-modal__kicker {
  color: rgba(17,24,39,0.55);
  font-weight: 800;
  font-size: 0.85rem;
}

.insp-modal__title {
  font-weight: 900;
  font-size: 1.05rem;
  margin-top: 2px;
}

.insp-modal__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
}

.insp-modal__close:hover {
  background: rgba(0,0,0,0.06);
}

.insp-modal__body {
  padding: 14px 16px;
  overflow: auto;
}

.insp-modal__label {
  display: block;
  font-weight: 900;
  margin-bottom: 8px;
}

.insp-modal__textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  padding: 10px 12px;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}

.insp-modal__file {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  padding: 10px 12px;
  background: #fff;
}

.insp-modal__hint {
  margin-top: 8px;
  color: rgba(17,24,39,0.55);
  font-weight: 700;
  font-size: 0.85rem;
}

.insp-modal__footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
/* ==========================================
   Inspections – mobile: buttons under question
   ========================================== */

/* Desktop/default: question left, controls right */
.inspection-item,
.checklist-item,
.insp-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.inspection-item__label,
.checklist-item__label,
.insp-item-row__label {
  flex: 1 1 auto;
  min-width: 0;               /* critical: prevents letter-per-line squeeze */
  overflow-wrap: anywhere;
  word-break: normal;
}

.inspection-item__controls,
.checklist-item__controls,
.insp-item-row__controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile: stack */
@media (max-width: 640px) {
  .inspection-item,
  .checklist-item,
  .insp-item-row {
    flex-direction: column;
    gap: 10px;
  }

  .inspection-item__controls,
  .checklist-item__controls,
  .insp-item-row__controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* Make Yes/No/NA buttons sit nicely in a row */
  .inspection-item__controls .btn,
  .checklist-item__controls .btn,
  .insp-item-row__controls .btn,
  .inspection-item__controls button,
  .checklist-item__controls button,
  .insp-item-row__controls button {
    flex: 1 1 96px;
  }

  /* Activity button: keep it on its own line (optional) */
  .inspection-item__activity,
  .checklist-item__activity,
  .insp-item-row__activity {
    width: 100%;
  }
}

/* =========================================================
   FIX: Inspections mobile – buttons under question
   Place this at the VERY END of gv.css
   ========================================================= */

/* Stop grid fighting: treat item as a block; layout is handled by .insp-item__row */
.insp-item{
  display: block !important;
}

/* Desktop: question left, controls right */
.insp-item__row{
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.insp-item__text{
  flex: 1 1 auto;
  min-width: 0;              /* critical */
  overflow-wrap: anywhere;
  word-break: normal;
}

.insp-item__controls{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Keep action buttons grouped */
.insp-actions{
  display: flex;
  gap: 10px;
  margin: 0;
}

/* Mobile: stack controls under the question */
@media (max-width: 680px){
  .insp-item__row{
    flex-direction: column;
    gap: 10px;
  }

  .insp-item__controls{
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .insp-actions{
    width: 100%;
  }

  .insp-actions .insp-btn{
    flex: 1 1 96px;
  }

  .insp-activity,
  .insp-activity-btn{
    width: 100%;
  }
}

/* ==========================================
   ELECTRICAL HELPERS
   ========================================== */
.muted { color: var(--gv-text-muted); }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--gv-border); border-radius: 10px; }
.label { font-weight: 700; display:block; margin-bottom:6px; }
.form-grid { display:grid; gap: 12px; }
.form-row { display:flex; flex-direction:column; }


/* --- Header context chips --- */
.gv-nav__iconlink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:999px;
  color: var(--gv-text-main);
}
.gv-nav__iconlink:hover{ background:#f1f5f9; }
.gv-nav__iconlink.is-active{ background: var(--gv-primary-soft); color: var(--gv-primary-dark); }
.gv-nav__iconlink svg{ width:30px; height:30px; }

.gv-projectchip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.gv-projectchip__label{
  font-size:12px;
  font-weight:900;
  color:#667085;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.gv-projectchip__name{
  font-weight:900;
  font-size:14px;
  color: var(--gv-text-main);
  max-width: 240px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.gv-projectchip__no{
  margin-left:6px;
  font-weight:800;
  font-size:12px;
  color:#667085;
}

@media (max-width: 980px){
  .gv-projectchip__label{ display:none; }
  .gv-projectchip__name{ max-width: 160px; }
}

/* =========================================================
   CxControl QA – stage cards + badges
   Place at END of gv.css
   ========================================================= */

.gv-stage-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.gv-stage-head{
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 12px;
}

.gv-stage-title{
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.1;
}

.gv-stage-kicker{
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gv-text-muted);
  font-weight: 800;
}

.gv-badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}

.gv-badge--issued{
  background:#dcfce7;
  border-color:#16a34a;
  color:#166534;
}
.gv-badge--ready{
  background:#eef4ff;
  border-color: rgba(29,78,216,0.25);
  color:#1d4ed8;
}
.gv-badge--blocked{
  background:#fee2e2;
  border-color:#ef4444;
  color:#991b1b;
}
.gv-badge--unknown{
  background:#f3f4f6;
  border-color:#e5e7eb;
  color:#374151;
}

.gv-req-list{
  margin: 8px 0 0 0;
  padding-left: 1.1rem;
}

.gv-req-list li{
  margin: 4px 0;
}

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

.gv-stage-meta{
  margin-top: 10px;
  font-size: 0.88rem;
}

/* === GoVerify Floating Scan Button (mobile) === */
.gv-fab{
  position: fixed;
  z-index: 9999;
  bottom: 18px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 16px);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gv-fab__main{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.10);
}

.gv-fab__icon{
  font-size: 18px;
  line-height: 1;
}

.gv-fab__text{
  white-space: nowrap;
  font-size: 14px;
}

.gv-fab__toggle{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  color: #111827;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.15);
}

.gv-fab__chev{
  display: inline-block;
  font-size: 22px;
  line-height: 1;
  transform: rotate(180deg);
}

/* Collapsed state */
.gv-fab[data-collapsed="1"] .gv-fab__main{
  width: 44px;
  padding: 12px;
  justify-content: center;
}

.gv-fab[data-collapsed="1"] .gv-fab__text{
  display: none;
}

.gv-fab[data-collapsed="1"]{
  right: -10px;
}

.gv-fab[data-collapsed="1"] .gv-fab__chev{
  transform: rotate(0deg);
}

/* Mobile-only */
@media (min-width: 992px){
  .gv-fab{ display: none; }
}

/* =========================
   Analytics page facelift
   ========================= */
.analytics-page .analytics-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; margin-bottom:14px;
}
.analytics-title{ font-size:22px; font-weight:800; letter-spacing:-0.02em; }
.analytics-controls{ display:flex; align-items:center; gap:10px; }

.segmented{
  display:inline-flex; gap:0; border:1px solid var(--gv-border,#e5e7eb);
  border-radius:999px; overflow:hidden; background:#fff;
}
.seg-btn{
  padding:8px 10px; border:0; background:transparent; cursor:pointer;
  font-weight:700; font-size:12px; color:var(--gv-text,#111827);
}
.seg-btn + .seg-btn{ border-left:1px solid var(--gv-border,#e5e7eb); }
.seg-btn.is-active{ background:#111827; color:#fff; }

.analytics-hero{
  display:grid; grid-template-columns: 2fr 1fr;
  gap:12px; margin-bottom:12px;
}
.hero-card .hero-chart{ height:280px; }
.insight-card{ display:flex; flex-direction:column; }
.insight-list{ display:flex; flex-direction:column; gap:12px; margin-top:6px; }
.insight-row{ display:flex; gap:10px; align-items:flex-start; }
.insight-dot{ width:10px; height:10px; border-radius:999px; margin-top:6px; }
.dot-danger{ background:#ef4444; }
.dot-warn{ background:#f59e0b; }
.dot-good{ background:#22c55e; }
.insight-title{ font-weight:800; }
.insight-footer{ margin-top:auto; padding-top:10px; border-top:1px solid var(--gv-border,#e5e7eb); }

.analytics-kpi-strip{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-bottom:16px;
}
.kpi-tile{
  background:#fff; border:1px solid var(--gv-border,#e5e7eb);
  border-radius:14px; padding:12px 12px 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.kpi-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.kpi-mini-icon{
  width:26px; height:26px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  background:#f3f4f6; font-weight:900;
}
.kpi-label{ font-size:12px; font-weight:800; color:#374151; }
.kpi-value{ font-size:26px; font-weight:900; letter-spacing:-0.02em; margin-top:6px; }
.kpi-foot{ margin-top:2px; font-size:12px; }

.kpi-danger{ border-color: rgba(239,68,68,0.35); background: linear-gradient(180deg, rgba(239,68,68,0.08), #fff 65%); }

.section-block{ margin-top:18px; }
.section-title{
  display:flex; align-items:baseline; justify-content:space-between;
  margin-bottom:10px;
  font-weight:900;
}
.section-title .muted{ font-weight:600; }

/* Make charts breathe */
.analytics-grid{ display:grid; gap:12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-wrap{ height:240px; }
@media (max-width: 1100px){
  .analytics-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-kpi-strip{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-hero{ grid-template-columns: 1fr; }
}
/* Analytics subnav */
.analytics-subnav{
  display:flex; gap:8px; flex-wrap:wrap;
  margin-bottom:12px;
}
.analytics-tab{
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 12px;
  border:1px solid var(--gv-border,#e5e7eb);
  border-radius:999px;
  background:#fff;
  font-weight:800;
  font-size:12px;
  color:inherit;
  text-decoration:none;
}
.analytics-tab.is-active{
  background:#111827;
  color:#fff;
  border-color:#111827;
}

.analytics-kpi-strip{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-bottom:12px;
}
.kpi-tile{
  background:#fff;
  border:1px solid var(--gv-border,#e5e7eb);
  border-radius:14px;
  padding:12px;
  box-shadow:0 1px 0 rgba(0,0,0,0.03);
}
.kpi-label{ font-size:12px; font-weight:800; color:#374151; }
.kpi-value{ font-size:26px; font-weight:900; letter-spacing:-0.02em; margin-top:6px; }

.kpi-danger{
  border-color: rgba(239,68,68,0.35);
  background: linear-gradient(180deg, rgba(239,68,68,0.08), #fff 65%);
}

/* grids */
.analytics-grid{ display:grid; gap:12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-wrap{ height:240px; }
@media (max-width: 1100px){
  .analytics-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-kpi-strip{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
