:root {
  --olive: #394438;
  --olive-2: #4b5748;
  --sand: #d8cbb5;
  --terra: #a65f45;
  --char: #252724;
  --bone: #f3efe6;
  --white: #fffdf8;
  --line: rgba(37,39,36,.13);
  --muted: #6b6e67;
  --shadow: 0 18px 45px rgba(37,39,36,.08);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease-premium: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; }

html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--char);
  font-family: var(--sans);
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

.app-shell {
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 236px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  background: var(--olive);
  color: var(--white);
  border-right: 1px solid rgba(255,255,255,.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .02em;
}

.mark {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 36px;
}

.mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.workspace-label {
  margin: 48px 12px 12px;
  color: rgba(255,255,255,.38);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .2em;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 3px;
  padding: 12px 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  color: rgba(255,255,255,.68);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  transition:
    background-color 220ms ease,
    color 220ms ease,
    transform 220ms var(--ease-premium);
}

.nav-item[hidden] {
  display: none !important;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
}

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

.nav-item:hover,
.nav-item.active {
  background: rgba(255,255,255,.10);
  color: var(--white);
}

.nav-item:hover {
  transform: translateX(2px);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid rgba(255,255,255,.11);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  background: var(--sand);
  color: var(--olive);
  font-size: 10px;
  font-weight: 800;
}

.admin-identity {
  min-width: 0;
  font-size: 11px;
}

.admin-identity strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-identity small {
  display: block;
  margin-top: 1px;
  color: rgba(255,255,255,.43);
  font-size: 9px;
}

.logout-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.55);
  padding: 4px;
  cursor: pointer;
  font-size: 9px;
}

.logout-btn:hover {
  color: var(--white);
}

/* Main */
.main {
  margin-left: 236px;
  width: calc(100% - 236px);
  max-width: 1580px;
  padding: 46px clamp(26px,4vw,64px) 70px;
}

.admin-view[hidden] {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.crumb,
.section-kicker {
  color: var(--terra);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 5px 0;
  font-family: var(--serif);
  font-weight: 400;
}

h1 {
  font-size: clamp(40px,4vw,54px);
  line-height: .98;
  letter-spacing: -.035em;
}

h2 {
  font-size: 34px;
  line-height: 1;
}

h3 {
  font-size: 23px;
  line-height: 1.1;
}

.primary-btn,
.dark-btn,
.copy-btn,
.light-btn,
.text-btn,
.upload-btn,
.estimate-create-project-btn {
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 750;
  transition:
    transform 220ms var(--ease-premium),
    background-color 220ms ease,
    color 220ms ease,
    border-color 220ms ease;
}

.primary-btn,
.dark-btn,
.estimate-create-project-btn {
  background: var(--olive);
  color: var(--white);
}

.primary-btn {
  padding: 12px 17px;
}

.primary-btn:hover,
.dark-btn:hover,
.estimate-create-project-btn:hover {
  background: var(--olive-2);
  transform: translateY(-.08rem);
}

.light-btn,
.upload-btn {
  background: var(--bone);
  color: var(--olive);
  border: 1px solid var(--line);
}

.light-btn:hover,
.upload-btn:hover {
  background: var(--white);
  border-color: rgba(57,68,56,.24);
}

.text-btn {
  background: transparent;
  color: var(--terra);
  padding: 0;
  font-size: 11px;
}

.text-btn:hover {
  color: #8c4e38;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: var(--bone);
  border: 1px solid var(--line);
  padding: 18px 19px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 5px;
  font: 400 31px/1 var(--serif);
}

/* Project cards */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px,1fr));
  gap: 14px;
}

.customer-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
  cursor: pointer;
  transition:
    transform 260ms var(--ease-premium),
    box-shadow 260ms var(--ease-premium),
    border-color 260ms ease;
}

