@font-face {
  font-family: "Montserrat";
  src: url("../assets/montserrat-latin-400-900.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #012b17;
  --bg-deep: #001e10;
  --surface: #063a22;
  --surface-2: #0a4a2b;
  --line: rgba(224, 180, 56, .38);
  --line-soft: rgba(255, 248, 231, .15);
  --cream: #fff8e7;
  --muted: rgba(255, 248, 231, .7);
  --gold: #e0b438;
  --accent: #f8b62f;
  --accent-hover: #ffc64d;
  --accent-ink: #012b17;
  --danger: #ff8d7e;
  --warning: #f3e5a6;
  --shadow: 0 28px 80px rgba(0, 0, 0, .25);
  font-family: "Montserrat", system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--cream);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% -10%, rgba(224, 180, 56, .13), transparent 32rem),
    linear-gradient(180deg, var(--bg-deep), var(--bg));
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

a { color: inherit; }

[hidden] { display: none !important; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 0, rgba(230, 198, 98, .12), transparent 36rem),
    var(--bg-deep);
}

.auth-card {
  width: min(100%, 500px);
  padding: clamp(26px, 6vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(8, 41, 29, .94);
  box-shadow: var(--shadow);
}

.auth-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
  transition: all 0.2s ease;
}

.auth-back-link:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--line);
  transform: translateX(-3px);
}

.auth-logo-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 0 2px var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 12px;
  border: 1px dashed var(--line-soft);
  transition: all 0.2s ease;
}

.auth-back-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(248, 182, 47, 0.08);
}

.auth-card h1 { margin: 10px 0 12px; font-size: clamp(2rem, 7vw, 3.4rem); line-height: .98; }
.auth-card > p { color: var(--muted); line-height: 1.65; }
.auth-card > small { display: block; margin-top: 22px; color: var(--muted); line-height: 1.5; }

.eyebrow {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.login-form { display: grid; gap: 10px; margin-top: 28px; }
.login-form label, .form-card label, .product-card label {
  color: var(--cream);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.4;
}

input, select, textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(0, 0, 0, .2);
  color: var(--cream);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input, select { min-height: 48px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(248, 182, 47, .16);
}

.primary-button, .secondary-button, .text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--accent);
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-ink);
}

.primary-button:hover { background: var(--accent-hover); }

.secondary-button {
  border: 1px solid var(--line);
  padding: 0 16px;
  background: transparent;
  color: var(--cream);
}

.secondary-button:hover { border-color: var(--accent); }

.text-button {
  min-height: 36px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
}

.text-button:hover { color: var(--accent); }
.login-form .primary-button { margin-top: 8px; }
.form-message { min-height: 1.5em; margin: 4px 0 0; color: var(--danger); font-size: .8rem; line-height: 1.5; }
.form-message.success { color: var(--accent); }
.form-message.info { color: var(--warning); }

