/* ==========================================================================
   OSS Enviro – Client Portal (static)
   Font: Onest | Brand: cyan #14C3C9 on deep teal-navy
   ========================================================================== */

:root {
  /* Brand */
  --brand-cyan: #14c3c9;
  --brand-cyan-dark: #0ba7ad;
  --brand-navy: #0d2b33;
  --brand-navy-2: #123641;
  --brand-teal: #35737d;

  /* Text */
  --text-heading: #123642;
  --text-body: #3d5560;
  --text-muted: #7b909a;
  --text-label: #14808f;

  /* Surfaces */
  --bg-page: #f3f6f7;
  --bg-card: #ffffff;
  --border: #e2e9ec;
  --border-strong: #d3dde1;

  /* Status */
  --green: #1dbf63;
  --green-dark: #17a856;
  --red: #ef3b4a;

  /* Layout */
  --sidebar-w: 232px;
  --content-w: 900px;

  --radius: 10px;
  --radius-sm: 8px;
  --shadow-card:
    0 1px 3px rgba(13, 43, 51, 0.06), 0 1px 2px rgba(13, 43, 51, 0.04);
  --shadow-fab: 0 4px 14px rgba(13, 43, 51, 0.18);

  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-cyan-dark);
}

h1,
h2,
h3,
h4 {
  color: var(--text-heading);
  font-weight: 700;
  margin: 0;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 40;
}

.sidebar-top {
  padding: 20px 14px;
}

.sidebar-logo {
  display: block;
  padding: 2px 6px 18px;
  text-decoration: none;
}

.sidebar-logo img {
  height: 30px;
  width: auto;
}

/* Text fallback shown if no logo image is supplied */
.logo-fallback {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0.5px;
  color: var(--brand-cyan);
}
.logo-fallback em {
  font-style: normal;
  font-weight: 500;
  color: var(--brand-cyan);
  margin-left: 5px;
  letter-spacing: 2px;
  font-size: 18px;
}
.logo-fallback .logo-x {
  font-size: 26px;
  margin-right: 2px;
}
.logo-fallback--light,
.logo-fallback--light em {
  color: #ffffff;
}
.logo-fallback--light .logo-x {
  color: var(--brand-cyan);
}

.org-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 22px;
}

.org-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-heading);
}
.org-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  position: relative;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-item:hover {
  background: #eef4f5;
  color: var(--text-heading);
}
.nav-item:hover svg {
  color: var(--brand-cyan-dark);
}

.nav-item.is-active {
  background: #eef4f5;
  color: var(--text-heading);
  font-weight: 600;
}
.nav-item.is-active svg {
  color: var(--brand-navy);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-navy);
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-cyan);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-heading);
}
.user-email {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.user-menu-btn svg {
  width: 16px;
  height: 16px;
}
.user-menu-btn:hover {
  background: #eef4f5;
}

/* ==========================================================================
   Main / Hero
   ========================================================================== */

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.report-hero {
  position: relative;
  color: #fff;
  /* Replace images/hero-bg.jpg with your own header photo */
  background:
    linear-gradient(
      100deg,
      rgba(10, 32, 40, 0.94) 0%,
      rgba(10, 32, 40, 0.78) 45%,
      rgba(10, 32, 40, 0.55) 100%
    ),
    url("../images/hero-bg.jpg") center / cover no-repeat,
    var(--brand-navy);
  padding: 26px 40px 34px;
}

.hero-inner {
  max-width: var(--content-w);
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 26px;
  transition: color 0.15s ease;
}
.back-link svg {
  width: 15px;
  height: 15px;
}
.back-link:hover {
  color: #fff;
}

.hero-brand {
  margin-bottom: 16px;
}
.hero-brand img {
  height: 40px;
  width: auto;
}

.hero-title {
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-permit {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
}

.hero-desc {
  margin: 0 0 16px;
  max-width: 670px;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 34px;
  margin: 0 0 20px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
}
.hero-meta strong {
  color: #fff;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-acknowledge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}
.btn-acknowledge svg {
  width: 16px;
  height: 16px;
}
.btn-acknowledge:hover {
  background: var(--green-dark);
}
.btn-acknowledge:active {
  transform: scale(0.98);
}

.acknowledge-hint {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================================
   Report body
   ========================================================================== */

.report-body {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 44px 20px 90px;
}

.report-section {
  margin-bottom: 40px;
}

/* Section heading with the short cyan underline */
.section-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  padding-bottom: 9px;
  margin-bottom: 18px;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand-cyan);
}

.section-title--inline {
  padding-bottom: 9px;
  margin-bottom: 0;
}

/* --- Project details card --- */

.details-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 24px 6px;
  margin-bottom: 40px;
}

.details-table {
  margin: 6px 0 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 13px 2px;
  border-top: 1px solid var(--border);
}
.detail-row:first-child {
  border-top: none;
}

.detail-row dt {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-label);
}