.customer-card:hover {
  transform: translateY(-.18rem);
  border-color: rgba(57,68,56,.22);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.customer-card h3 {
  margin: 6px 0 4px;
  font-size: 25px;
}

.address {
  color: var(--muted);
  font-size: 11px;
}

.status-pill {
  display: inline-block;
  padding: 5px 7px;
  background: transparent;
  color: var(--olive);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
  white-space: nowrap;
}

.status-pill.waiting {
  background: transparent;
  color: var(--terra);
}

.card-progress {
  margin: 26px 0 16px;
}

.progress-line {
  height: 4px;
  overflow: hidden;
  background: #e6e2d9;
}

.progress-line i {
  display: block;
  height: 100%;
  background: var(--terra);
}

.progress-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.progress-meta strong {
  color: var(--char);
}

.card-foot {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 10px;
}

.card-foot span {
  color: var(--muted);
}

.card-foot strong {
  font-weight: 700;
}

.card-arrow {
  align-self: end;
  color: var(--terra);
  font-weight: 700;
}

/* Messages */
.dashboard-message {
  min-height: 0;
  margin-bottom: 14px;
  font-size: 11px;
}

.dashboard-message.error {
  padding: 12px 14px;
  background: #f4e5df;
  border: 1px solid rgba(166,95,69,.24);
  color: #7d3f2e;
}

.loading-card,
.empty-state {
  grid-column: 1 / -1;
  padding: 44px;
  background: var(--bone);
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--char);
  font: 400 28px var(--serif);
}

/* Overlay / drawer */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(25,28,25,.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  width: min(720px,100vw);
  height: 100vh;
  background: var(--white);
  box-shadow: -24px 0 60px rgba(0,0,0,.14);
  transform: translateX(100%);
  transition: transform 420ms var(--ease-premium);
}

.drawer.open {
  transform: none;
}

.drawer-head {
  padding: 27px 30px 22px;
  background: var(--olive);
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.drawer-head .crumb {
  color: var(--sand);
}

.drawer-head p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.58);
  font-size: 11px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 28px;
}

.drawer-scroll {
  height: calc(100% - 105px);
  overflow-y: auto;
  padding: 24px 30px 34px;
  scrollbar-width: none;
}

.drawer-scroll::-webkit-scrollbar {
  width: 0;
}

.project-summary {
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--bone);
  border: 1px solid var(--line);
}

.progress-ring {
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--terra) var(--progress), rgba(57,68,56,.10) 0);
}

.progress-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--bone);
}

.progress-ring > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.progress-ring strong {
  display: block;
  font: 400 27px var(--serif);
}

.progress-ring span {
  color: var(--muted);
  font-size: 8px;
}

.summary-copy .status-pill {
  margin-bottom: 8px;
}

.summary-copy > strong {
  display: block;
  font: 400 22px var(--serif);
}

.summary-copy > span:last-child {
  color: var(--muted);
  font-size: 9px;
}

/* Drawer sections */
.panel-section {
  margin-top: 14px;
  padding: 21px;
  background: var(--white);
  border: 1px solid var(--line);
}

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

.section-head h3 {
  margin: 3px 0 0;
}

.timeline-editor {
  margin: 2px 0 18px;
  padding: 14px;
  background: var(--bone);
  border: 1px solid var(--line);
}

.timeline-editor > label,
.field label,
.created-link-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.timeline-edit-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
}

.timeline-edit-row input,
.panel-section textarea,
.field input,
.field textarea,
.referral-link-box input,
.referral-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bone);
  color: var(--char);
  padding: 11px 12px;
  outline: none;
}

.timeline-edit-row input:focus,
.panel-section textarea:focus,
.field input:focus,
.field textarea:focus,
.referral-link-box input:focus {
  border-color: var(--terra);
}

