:root {
  --harvest-orange: #2563eb;
  --harvest-orange-active: #1d4ed8;
  --harvest-green: #2563eb;
  --harvest-line: #e4e7ec;
  --harvest-bg: #f8fafc;
}

body {
  background: var(--harvest-bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 46px minmax(0, 1fr);
  min-height: 100vh;
  padding: 0;
}

.sidebar {
  align-items: stretch;
  background: var(--harvest-orange);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: row;
  gap: 0;
  height: 46px;
  justify-content: flex-start;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: #ffffff;
  gap: 0;
  padding: 0 20px;
}

.brand span {
  line-height: 1;
}

.brand strong {
  color: #dbeafe;
  line-height: 1;
}

.brand-mark {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  box-shadow: none;
  height: 28px;
  width: 28px;
}

.side-nav {
  display: flex;
  gap: 0;
}

.mobile-nav-panel {
  display: flex;
  flex: 1;
  min-width: 0;
}

.side-nav button {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: #ffffff;
  padding: 0 14px;
}

.side-nav button.active,
.side-nav button:hover {
  background: var(--harvest-orange-active);
  color: #ffffff;
}

.nav-icon,
.sidebar-section {
  display: none;
}

.logout-button {
  align-self: stretch;
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  box-shadow: none;
  color: #ffffff;
  margin-left: auto;
  padding: 0 18px;
}

.logout-button:hover {
  background: #1d4ed8;
  color: #ffffff;
}

.main-content {
  padding: 34px 10px 40px;
}

.view-stack,
.analytics-heading {
  margin: 0 auto;
  max-width: 1184px;
  width: 100%;
}

.page-heading {
  margin: 2px 0 -8px;
}

.page-heading h1 {
  font-size: 2rem;
}

.panel {
  border: 1px solid var(--harvest-line);
  border-radius: 4px;
  box-shadow: none;
  padding: 0;
}

.section-header {
  border-bottom: 1px solid var(--harvest-line);
  padding: 14px 16px;
}

.sidebar {
  background: #2563eb !important;
}

.side-nav button.active,
.side-nav button:hover {
  background: #1d4ed8 !important;
}

.metrics.overview-summary,
.analytics-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.overview-summary {
  gap: 10px;
}

.analytics-summary {
  gap: 10px;
}

.currency-summary:empty {
  display: none;
}

.metric {
  border: 1px solid var(--harvest-line);
  border-radius: 4px;
  box-shadow: none;
  min-height: 82px;
  padding: 14px 16px;
}

.metric span {
  margin-bottom: 0.42rem;
  text-transform: none;
}

.metric strong {
  font-size: 1.18rem;
  line-height: 1.18;
}

.overview-focus-grid {
  display: grid;
}

.insight-list {
  margin: 0;
  padding: 12px 16px 16px;
}

.insight-row {
  border-color: var(--harvest-line);
  border-radius: 4px;
  box-shadow: none;
}

.data-table {
  border-collapse: collapse;
  min-width: 840px;
}

.data-table th {
  background: #f1f5f9;
  color: #475467;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--harvest-line);
  padding: 0.72rem 0.68rem;
}

.change-breakdown-table {
  min-width: 760px;
}

.currency-lines {
  gap: 4px;
}

.currency-lines span {
  display: inline-flex;
  margin-right: 10px;
}

.data-table tbody tr:hover,
.data-table tbody tr.selected-row {
  background: #eff6ff;
}

.project-list-panel .section-header {
  background: #ffffff;
}

.project-list-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.table-action-button {
  background: #ffffff;
  border: 1px solid #cfcfca;
  color: #202124;
  padding: 0.38rem 0.72rem;
}

.table-action-button:hover {
  background: #f3f3f0;
  color: #202124;
}

.detail-back-button {
  justify-self: start;
  margin-bottom: -6px;
}

.project-header {
  align-items: center;
}

.project-header-actions {
  margin-left: auto;
}

.section-header .muted {
  margin-top: 8px;
}

.scope-timeline-layout {
  align-items: start;
}

.timeline-list {
  align-content: start;
  align-self: start;
  grid-auto-rows: max-content;
}

.timeline-item {
  align-self: start;
  gap: 8px;
  padding: 12px;
}

.timeline-card-top {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-card-top strong {
  font-size: 0.92rem;
}

.timeline-item small,
.timeline-item em {
  display: block;
}

.timeline-item em {
  color: #344054;
  font-weight: 750;
}

.timeline-detail {
  padding: 14px;
}

.timeline-detail-header {
  gap: 8px;
  margin-bottom: 12px;
}

.impact-grid {
  gap: 8px;
}

.impact-line {
  padding: 9px 10px;
}

.impact-line span,
.timeline-detail-section h4 {
  margin-bottom: 0.25rem;
}

.timeline-detail-section {
  margin-top: 12px;
  padding-top: 12px;
}

button {
  background: var(--harvest-green);
  border-radius: 6px;
  box-shadow: none;
}

button:hover {
  background: #1d4ed8;
}

button.secondary,
.segmented-control button {
  background: #ffffff;
  border: 1px solid #cfcfca;
  color: var(--ink);
}

.segmented-control {
  background: transparent;
  gap: 8px;
  padding: 0;
}

.segmented-control button.active {
  background: #f3f3f0;
  box-shadow: none;
}

.analytics-heading {
  padding-bottom: 0;
}

.analytics-filter-panel {
  justify-self: start;
  padding: 14px 16px;
  width: min(320px, 100%);
}

.analytics-filter-panel label {
  width: 100%;
}

.analytics-filter-panel select {
  min-width: 220px;
}

textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  padding: 0.72rem 0.78rem;
  resize: vertical;
  width: 100%;
}

.public-page {
  background: #f8fafc;
}

.public-shell {
  margin: 0 auto;
  max-width: 1040px;
  padding: 28px 20px 56px;
}

.public-nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 72px;
}