.detail-row dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-body);
}

.detail-row ul {
  margin: 0;
  padding-left: 18px;
}
.detail-row li {
  margin-bottom: 4px;
}
.detail-row li:last-child {
  margin-bottom: 0;
}

/* --- Text cards (exec summary, comments) --- */

.text-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
}
.text-card p {
  margin: 0;
}
.text-card p + p {
  margin-top: 12px;
}

/* --- Signature --- */

.signature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.signature-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 22px 12px;
  min-width: 150px;
  text-align: center;
}
.signature-card img {
  height: 46px;
  width: auto;
  margin: 0 auto 8px;
}
.signature-card figcaption {
  font-size: 13.5px;
  color: var(--text-body);
}

.signature-placeholder {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  margin-bottom: 8px;
}

/* --- Outline button (download spreadsheet) --- */

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.btn-outline svg {
  width: 15px;
  height: 15px;
  color: var(--brand-cyan-dark);
}
.btn-outline:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan-dark);
}

/* ==========================================================================
   Accordion
   ========================================================================== */

.accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.accordion-heading {
  margin: 0;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-teal);
  text-align: left;
  padding: 17px 22px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.accordion-trigger:hover {
  color: var(--brand-cyan-dark);
}

.accordion-trigger--titled {
  padding: 17px 22px 8px;
  align-items: flex-start;
}
.accordion-trigger--titled .accordion-chevron {
  margin-top: 4px;
}

.accordion-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-heading);
  transition: transform 0.25s ease;
}

.accordion-item.is-open > .accordion-heading .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-panel {
  overflow: hidden;
}

.accordion-content {
  padding: 2px 22px 22px;
}

.location-comments {
  margin: 0 0 14px;
}
.location-comments:last-child {
  margin-bottom: 0;
}

/* Media inside accordions */

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

.media-thumb {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eef1f2;
  aspect-ratio: 4 / 3;
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.media-thumb:hover img {
  transform: scale(1.03);
}

/* Loose images dropped straight into an accordion (no .media-thumb wrapper)
   still get sensible bounds instead of overflowing or collapsing. */
.accordion-content img:not(.media-thumb img):not(.signature-card img) {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(
    45deg,
    #eef1f2,
    #eef1f2 10px,
    #e5eaec 10px,
    #e5eaec 20px
  );
}

/* Files */

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color 0.15s ease;
}
.file-link:hover {
  border-color: var(--brand-cyan);
}

.file-dl {
  background: var(--brand-cyan);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

/* ==========================================================================
   Questions & comments
   ========================================================================== */

.comments-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px;
}

.comments-empty {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.comment-composer textarea {
  width: 100%;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-body);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 84px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.comment-composer textarea::placeholder {
  color: var(--text-muted);
}
.comment-composer textarea:focus {
  outline: none;
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(20, 195, 201, 0.15);
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-post {
  background: var(--brand-cyan);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    opacity 0.15s ease;
}
.btn-post:hover:not(:disabled) {
  background: var(--brand-cyan-dark);
}
.btn-post:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   Floating action buttons
   ========================================================================== */

.floating-actions {
  position: fixed;
  right: 26px;
  bottom: 30px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  z-index: 30;
}

/* Tooltips ----------------------------------------------------------------
   Right-aligned to the button group so they never run off-screen; the little
   arrow is positioned per-button via the --arrow-right variable set inline. */

.fab-tip {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: max-content;
  max-width: 240px;
  background: var(--brand-navy);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-fab);

  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s;
  pointer-events: none;
}

.fab-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: calc(var(--arrow-right, 22px) - 6px);
  border: 6px solid transparent;
  border-top-color: var(--brand-navy);
}

.fab-tip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-fab);
  transition:
    transform 0.12s ease,
    filter 0.15s ease;
}
.fab svg {
  width: 19px;
  height: 19px;
}
.fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.fab--ghost {
  background: #fff;
  color: var(--text-heading);
}
.fab--dark {
  background: var(--brand-navy);
  color: #fff;
}
.fab--brand {
  background: var(--brand-cyan);
  color: #fff;
}