.inline-save-state,
.field-help,
.security-note {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.project-notes-copy {
  min-height: 4.5rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  background: var(--bone);
  color: var(--char);
  font-size: 0.72rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.project-notes-copy.empty {
  color: var(--muted);
  font-style: italic;
}

.project-note-label,
.task-composer > label {
  display: block;
  margin: 0.9rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.task-composer[hidden] {
  display: none;
}

.task-composer {
  margin-bottom: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: var(--bone);
}

.task-composer > label {
  margin-top: 0;
}

.task-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
}

.task-composer-row input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  background: var(--white);
  color: var(--char);
  padding: 0.7rem 0.75rem;
  outline: none;
}

.task-composer-row input:focus {
  border-color: var(--terra);
}

/* Tasks */
.task-list {
  display: flex;
  flex-direction: column;
}

.task {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) 112px 62px;
  gap: 10px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.task:first-child {
  border-top: 0;
  padding-top: 4px;
}

.task-check {
  width: 20px;
  height: 20px;
  border: 1px solid #bbb8ae;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--white);
  cursor: pointer;
  font-size: 10px;
}

.task.complete .task-check {
  background: var(--olive);
  border-color: var(--olive);
}

.task.in-progress .task-check {
  border: 5px solid var(--terra);
}

.task-copy {
  min-width: 0;
}

.task-title {
  font-size: 12px;
  font-weight: 700;
}

.task-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-progress input {
  width: 100%;
}

.task-percent {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.task-actions button {
  border: 0;
  background: transparent;
  color: #99968f;
  cursor: pointer;
  padding: 4px;
  font-size: 10px;
}

.task-actions button:hover {
  color: var(--terra);
}

.task-order-btn:disabled {
  opacity: .28;
  cursor: default;
}

.task-empty {
  padding: 14px 0;
  color: var(--muted);
  font-size: 10px;
}

.task-publish-bar {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
}

.task-publish-bar > span {
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.5;
}

.task-publish-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
}

/* Updates */
.panel-section textarea {
  min-height: 110px;
  resize: vertical;
}

.update-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.update-foot span {
  color: var(--muted);
  font-size: 9px;
}

.dark-btn {
  padding: 9px 12px;
  font-size: 10px;
}

/* Photos */
.upload-btn {
  padding: 8px 10px;
  font-size: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: .5rem;
}

.photo {
  margin: 0;
  aspect-ratio: 1.25;
  overflow: hidden;
  position: relative;
  background: #ddd;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo button {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 7px 6px;
  background: linear-gradient(transparent,rgba(0,0,0,.62));
  color: var(--white);
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

@media (max-width: 42rem) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-photo-stage {
    width: min(100%, calc(100vw - 4rem));
  }

  .admin-photo-prev {
    left: .5rem;
  }

  .admin-photo-next {
    right: .5rem;
  }
}

/* Referral */
.referral-panel {
  display: block;
}

.referral-copy {
  margin-bottom: 15px;
}

.referral-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.referral-link-box {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
}

.copy-btn {
  background: var(--terra);
  color: var(--white);
  padding: 0 13px;
}

.referral-meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.referral-help {
  max-width: 370px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.referral-regenerate-btn {
  flex: 0 0 auto;
}

.referral-unavailable {
  width: 100%;
  padding: 10px 11px;
  background: var(--bone);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

/* Lifecycle */
.lifecycle-copy {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.lifecycle-panel.ready-to-archive {
  border-color: rgba(57,68,56,.24);
  background: #f7f8f3;
}

.lifecycle-panel.ready-to-archive .section-kicker,
.lifecycle-panel.ready-to-archive #lifecycleTitle {
  color: var(--olive);
}

/* Estimate Requests */
.estimate-stats {
  grid-template-columns: repeat(3,1fr);
}

.estimate-list,
.archive-list {
  display: grid;
  gap: 12px;
}

.archive-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.archive-topbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.archive-filters label {
  display: grid;
  gap: 6px;
}

.archive-filters label > span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.archive-filters select {
  min-width: 150px;
  padding: 9px 34px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--bone);
  color: var(--char);
  font: 750 10px var(--sans);
  cursor: pointer;
}

.estimate-card,
.archive-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
}

.estimate-card:hover,
.archive-card:hover {
  border-color: rgba(57,68,56,.22);
}

.estimate-card-head,
.archive-card-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.estimate-card h3,
.archive-card h3 {
  margin: 4px 0 3px;
  font-size: 25px;
}

.estimate-requested-at,
.archive-kind {
  color: var(--muted);
  font-size: 9px;
}

.estimate-status {
  display: inline-block;
  margin-top: 7px;
  padding: 5px 7px;
  background: #efe5da;
  color: var(--terra);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.estimate-status.contacted {
  background: #e7ede3;
  color: var(--olive);
}

.notification-status {
  display: inline-block;
  margin: 7px 0 0 6px;
  padding: 5px 7px;
  background: #edf0eb;
  color: var(--olive);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.notification-status.sending {
  background: #f2eee5;
  color: #74623f;
}

.notification-status.failed,
.notification-status.unconfigured {
  background: #f5e2df;
  color: #9b3f32;
}

.estimate-card.deep-link-highlight {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(166, 91, 65, .15);
}

.estimate-details {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.estimate-detail span,
.archive-half span {
  display: block;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.estimate-detail strong,
.estimate-detail a {
  display: block;
  margin-top: 4px;
  color: var(--char);
  font-size: 11px;
  word-break: break-word;
}

.estimate-description {
  margin-top: 17px;
  padding: 14px;
  background: var(--bone);
  color: #4e514b;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.estimate-photo-section {
  margin-top: 1rem;
}

.estimate-photo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .65rem;
}

.estimate-photo-heading span {
  color: var(--muted);
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.estimate-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 7.5rem));
  gap: .65rem;
  justify-content: start;
}

.estimate-photo-button {
  aspect-ratio: 4 / 3;
  border: .0625rem solid var(--line);
  padding: 0;
  background: var(--bone);
  overflow: hidden;
  cursor: zoom-in;
}

.estimate-photo-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.admin-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(25, 28, 25, .9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.admin-photo-lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.admin-photo-stage {
  width: min(100%, calc(100vw - 8rem));
  min-width: 0;
  margin: 0;
  display: grid;
  justify-items: center;
  gap: .75rem;
}

.admin-photo-stage img {
  max-width: min(100%, 80rem);
  max-height: 82vh;
  display: block;
  object-fit: contain;
}

.admin-photo-stage figcaption {
  color: rgba(255, 255, 255, .72);
  font-size: .75rem;
}

.admin-photo-close,
.admin-photo-nav {
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.admin-photo-prev {
  left: clamp(1rem, 3vw, 2.5rem);
}

.admin-photo-next {
  right: clamp(1rem, 3vw, 2.5rem);
}

.admin-photo-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font: 300 2.25rem/1 var(--sans);
}

.admin-photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  aspect-ratio: 1;
  border: .0625rem solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.admin-photo-nav[hidden] {
  display: none;
}

.estimate-actions,
.archive-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.estimate-create-project-btn {
  padding: 8px 11px;
  font-size: 10px;
}

/* Archive */
.archive-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 17px;
}

.archive-half {
  padding: 14px;
  background: var(--bone);
  border: 1px solid var(--line);
}

.archive-half strong {
  display: block;
  margin-top: 5px;
  font: 400 19px var(--serif);
}

.archive-half p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.archive-danger,
.danger-text-btn {
  border: 0;
  background: transparent;
  color: var(--terra);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.archive-danger:hover,
.danger-text-btn:hover {
  text-decoration: underline;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25,28,25,.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  overflow: hidden;
}

.modal.open,
.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(570px,100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 30px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(37,39,36,.16);
  scrollbar-width: none;
}

.modal-card::-webkit-scrollbar {
  width: 0;
}

.modal-head {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.modal-head p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 11px;
}

.field {
  margin-bottom: 14px;
}

.field label span {
  color: #999;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

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

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.field-label-row label {
  margin: 0;
}

.create-task-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.create-task-row {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) 34px;
  gap: 8px;
  align-items: center;
}

.create-task-index {
  color: var(--terra);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.remove-create-task {
  width: 34px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bone);
  color: var(--muted);
  cursor: pointer;
}

.form-message {
  min-height: 18px;
  margin-top: -4px;
  color: #8a3e2d;
  font-size: 10px;
}

.modal-actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.light-btn {
  padding: 11px 15px;
}

.created-summary {
  margin: 18px 0;
  padding: 15px 17px;
  background: var(--bone);
  border: 1px solid var(--line);
}

.created-summary strong {
  display: block;
  font: 400 22px var(--serif);
}

.created-summary span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.referral-row {
  display: flex;
}

.referral-row input {
  border-right: 0;
  border-radius: 3px 0 0 3px;
  font-size: 9px;
}

.referral-row .copy-btn {
  border-radius: 0 3px 3px 0;
}

.task-modal-progress {
  display: grid;
  grid-template-columns: minmax(0,1fr) 52px;
  align-items: center;
  gap: 12px;
}

.task-modal-progress input {
  width: 100%;
}

.task-modal-progress strong {
  font: 400 20px var(--serif);
  text-align: right;
}

.task-modal-actions {
  align-items: center;
}

.modal-action-spacer {
  flex: 1;
}

@media (max-width: 1080px) {
  .customer-grid {
    grid-template-columns: repeat(2,minmax(260px,1fr));
  }

  .stats {
    grid-template-columns: repeat(2,1fr);
  }
}

.admin-access-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-access-panel {
  padding: 1.4rem;
  border: .0625rem solid var(--line);
  background: var(--paper);
}

.admin-access-panel h2 {
  margin: .35rem 0 .55rem;
  font-family: Georgia, serif;
  font-weight: 400;
}

.admin-access-panel > p {
  margin: 0 0 1.15rem;
  color: var(--muted);
  line-height: 1.55;
}

.admin-invite-form {
  display: grid;
  gap: .85rem;
}

.admin-account-section {
  margin-top: 1rem;
}

.admin-action-password {
  max-width: 28rem;
  margin-bottom: 1rem;
}

.admin-account-list {
  display: grid;
  gap: .65rem;
}

.admin-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: .0625rem solid var(--line);
  background: var(--bone);
}

.admin-account-row div {
  min-width: 0;
}

.admin-account-row strong,
.admin-account-row span,
.admin-account-row small {
  display: block;
}

.admin-account-row strong {
  overflow-wrap: anywhere;
}

.admin-account-row span,
.admin-account-row small,
.admin-account-lock {
  margin-top: .25rem;
  color: var(--muted);
  font-size: .78rem;
}

@media (max-width: 780px) {
  .admin-access-layout {
    grid-template-columns: 1fr;
  }

  .admin-account-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar {
    width: 66px;
    padding: 18px 8px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand span:last-child,
  .workspace-label,
  .admin-identity {
    display: none;
  }

  .nav-item {
    justify-content: center;
    font-size: 0;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .sidebar-bottom {
    justify-content: center;
    padding-inline: 0;
  }

  .logout-btn {
    display: none;
  }

  .main {
    margin-left: 66px;
    width: calc(100% - 66px);
    padding: 30px 18px 60px;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .drawer-head,
  .drawer-scroll {
    padding-left: 20px;
    padding-right: 20px;
  }

  .estimate-details {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .archive-pair {
    grid-template-columns: 1fr;
  }

  .archive-filters {
    justify-content: stretch;
  }

  .archive-filters label {
    flex: 1 1 0;
  }

  .archive-filters select {
    width: 100%;
    min-width: 0;
  }

  .task {
    grid-template-columns: 28px minmax(0,1fr) 90px;
  }

  .task-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .stats,
  .estimate-stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: block;
  }

  .topbar .primary-btn,
  .topbar .light-btn {
    margin-top: 14px;
  }

  h1 {
    font-size: 40px;
  }

  .estimate-card-head,
  .archive-card-head {
    display: block;
  }

  .estimate-requested-at {
    display: block;
    margin-top: 8px;
  }

  .estimate-details {
    grid-template-columns: 1fr;
  }

  .archive-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .archive-topbar-actions {
    margin-top: 14px;
    align-items: flex-end;
    justify-content: space-between;
  }

  .archive-topbar-actions .light-btn {
    margin-top: 0;
  }

  .timeline-edit-row,
  .two-col {
    grid-template-columns: 1fr;
  }

  .task-composer-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-composer-row .light-btn {
    grid-column: 1 / -1;
  }

  .task-publish-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .task-publish-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .referral-link-box {
    grid-template-columns: 1fr;
  }

  .referral-link-box .copy-btn {
    padding: 10px 12px;
  }
}
