:root {
  --paper: #f8f6f2;
  --paper-deep: #eee9e1;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #fff;
  --ink: #2d2c2a;
  --muted: #77716a;
  --line: #ded7cd;
  --bronze: #aa815c;
  --bronze-soft: #d6c1aa;
  --charcoal: #343333;
  --green: #4d7563;
  --amber: #9a6a34;
  --red: #9d554d;
  --shadow: 0 18px 50px rgba(64, 55, 45, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(170, 129, 92, 0.12), transparent 30%),
    linear-gradient(145deg, #fbfaf8, var(--paper));
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

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

.auth-view { display: none; min-height: 100vh; place-items: center; padding: 24px; }
.auth-required .auth-view { display: grid; }
.auth-required .app-shell { display: none; }
.auth-card { width: min(430px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.auth-card > img { width: 210px; height: 82px; margin-bottom: 22px; object-fit: contain; object-position: left center; }
.auth-card h1 { margin: 0; font-family: Georgia, serif; font-size: 2.15rem; font-weight: 400; }
.auth-card > p:not(.page-kicker) { color: var(--muted); font-size: .78rem; line-height: 1.55; }
.auth-form { display: grid; gap: 12px; margin-top: 20px; }
.auth-form .button { margin-top: 4px; }
.auth-link { margin-top: 12px; padding: 0; border: 0; color: var(--bronze); background: transparent; font: inherit; font-size: .78rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.auth-status { min-height: 1.3em; margin: 14px 0 0; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  border-right: 1px solid var(--line);
  background: rgba(252, 250, 247, 0.94);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  display: flex;
  min-height: 76px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 7px 14px;
}

.brand img {
  display: block;
  width: 170px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.primary-nav {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  overflow-y: auto;
}

.primary-nav a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  min-height: 39px;
  padding: 5px 8px;
  border-radius: 13px;
  color: #5f5a54;
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-nav a > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--bronze);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.primary-nav a:hover { background: #f3eee7; transform: translateX(2px); }
.primary-nav a.active { color: var(--ink); background: #efe8de; font-weight: 600; }
.primary-nav a.active > span { color: white; border-color: var(--bronze); background: var(--bronze); }

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.sidebar-note strong { font-family: Georgia, serif; font-weight: 500; }
.sidebar-note p { margin: 6px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }

.workspace { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 18px;
  padding: 10px clamp(18px, 2.6vw, 38px);
  border-bottom: 1px solid rgba(222, 215, 205, 0.84);
  background: rgba(248, 246, 242, 0.9);
  backdrop-filter: blur(20px);
}

.topbar-copy { display: grid; gap: 3px; }
.topbar-copy p { margin: 0; color: var(--bronze); font-size: 0.62rem; letter-spacing: 0.18em; font-weight: 700; }
.topbar-copy strong { font-family: Georgia, serif; font-size: 1.12rem; font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.preview-badge {
  padding: 7px 11px;
  border: 1px solid #d7c4b0;
  border-radius: 999px;
  color: #7b5c40;
  background: #f7eee5;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-badge {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sync-badge { padding: 6px 9px; border-radius: 999px; color: #315b49; background: #e8f1ec; font-size: .62rem; font-weight: 700; }
.sync-badge.is-saving { color: #795127; background: #f7eddf; }
.sync-badge.is-error { color: #7f332e; background: #f7e5e3; }

.profile-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.profile-button > span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--charcoal);
  font-family: Georgia, serif;
  font-size: 0.76rem;
}

.profile-copy { display: grid; text-align: left; line-height: 1.1; }
.profile-copy strong { font-size: 0.76rem; }
.profile-copy small { margin-top: 3px; color: var(--muted); font-size: 0.62rem; }

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.menu-button span { display: block; height: 1px; margin: 5px 0; background: var(--ink); }

#appContent {
  position: relative;
  isolation: isolate;
  width: min(1480px, 100%);
  min-height: calc(100vh - 72px);
  padding: clamp(20px, 2.6vw, 36px);
  outline: none;
}

#appContent::before {
  content: "";
  position: fixed;
  right: 2vw;
  bottom: -7vh;
  z-index: -1;
  width: min(46vw, 610px);
  aspect-ratio: 1.45;
  background: url("../assets/brand-kit/no-limit-carpentry-nl-monogram.png") center / contain no-repeat;
  opacity: 0.028;
  pointer-events: none;
}

.page { display: grid; gap: 16px; animation: pageIn 240ms ease both; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.page-kicker { margin: 0 0 6px; color: var(--bronze); font-size: 0.62rem; letter-spacing: 0.19em; font-weight: 700; text-transform: uppercase; }
.page-head h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 3.6vw, 3.45rem); line-height: 1; font-weight: 400; letter-spacing: -0.04em; }
.page-description { max-width: 760px; margin: 10px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--charcoal);
  border-radius: 999px;
  color: white;
  background: var(--charcoal);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.button.secondary { color: var(--ink); border-color: var(--line); background: white; }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric-card {
  display: grid;
  gap: 10px;
  min-height: 118px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}
.metric-card:hover { transform: translateY(-3px); border-color: var(--bronze-soft); }
.metric-label { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.metric-value { font-family: Georgia, serif; font-size: 2rem; font-weight: 400; line-height: 1; }
.metric-note { margin-top: auto; color: var(--muted); font-size: 0.73rem; line-height: 1.45; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr); gap: 12px; align-items: start; }
.panel {
  padding: clamp(15px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.panel-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 400; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; }

.empty-state { display: grid; place-items: center; min-height: 250px; padding: 30px; border: 1px dashed var(--line); border-radius: 17px; text-align: center; }
.empty-state img { width: 72px; height: 58px; object-fit: contain; opacity: 0.34; }
.empty-state h3 { margin: 13px 0 6px; font-family: Georgia, serif; font-size: 1.18rem; font-weight: 400; }
.empty-state p { max-width: 430px; margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }

.workflow { display: grid; gap: 7px; }
.workflow-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #ebe6df; }
.workflow-item:last-child { border-bottom: 0; }
.workflow-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: white; background: var(--bronze); font-size: 0.65rem; }
.workflow-item strong { font-size: 0.8rem; font-weight: 600; }
.workflow-item small { color: var(--muted); font-size: 0.67rem; }

.priority-list { display: grid; }
.priority-list a { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid #ebe6df; color: var(--ink); text-decoration: none; }
.priority-list a:last-child { border-bottom: 0; }
.priority-list strong { display: block; font-size: 0.82rem; }
.priority-list p { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; }
.priority-list small { color: var(--muted); font-size: 0.68rem; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bronze); }
.priority-dot.green { background: var(--green); }
.priority-dot.amber { background: var(--amber); }

.table-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 9px 11px; border-bottom: 1px solid #eee9e2; text-align: left; font-size: 0.71rem; }
th { color: var(--muted); background: #faf8f5; font-size: 0.63rem; letter-spacing: 0.08em; text-transform: uppercase; }
td a { color: var(--ink); text-decoration-color: var(--bronze-soft); text-underline-offset: 3px; }
.record-id { display: block; margin-top: 4px; color: var(--muted); font-size: 0.63rem; }
.text-button { padding: 0; border: 0; color: var(--ink); background: transparent; font-size: 0.7rem; font-weight: 700; text-decoration: underline; text-decoration-color: var(--bronze-soft); text-underline-offset: 4px; cursor: pointer; }
.subsection-title { margin: 28px 0 12px; font-family: Georgia, serif; font-size: 1.08rem; font-weight: 400; }
.progress { width: 110px; height: 6px; margin-bottom: 5px; overflow: hidden; border-radius: 99px; background: var(--paper-deep); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--bronze); }

.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #f1ece5; font-size: 0.65rem; font-weight: 700; }
.status-pill.green { color: #315b49; background: #e8f1ec; }
.status-pill.amber { color: #795127; background: #f7eddf; }
.status-pill.red { color: #7f332e; background: #f7e5e3; }

.filter-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; margin-bottom: 18px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 0.7rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
}
textarea { min-height: 104px; resize: vertical; line-height: 1.5; }

.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.module-card { display: grid; gap: 8px; min-height: 132px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.module-card .initial { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--bronze); background: #f4ede5; font-size: 0.72rem; font-weight: 700; }
.module-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.16rem; font-weight: 400; }
.module-card p { margin: 0; color: var(--muted); font-size: 0.74rem; line-height: 1.5; }
.module-card a { margin-top: auto; color: var(--ink); font-size: 0.72rem; font-weight: 700; text-decoration-color: var(--bronze-soft); text-underline-offset: 4px; }
.form-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 12px 0 5px; border-top: 1px solid var(--line); color: var(--ink); }
.form-section-title strong { font-family: Georgia, serif; font-size: 1rem; font-weight: 400; }
.form-section-title span { color: var(--muted); font-size: 0.67rem; }

.report-layout { display: grid; grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr); gap: 18px; align-items: start; }
.report-controls { display: grid; gap: 18px; }
.report-controls fieldset { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.report-controls legend { margin-bottom: 8px; font-family: Georgia, serif; font-size: 1rem; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 0.76rem; font-weight: 400; }
.check-row input { width: 16px; min-height: 16px; accent-color: var(--bronze); }
.report-preview { min-height: 680px; padding: clamp(28px, 5vw, 58px); border: 1px solid #ddd6cc; background: white; box-shadow: 0 22px 55px rgba(47, 43, 38, 0.09); }
.report-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.report-brand img { width: 190px; height: 78px; object-fit: contain; object-position: left; }
.report-brand span { color: var(--muted); font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.1em; }
.report-preview h2 { margin: 34px 0 8px; font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
.report-meta { color: var(--muted); font-size: 0.72rem; }
.report-section { margin-top: 30px; }
.report-section h3 { padding-bottom: 9px; border-bottom: 1px solid var(--line); font-family: Georgia, serif; font-size: 1.08rem; font-weight: 400; }
.report-section p { color: var(--muted); font-size: 0.76rem; line-height: 1.55; }

.security-list { display: grid; gap: 10px; }
.security-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid #ebe6df; }
.security-row strong { display: block; font-size: 0.8rem; }
.security-row p { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; }

.location-grid { display: grid; gap: 10px; }
.location-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: white; text-decoration: none; }
.location-card p { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; }
.map-pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); color: white; background: var(--bronze); font-size: 0.7rem; font-weight: 700; }
.map-pin::first-letter { transform: rotate(45deg); }
.privacy-note { margin: 18px 0 0; color: var(--muted); font-size: 0.7rem; }

.data-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 32px 90px rgba(35, 31, 27, 0.22); }
.data-dialog::backdrop { background: rgba(42, 38, 34, 0.38); backdrop-filter: blur(4px); }
.dialog-card { padding: clamp(22px, 4vw, 38px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.dialog-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 400; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: white; font-size: 1.4rem; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dialog-note { margin: 22px 0 0; padding: 14px 16px; border-radius: 12px; color: var(--muted); background: var(--paper); font-size: 0.7rem; line-height: 1.5; }
.dialog-actions { justify-content: flex-end; margin-top: 22px; }
.field-wide { grid-column: 1 / -1; }

.document-dialog {
  width: min(1240px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 34px 100px rgba(35, 31, 27, 0.24);
}
.document-dialog::backdrop { background: rgba(42, 38, 34, 0.46); backdrop-filter: blur(5px); }
.document-dialog-shell { display: grid; grid-template-rows: auto auto minmax(0, 1fr); max-height: calc(100vh - 30px); }
.document-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.95); }
.document-toolbar h2 { margin: 0; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 400; }
.document-toolbar .page-kicker { margin-bottom: 5px; }
.document-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.document-notice { padding: 10px 22px; color: var(--muted); background: #f2ece4; font-size: 0.7rem; text-align: center; }
.document-stage { padding: clamp(18px, 4vw, 44px); overflow: auto; }
.business-document { width: min(900px, 100%); min-height: 1165px; margin: 0 auto; padding: clamp(30px, 6vw, 64px); color: #262626; background: #fff; box-shadow: 0 22px 60px rgba(47, 43, 38, 0.1); }
.document-brand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: start; padding-bottom: 28px; border-bottom: 2px solid #b78b62; }
.document-company { display: flex; gap: 28px; align-items: flex-start; }
.document-company img { width: 210px; height: 92px; object-fit: cover; object-position: center; }
.document-company p, .document-company-contact p { margin: 5px 0 0; color: #5f5a54; font-size: 0.72rem; line-height: 1.55; }
.document-company-contact { text-align: right; }
.document-company-contact > strong { display: block; color: #a97850; font-family: Georgia, serif; font-size: 2.1rem; font-weight: 400; letter-spacing: 0.06em; }
.document-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 34px 0 0; padding: 28px; background: #f8f4ef; }
.document-parties span { color: #9b704c; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.document-parties h2 { margin: 8px 0 6px; font-family: Georgia, serif; font-size: 1.22rem; font-weight: 400; }
.document-parties p { margin: 0; color: #5f5a54; font-size: 0.72rem; line-height: 1.5; }
.document-meta { display: grid; grid-template-columns: 1fr minmax(300px, 0.8fr); gap: 30px; align-items: start; padding: 24px 0; border-bottom: 1px solid #e5ddd3; }
.document-meta h3, .document-notes h3, .document-section h3 { margin: 0; font-family: Georgia, serif; font-size: 1.05rem; font-weight: 400; }
.document-meta dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 22px; margin: 0; }
.document-meta dl div { display: flex; justify-content: space-between; gap: 12px; }
.document-meta dt { color: #77716a; font-size: 0.65rem; }
.document-meta dd { margin: 0; font-size: 0.68rem; font-weight: 600; text-align: right; }
.document-items { margin-top: 24px; overflow-x: auto; }
.document-items table { min-width: 720px; }
.document-items th { background: transparent; border-bottom: 1px solid #b78b62; }
.document-items th:first-child, .document-items td:first-child { width: 34px; }
.document-items th:nth-last-child(-n+3), .document-items td:nth-last-child(-n+3) { text-align: right; }
.document-items td { vertical-align: top; line-height: 1.45; }
.document-input { min-height: 34px; padding: 6px 8px; border-radius: 7px; font-size: 0.72rem; }
.remove-line { display: block; margin-top: 7px; padding: 0; border: 0; color: var(--red); background: transparent; font-size: 0.62rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.document-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr); gap: 44px; margin-top: 28px; }
.document-notes p { max-width: 500px; margin: 10px 0 0; color: #69645e; font-size: 0.72rem; line-height: 1.65; white-space: pre-line; }
.document-notes-input { margin-top: 10px; }
.document-totals { display: grid; gap: 10px; }
.document-totals > div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 8px; border-bottom: 1px solid #ece6df; font-size: 0.72rem; }
.document-totals .grand-total { margin-top: 3px; padding: 12px 0; border-top: 2px solid #b78b62; border-bottom: 0; font-family: Georgia, serif; font-size: 1rem; }
.document-stage-list { display: grid; margin-top: 14px; }
.document-stage-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; padding: 10px 0; border-bottom: 1px solid #ece6df; font-size: 0.7rem; }
.document-stage-list small { color: #77716a; }
.document-section { margin-top: 34px; }
.document-approval { display: grid; grid-template-columns: 1fr 180px; gap: 36px; margin-top: 70px; }
.document-approval div { display: grid; gap: 26px; color: #77716a; font-size: 0.66rem; }
.document-approval i { display: block; border-bottom: 1px solid #77716a; }
.document-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 72px; padding-top: 16px; border-top: 1px solid #d7c8b8; color: #8a8178; font-family: Georgia, serif; font-size: 0.72rem; }

.mobile-overlay { display: none; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .report-layout { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(310px, 88vw); transition: transform 210ms ease; box-shadow: 20px 0 50px rgba(40, 35, 30, 0.16); }
  body.nav-open .sidebar { transform: translateX(0); }
  .mobile-overlay { position: fixed; inset: 0; z-index: 18; background: rgba(42, 38, 34, 0.28); backdrop-filter: blur(2px); }
  body.nav-open .mobile-overlay { display: block; }
  .menu-button { display: block; }
  .topbar { min-height: 78px; padding: 12px 16px; }
  .profile-copy, .preview-badge, .demo-badge { display: none; }
  #appContent { min-height: calc(100vh - 78px); padding: 26px 16px 42px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .metric-grid, .module-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 145px; }
  .page-head h1 { font-size: 2.7rem; }
  .panel { padding: 18px; border-radius: 18px; }
  .report-preview { min-height: 520px; padding: 24px 20px; }
  .report-brand { align-items: flex-start; flex-direction: column; }
  .report-brand img { width: 170px; }
  .form-grid { grid-template-columns: 1fr; }
  .location-card { grid-template-columns: 36px minmax(0, 1fr); }
  .location-card .status-pill { grid-column: 2; justify-self: start; }
  .document-dialog { width: calc(100vw - 12px); max-height: calc(100vh - 12px); }
  .document-dialog-shell { max-height: calc(100vh - 14px); }
  .document-toolbar { align-items: flex-start; flex-direction: column; padding: 15px; }
  .document-toolbar-actions { justify-content: flex-start; }
  .document-stage { padding: 10px; }
  .business-document { min-width: 760px; padding: 44px; }
}

@media print {
  .sidebar, .topbar, .page-head, .report-controls { display: none !important; }
  .app-shell, .report-layout { display: block; }
  #appContent { padding: 0; }
  .report-preview { min-height: 0; border: 0; box-shadow: none; }
  body { background: white; }
  body.printing-document .app-shell,
  body.printing-document .document-toolbar,
  body.printing-document .document-notice { display: none !important; }
  body.printing-document .document-dialog { position: static; display: block; width: auto; max-height: none; margin: 0; overflow: visible; border: 0; box-shadow: none; }
  body.printing-document .document-dialog-shell,
  body.printing-document .document-stage { display: block; max-height: none; padding: 0; overflow: visible; }
  body.printing-document .business-document { width: 100%; min-height: 0; padding: 0; box-shadow: none; }
}