/* ==========================================================================
   Focus & motion
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .floating-actions {
    top: auto;
    bottom: 22px;
    transform: none;
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
  }

  .main {
    margin-left: 0;
  }

  .report-hero {
    padding: 22px 20px 28px;
  }
  .hero-title {
    font-size: 27px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 12px 2px;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .sidebar,
  .floating-actions,
  .btn-acknowledge,
  .acknowledge-hint,
  .back-link,
  .comment-composer {
    display: none !important;
  }

  .main {
    margin-left: 0;
  }

  .report-hero {
    background: var(--brand-navy) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .accordion-panel[hidden] {
    display: block !important;
  }

  .accordion-item,
  .details-card,
  .text-card {
    box-shadow: none;
  }
}

/* ==========================================================================
   Portal pages (Dashboard, Reports, Request Inspection, Team, Notifications)
   ========================================================================== */

.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 34px 34px 70px;
}

/* --- Page headers --- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.page-header--stack {
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.page-title--brand {
  color: #1899a4;
}

.page-sub {
  margin: 3px 0 0;
  font-size: 14.5px;
  color: var(--text-muted);
}
.page-sub strong {
  color: var(--text-heading);
}
.page-sub--strong {
  color: var(--text-heading);
  font-weight: 700;
}

.page-intro {
  max-width: 640px;
  line-height: 1.65;
  color: var(--text-body);
}
.page-intro a {
  color: var(--brand-cyan);
  font-weight: 600;
  text-decoration: none;
}
.page-intro a:hover {
  text-decoration: underline;
}

/* --- Generic cards --- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  margin-bottom: 24px;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head--padded {
  padding: 22px 24px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.card-head--icon {
  align-items: center;
}
.card-head-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(20, 195, 201, 0.12);
  color: var(--brand-cyan-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-head-icon svg {
  width: 19px;
  height: 19px;
}
.card-head--icon > div {
  flex: 1;
}

.card-title {
  font-size: 18.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.card-title--brand {
  color: #1899a4;
}
.card-title--icon {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card-title--icon svg {
  width: 19px;
  height: 19px;
  color: var(--brand-cyan);
}

.card-sub {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}
.card-sub--strong {
  color: var(--text-heading);
  font-weight: 700;
}
.card-sub strong {
  color: var(--text-heading);
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-cyan);
  text-decoration: none;
  white-space: nowrap;
  margin-top: 4px;
}
.link-more svg {
  width: 15px;
  height: 15px;
}
.link-more:hover {
  color: var(--brand-cyan-dark);
}

.section-plain {
  margin-bottom: 24px;
}
.section-plain .card-sub {
  margin-bottom: 16px;
}

/* --- Pills & badges --- */

.pill-online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #e9f9ef;
  border: 1px solid #c4eed3;
  color: #178a4c;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
}
.pill-online .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.pill-total {
  background: rgba(20, 195, 201, 0.12);
  color: #1899a4;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-published {
  background: rgba(29, 191, 99, 0.18);
  border: 1px solid rgba(29, 191, 99, 0.45);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
}

.badge-completed {
  background: #e9f9ef;
  border: 1px solid #c4eed3;
  color: #178a4c;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-role {
  background: #eef1f3;
  border: 1px solid var(--border-strong);
  color: var(--text-body);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  vertical-align: 2px;
}
.badge-role--owner {
  background: #f5ecfd;
  border-color: #e2ccf7;
  color: #9333ea;
}

/* --- Client banner (dashboard) --- */

.client-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}
.client-banner-logo {
  height: 44px;
  width: auto;
}
.img-placeholder--logo {
  width: 170px;
  height: 44px;
}
.client-banner-contact {
  margin: 0;
  font-size: 14px;
  color: var(--text-body);
}
.client-banner-contact a {
  color: var(--brand-cyan);
  font-weight: 600;
  text-decoration: none;
}
.client-banner-contact a:hover {
  text-decoration: underline;
}

/* --- Stat cards --- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: -22px;
  right: -22px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(20, 195, 201, 0.1);
}
.stat-card--plain::after {
  display: none;
}
.stat-card--plain {
  align-items: flex-start;
}

.stat-icon {
  color: var(--brand-cyan);
  margin-bottom: 12px;
}

.stat-icon svg,
.stat-icon img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.stat-value {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #14b0b6;
  line-height: 1.1;
}
.stat-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* --- Charts row --- */