.access-denied {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid rgba(255, 141, 126, .35);
  border-radius: 16px;
  background: rgba(255, 141, 126, .06);
}
.access-denied p { color: var(--muted); line-height: 1.55; }
.access-denied code { color: var(--cream); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(2, 16, 11, .9);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { border-radius: 50%; }
.brand span { display: grid; gap: 3px; }
.brand b { font-size: .95rem; }
.brand small { color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.account { display: flex; align-items: center; gap: 10px; }
.account > span { max-width: 260px; overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }

.mobile-nav {
  position: sticky;
  top: 78px;
  z-index: 19;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(4, 26, 18, .94);
  overflow-x: auto;
}

.nav-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}
.nav-button.active { border-color: var(--line); background: var(--surface); color: var(--accent); }

.global-save-bar {
  position: sticky;
  top: 137px;
  z-index: 18;
  display: flex;
  width: min(100% - 32px, 1180px);
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px auto 0;
  padding: 9px 10px 9px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(2, 30, 17, .96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}

.global-save-bar > div { display: grid; min-width: 0; gap: 3px; }
.global-save-bar strong, .global-save-bar small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-save-bar strong { font-size: .78rem; }
.global-save-bar small { color: var(--muted); font-size: .66rem; }
.global-save-bar .primary-button { flex: 0 0 auto; }

.shell { width: min(100% - 32px, 1180px); margin: 0 auto; padding: 34px 0 80px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 30px;
  align-items: end;
  padding: clamp(26px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(248, 182, 47, .08), transparent 40%),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero h1 { margin: 14px 0; font-size: clamp(2.3rem, 7vw, 5.4rem); line-height: .92; letter-spacing: -.055em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { max-width: 690px; margin: 0; color: var(--muted); line-height: 1.65; }

.sync-card {
  display: grid;
  gap: 9px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(0, 0, 0, .17);
}
.sync-card > span { color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .13em; }
.sync-card small { color: var(--muted); line-height: 1.4; }
.save-state { color: var(--warning); }
.save-state.synced { color: var(--accent); }
.save-state.error { color: var(--danger); }

.conflict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 211, 107, .45);
  border-radius: 16px;
  background: rgba(255, 211, 107, .08);
}
.conflict-banner div { display: grid; gap: 4px; }
.conflict-banner span { color: var(--muted); font-size: .8rem; line-height: 1.5; }

.view { padding-top: 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 8px 0 7px; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.05; letter-spacing: -.035em; }
.section-heading p { max-width: 730px; margin: 0; color: var(--muted); line-height: 1.55; }
.subsection { margin-top: 48px; }

.progress-ring {
  display: grid;
  min-width: 118px;
  min-height: 118px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-align: center;
  background: var(--surface);
}
.progress-ring strong { color: var(--accent); font-size: 1.55rem; }
.progress-ring span { color: var(--muted); font-size: .65rem; }

.task-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.task-card, .form-card, .product-card, .baseline-card, .review-card, .checkpoint-card, .hour-card {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--surface);
}
.task-card { display: grid; gap: 16px; padding: 22px; }
.task-card.done { border-color: rgba(248, 182, 47, .5); }
.task-card.na { opacity: .72; }
.task-number { display: flex; align-items: center; justify-content: space-between; }
.task-number > span:first-child {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 900;
}
.task-card h3 { margin: 0; font-size: 1.13rem; line-height: 1.25; }
.task-card > p { min-height: 4.8em; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.task-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.task-controls label, .checkpoint-card label { color: var(--muted); font-size: .7rem; font-weight: 700; }
.task-controls .wide { grid-column: 1 / -1; }
.jump-button { width: 100%; }

.metrics-card {
  margin-top: 20px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(248, 182, 47, .07), var(--surface));
}
.metrics-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.metrics-heading h3 { margin: 7px 0 5px; font-size: 1.3rem; }
.metrics-heading p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.metrics-grid article { padding: 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(0, 0, 0, .13); }
.metrics-grid span { color: var(--warning); font-size: .59rem; font-weight: 850; letter-spacing: .1em; }
.metrics-grid strong { display: block; margin: 8px 0 1px; color: var(--accent); font-size: 1.9rem; letter-spacing: -.04em; }
.metrics-grid small, .metrics-foot { color: var(--muted); font-size: .68rem; }
.metrics-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; line-height: 1.5; }
.metrics-foot > span { color: var(--cream); }

.form-card { padding: clamp(20px, 4vw, 34px); }
.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.confirmation-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.confirmation-row span { color: var(--muted); font-size: .8rem; }

.hours-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hour-card { padding: 16px; }
.hour-card > strong { display: block; margin-bottom: 12px; }
.hour-card .time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.closed-toggle { display: flex; align-items: center; gap: 8px; margin-top: 13px; color: var(--muted); font-size: .75rem; }
.closed-toggle input, .active-toggle input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--accent); }