.public-brand {
  color: var(--ink);
  padding: 0;
}

.public-brand strong {
  color: #2563eb;
}

.public-wordmark {
  align-items: center;
  color: #2563eb;
  display: flex;
  gap: 8px;
  text-transform: uppercase;
}

.public-wordmark span {
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.public-wordmark strong {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  padding: 0;
}

.public-nav-link,
.primary-link,
.secondary-link {
  color: #1d4ed8;
  font-weight: 850;
  text-decoration: none;
}

.primary-link {
  background: #2563eb;
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  padding: 0.75rem 1rem;
}

.about-squilance-link {
  background: #ffffff;
  border: 1px solid var(--harvest-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  color: #1d4ed8;
  padding: 0.62rem 0.86rem;
}

.about-squilance-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.public-hero {
  display: grid;
  gap: 18px;
  max-width: 780px;
}

.public-hero h1 {
  font-size: clamp(2rem, 6vw, 4.25rem);
  letter-spacing: 0;
  line-height: 1;
}

.public-hero p {
  color: #475467;
  font-size: 1.05rem;
  line-height: 1.7;
}

.public-actions {
  margin-top: 10px;
}

.public-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 52px;
}

.public-grid article,
.login-card {
  background: #ffffff;
  border: 1px solid var(--harvest-line);
  border-radius: 8px;
  padding: 20px;
}

.public-grid p {
  color: #475467;
  line-height: 1.55;
  margin-top: 10px;
}

.login-shell {
  max-width: 520px;
}

.login-card {
  display: grid;
  gap: 24px;
}

.access-request-form {
  border-top: 1px solid var(--harvest-line);
  display: grid;
  gap: 16px;
  padding-top: 22px;
}

.full-width-button {
  width: 100%;
}

.login-intro {
  display: grid;
  gap: 12px;
}

.form-error {
  color: #b42318;
  font-weight: 750;
}

.success-message {
  color: #027a48;
  font-weight: 750;
  padding: 0 16px 16px;
}

.feedback-form {
  padding: 18px 16px;
}

@media (max-width: 1023px) {
  .app-shell {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  body .app-shell {
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .sidebar {
    display: flex;
    height: 64px;
  }

  body .sidebar {
    height: 64px;
  }

  .brand {
    min-height: 64px;
    min-width: 0;
  }

  .brand > div {
    gap: 5px;
  }

  .mobile-nav-panel {
    align-items: stretch;
    background: #0f2f6f;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    bottom: 0;
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.2);
    box-sizing: content-box;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 64px;
    left: 0;
    padding-bottom: env(safe-area-inset-bottom);
    position: fixed;
    right: 0;
    top: auto;
    width: 100%;
    z-index: 1000;
  }

  body .side-nav {
    display: contents;
  }

  body .mobile-nav-panel button,
  body .mobile-nav-panel .logout-button {
    align-items: center;
    align-self: stretch;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.74) !important;
    display: flex;
    flex-direction: column;
    font-size: 0.68rem;
    font-weight: 750;
    gap: 4px;
    justify-content: center;
    letter-spacing: 0;
    line-height: 1;
    margin: 0;
    min-height: 64px;
    min-width: 0;
    padding: 7px 2px 8px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
  }

  body .mobile-nav-panel button.active,
  body .mobile-nav-panel button:hover,
  body .mobile-nav-panel .logout-button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
  }

  body .mobile-nav-panel .nav-icon {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: currentColor;
    display: inline-flex;
    height: 21px;
    margin: 0;
    padding: 0;
    width: 21px;
  }

  body .mobile-nav-panel .nav-icon svg {
    display: block;
    fill: none;
    height: 100%;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 100%;
  }

  body .main-content {
    padding-bottom: calc(98px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 760px) {
  .metrics.overview-summary,
  .analytics-summary {
    grid-template-columns: 1fr !important;
  }

  body .main-content {
    padding: 14px 10px calc(98px + env(safe-area-inset-bottom));
  }

  .page-heading h1 {
    font-size: 1.55rem;
  }

  .page-heading {
    align-self: start;
    min-height: 0;
  }

  .view-stack {
    align-content: start;
    grid-auto-rows: max-content;
    row-gap: 10px;
  }

  #projectsPageHeading {
    margin-bottom: 6px;
  }

  .project-list-actions {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 10px;
  }

  .project-list-actions #openProjectModal {
    flex: 0 1 auto;
    min-height: 38px;
    white-space: nowrap;
    width: auto;
  }

  .project-list-actions .segmented-control {
    margin-left: auto;
  }

  .project-list-actions .segmented-control button {
    min-height: 38px;
    padding: 0.4rem 0.62rem;
    width: auto;
  }

  .section-header,
  .project-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-header-actions {
    margin-left: 0;
    width: 100%;
  }

  .project-header-actions button,
  .project-header-actions label,
  .project-header-actions select {
    width: 100%;
  }

  .section-header.project-list-actions {
    align-items: center;
    flex-direction: row;
  }

  .scope-timeline-layout,
  .two-col,
  .three-col,
  .dynamic-form-grid {
    grid-template-columns: 1fr;
  }

  .timeline-detail {
    min-width: 0;
  }

  .tabs {
    gap: 10px;
    overflow-x: auto;
  }

  .modal {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    width: min(94vw, 680px);
  }

  .public-nav {
    margin-bottom: 44px;
  }

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