.chart-row {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
.chart-row .card {
  margin-bottom: 0;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 8px;
  height: 250px;
  padding-top: 10px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.bar {
  width: 62%;
  max-width: 76px;
  height: var(--h, 2%);
  background: #dfe7ea;
  border-radius: 5px 5px 0 0;
}
.bar--filled {
  background: #23b8c4;
}

.bar-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
}
.bar-x {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  margin-top: 4px;
}

/* Donut */

.chart-card--donut {
  display: flex;
  flex-direction: column;
}

.donut {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
  flex: 1;
  align-items: center;
}

.donut-ring {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(#23b8c4 0deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-center {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1;
}
.donut-cap {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.donut-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-body);
  padding-top: 10px;
}
.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #23b8c4;
}
.legend-val {
  color: var(--text-muted);
}

/* --- Report cards (dark) --- */

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr));
  gap: 22px;
  max-width: 962px;
}
.report-grid--wide {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 470px));
}

.report-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  color: #fff;
  padding: 18px 20px 0;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  /* Replace images/report-card-bg.jpg with your card background photo */
  background:
    linear-gradient(
      160deg,
      rgba(9, 28, 36, 0.9) 0%,
      rgba(9, 28, 36, 0.82) 60%,
      rgba(9, 28, 36, 0.72) 100%
    ),
    url("../images/hero-bg.jpg") center / cover no-repeat,
    #0b2530;
  box-shadow: 0 4px 16px rgba(13, 43, 51, 0.22);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.report-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--brand-cyan);
}
.report-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(13, 43, 51, 0.3);
}

.report-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 10px 0 16px;
}

.report-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.report-card-icon svg {
  width: 20px;
  height: 20px;
}

.report-card-title {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: 14px;
}

.report-card-meta {
  list-style: none;
  margin: auto 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.report-card-meta li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.88);
}
.report-card-meta svg {
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.report-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 13px 0 15px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.report-card-footer a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  transition:
    color 0.15s ease,
    gap 0.15s ease;
}
.report-card-footer a svg {
  width: 15px;
  height: 15px;
}
.report-card-footer a:hover {
  color: #c7d2fe;
  gap: 10px;
}

/* --- Pagination --- */

.pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}
.pagination--card {
  margin-top: 0;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

.page-size select {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
}
.page-count {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* --- Upcoming jobs --- */

.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.job-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}

.job-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff4e0;
  color: #f59e0b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.job-icon svg {
  width: 18px;
  height: 18px;
}

.job-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}
.job-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-heading);
}
.job-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- Quick links --- */

.quicklink-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.quicklink {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    transform 0.12s ease;
}
.quicklink:hover {
  border-color: var(--brand-cyan);
  transform: translateY(-2px);
}

.quicklink-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(20, 195, 201, 0.12);
  color: var(--brand-cyan-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quicklink-icon svg {
  width: 19px;
  height: 19px;
}
.quicklink-icon--purple {
  background: #f1ecfd;
  color: #7c5cf0;
}

.quicklink-title {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-heading);
}
.quicklink-sub {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* --- Buttons --- */

.btn-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-cyan);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-brand svg {
  width: 15px;
  height: 15px;
}
.btn-brand:hover {
  background: var(--brand-cyan-dark);
}

.btn-ghost-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--brand-cyan);
  border: 1px solid rgba(20, 195, 201, 0.5);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.btn-ghost-brand svg {
  width: 16px;
  height: 16px;
}
.btn-ghost-brand:hover {
  background: rgba(20, 195, 201, 0.07);
  border-color: var(--brand-cyan);
}

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  color: var(--text-heading);
  border: 1px solid var(--border-strong);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.btn-small svg {
  width: 13px;
  height: 13px;
}
.btn-small:hover {
  border-color: var(--brand-cyan);
}

.btn-small--danger {
  color: var(--red);
  border-color: #f6c6ca;
}
.btn-small--danger:hover {
  border-color: var(--red);
  background: #fef2f3;
}

.btn-submit {
  display: block;
  width: 100%;
  background: var(--brand-cyan);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-submit:hover {
  background: var(--brand-cyan-dark);
}

/* --- Team --- */

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 24px;
  border-top: 1px solid var(--border);
}
.member-row:first-child {
  border-top: none;
}