.catalog-list { display: grid; gap: 28px; }
.catalog-group { display: grid; gap: 12px; }
.catalog-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}
.catalog-group-heading h3 { margin: 0; color: var(--cream); font-size: 1.05rem; }
.catalog-group-heading > span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--warning);
  font-size: .68rem;
  font-weight: 800;
}
.catalog-group-items { display: grid; gap: 9px; }
.product-card { padding: 0; overflow: clip; }
.product-summary {
  position: relative;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 62px 13px 18px;
  list-style: none;
  cursor: pointer;
}
.product-summary::-webkit-details-marker { display: none; }
.product-summary::after {
  position: absolute;
  right: 20px;
  content: "+";
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 500;
}
.product-card[open] .product-summary { background: rgba(248, 182, 47, .06); }
.product-card[open] .product-summary::after { content: "−"; }
.product-summary-copy { display: grid; gap: 4px; min-width: 0; }
.product-summary-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-summary-copy small { color: var(--warning); font-size: .72rem; }
.product-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .66rem;
  font-weight: 850;
}
.product-status.active { background: var(--accent); color: var(--accent-ink); }
.product-status.inactive { border: 1px solid var(--line-soft); color: var(--muted); }
.product-body { padding: clamp(18px, 4vw, 28px); border-top: 1px solid var(--line-soft); }
.product-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.product-head > span { color: var(--muted); font-size: .74rem; font-weight: 750; }
.active-toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; }
.product-grid { display: grid; grid-template-columns: 1.2fr .55fr; gap: 16px; }
.product-grid .wide { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: 8px; color: var(--cream); font-size: .72rem; font-weight: 800; }
.product-photo-field {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(0, 20, 13, .28);
}
.product-photo-editor {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 18px;
  align-items: center;
}
.product-photo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #f8b62f, #ffe6a0);
}
.product-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.product-photo-preview img.is-fallback { object-fit: contain; padding: 16px; }
.product-photo-controls { display: grid; gap: 8px; align-content: center; }
.product-photo-controls > strong { color: var(--cream); font-size: .9rem; }
.product-photo-controls > p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.product-photo-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.product-photo-button { min-height: 42px; }
.product-photo-button:disabled, .product-photo-remove:disabled { cursor: wait; opacity: .6; }
.product-photo-state { min-height: 1.2em; color: var(--muted); font-size: .7rem; font-weight: 750; }
.product-photo-state.loading { color: var(--warning); }
.product-photo-state.success { color: var(--accent); }
.product-photo-state.error { color: var(--danger); }
.product-actions {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.product-action-buttons { display: flex; align-items: center; gap: 12px; }
.item-save-button { min-width: 132px; }
.item-save-button:disabled { cursor: wait; opacity: .65; }
.product-save-feedback { color: var(--muted); font-size: .72rem; font-weight: 700; line-height: 1.45; }
.product-save-feedback.pending, .product-save-feedback.saving { color: var(--warning); }
.product-save-feedback.synced { color: var(--accent); }
.product-save-feedback.error { color: var(--danger); }
.remove-button { border: 0; background: transparent; color: var(--danger); font-weight: 750; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }

.reputation-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: 18px; }
.baseline-card { display: grid; align-content: center; gap: 12px; padding: 28px; }
.baseline-card > span, .review-card span { color: var(--accent); font-size: .7rem; font-weight: 850; letter-spacing: .13em; }
.baseline-card > strong { font-size: 1.1rem; }
.baseline-card > strong b { font-size: clamp(2.7rem, 7vw, 4.8rem); letter-spacing: -.06em; }
.baseline-card p { margin: 0; }
.baseline-card small { color: var(--muted); line-height: 1.5; }
.review-card { display: grid; grid-template-columns: 190px 1fr; gap: 25px; align-items: center; padding: 26px; }
.review-card img { width: 100%; height: auto; padding: 8px; border-radius: 14px; background: white; }
.review-card h3 { margin: 8px 0; font-size: 1.35rem; }
.review-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.55; }
.review-card small { display: block; min-height: 1.3em; margin-top: 9px; color: var(--accent); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.checkpoint-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.checkpoint-card { padding: 16px; }
.checkpoint-card h3 { margin: 0 0 12px; color: var(--accent); font-size: 1.1rem; }
.checkpoint-card label { display: block; margin-top: 10px; }
.checkpoint-card textarea { min-height: 110px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px max(18px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.5;
}

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .task-grid { grid-template-columns: 1fr; }
  .task-card > p { min-height: auto; }
  .hours-grid { grid-template-columns: repeat(2, 1fr); }
  .reputation-grid { grid-template-columns: 1fr; }
  .checkpoint-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar { min-height: 68px; }
  .brand img { width: 44px; height: 44px; }
  .account > span { display: none; }
  .mobile-nav { top: 68px; justify-content: flex-start; }
  .global-save-bar {
    top: 127px;
    width: min(100% - 22px, 1180px);
    min-height: 58px;
    gap: 10px;
    margin-top: 8px;
    padding: 7px 7px 7px 12px;
  }
  .global-save-bar strong { font-size: .7rem; }
  .global-save-bar small { font-size: .59rem; }
  .global-save-bar .primary-button { min-height: 42px; padding: 0 12px; font-size: .72rem; }
  .shell { width: min(100% - 22px, 1180px); padding-top: 18px; }
  .hero { padding: 24px 20px; border-radius: 20px; }
  .hero h1 { font-size: clamp(2.5rem, 14vw, 4.2rem); }
  .section-heading, .section-heading.compact { align-items: stretch; flex-direction: column; }
  .metrics-heading, .metrics-foot { align-items: stretch; flex-direction: column; }
  .metrics-heading .secondary-button { width: 100%; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .progress-ring { min-width: 100px; min-height: 100px; align-self: flex-start; }
  .two-columns, .product-grid { grid-template-columns: 1fr; }
  .product-grid .wide { grid-column: auto; }
  .product-summary { align-items: flex-start; flex-direction: column; padding-right: 52px; }
  .product-status { align-self: flex-start; }
  .product-head { align-items: flex-start; flex-direction: column; }
  .product-actions { align-items: stretch; flex-direction: column; }
  .product-action-buttons { align-items: stretch; flex-direction: column; }
  .product-photo-editor { grid-template-columns: 1fr; }
  .product-photo-preview { max-width: 320px; }
  .product-photo-buttons { align-items: stretch; flex-direction: column; }
  .item-save-button, .remove-button { width: 100%; min-height: 44px; }
  .hours-grid { grid-template-columns: 1fr; }
  .confirmation-row { align-items: stretch; flex-direction: column; }
  .review-card { grid-template-columns: 1fr; }
  .review-card img { width: 180px; }
  .checkpoint-grid { grid-template-columns: 1fr; }
  .conflict-banner { align-items: stretch; flex-direction: column; }
  footer { flex-direction: column; }
}

@media (max-width: 390px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

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