.member-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.member-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.member-you {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}
.member-email {
  font-size: 13px;
  color: var(--text-muted);
}

.member-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.perm-list li {
  font-size: 14px;
  color: var(--text-body);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.perm-list .badge-role {
  flex-shrink: 0;
}

/* --- Notifications --- */

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}
.notif-row:first-child {
  border-top: none;
}
.notif-row:hover {
  background: #f7fafb;
}
.notif-row.is-unread {
  background: #f0f6fd;
}
.notif-row.is-unread:hover {
  background: #e9f2fb;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  margin: 7px 8px 0 0;
  flex-shrink: 0;
}
.notif-row.is-unread .notif-dot {
  background: var(--brand-cyan);
}

.notif-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-heading);
}
.notif-snippet {
  font-size: 13px;
  color: var(--text-body);
}
.notif-date {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Forms (Request Inspection) --- */

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 26px;
}

.form-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 20px;
}
.form-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--brand-cyan);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-field--full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-heading);
}
.form-field .req {
  color: var(--red);
}

.input-wrap {
  position: relative;
}
.input-wrap > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-body);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px 11px 38px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.input-wrap--plain input,
.input-wrap--plain select,
.input-wrap--plain textarea {
  padding-left: 14px;
}

.input-wrap textarea {
  resize: vertical;
  min-height: 120px;
}

.input-wrap select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b909a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
.input-wrap select:invalid {
  color: var(--text-muted);
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder {
  color: var(--text-muted);
}

.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
  outline: none;
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(20, 195, 201, 0.15);
}

/* --- Responsive for portal pages --- */

@media (max-width: 1020px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chart-row {
    grid-template-columns: 1fr;
  }
  .quicklink-grid {
    grid-template-columns: 1fr;
  }
  .report-grid--wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 22px 16px 60px;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .member-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .report-grid {
    max-width: none;
  }
}

/* ==========================================================================
   Emissions readings (inside accordion items)
   ========================================================================== */

.emissions-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.emissions-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
}

.emissions-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 13px 20px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, #2bc4cb 0%, #23a9b4 45%, #2c7c88 100%);
}
.emissions-group-head svg {
  width: 17px;
  height: 17px;
  opacity: 0.9;
  flex-shrink: 0;
}

.emissions-group-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.metric {
  background: #f7f9fa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px 17px 17px;
}

.metric-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  margin: 0 0 12px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: #21b5bd;
}
.metric-value--max {
  color: #e8792a;
}
.metric-value--rate {
  color: var(--text-heading);
}

.metric-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.metric-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e3eaec;
  overflow: hidden;
}

.metric-fill {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  border-radius: 999px;
}
.metric-fill--mean {
  background: linear-gradient(90deg, #3fc9cf, #57d3d0);
}
.metric-fill--max {
  background: linear-gradient(90deg, #e2661f, #f0a93a);
}
.metric-fill--rate {
  background: linear-gradient(90deg, #1f5f6b, #35c3c9);
}

/* ==========================================================================
   Inline tooltips (buttons outside the floating group)
   ========================================================================== */

.tip-host {
  position: relative;
  display: inline-block;
}

.tip-above-left {
  left: 0;
  right: auto;
  bottom: calc(100% + 12px);
}
.tip-above-left::after {
  right: auto;
  left: 26px;
}

@media (max-width: 640px) {
  .emissions-group-body {
    padding: 14px;
  }
  .metric-value {
    font-size: 23px;
  }
}

/* ==========================================================================
   Captioned image grid (accordion media)
   Images keep their natural proportions — nothing is cropped — and the
   caption sits beneath the frame rather than inside it.
   ========================================================================== */

.media-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 22px 0 14px;
}

.media-grid--captioned {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 26px 30px;
  align-items: start;
}

.media-figure {
  margin: 0;
}

.media-frame {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eef1f2;
  line-height: 0;
  transition: box-shadow 0.15s ease;
}

.media-frame img {
  width: 100%;
  height: auto; /* natural aspect ratio, never cropped */
  display: block;
  transition: transform 0.25s ease;
}

.media-frame:hover {
  box-shadow: 0 4px 14px rgba(13, 43, 51, 0.16);
}

.media-frame:hover img {
  transform: scale(1.02);
}

.media-figure figcaption {
  margin-top: 11px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-body);
}

@media (max-width: 640px) {
  .media-grid--captioned {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}
