:root {
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --ink: #191917;
  --muted: #696860;
  --paper: #f2f0e9;
  --surface: #fbfaf6;
  --surface-2: #e5e2d8;
  --forest: #191917;
  --forest-2: #30302c;
  --sage: #e2dfd5;
  --orange: #191917;
  --orange-pale: #e7e4da;
  --blue: #50504a;
  --red: #a84842;
  --line: #d5d1c6;
  --shadow: 0 18px 45px rgba(25, 25, 23, 0.08);
  --radius: 18px;
}

/* Payment request control */
.payment-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 22px;
}
.payment-hero h2 { margin: 6px 0 10px; max-width: 760px; font-size: clamp(25px, 3vw, 40px); line-height: 1.12; }
.payment-hero span { color: rgba(242, 240, 233, .68); }
.payment-link-mark { display: grid; justify-items: end; gap: 7px; white-space: nowrap; }
.payment-link-mark b { display: grid; place-items: center; width: 58px; height: 58px; color: var(--ink); background: var(--paper); border-radius: 50%; font-size: 13px; }
.payment-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.payment-summary article { display: grid; gap: 7px; padding: 20px 22px; background: #fffdf8; border: 1px solid var(--line); border-radius: 16px; }
.payment-summary span { color: var(--muted); font-size: 12px; }
.payment-summary strong { font-size: 24px; }
.payment-flow { display: flex; align-items: center; gap: 10px; padding: 15px 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.payment-flow span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; font-weight: 750; }
.payment-flow span b { display: grid; place-items: center; width: 23px; height: 23px; color: var(--paper); background: var(--ink); border-radius: 50%; font-size: 10px; }
.payment-flow i { flex: 1 0 24px; height: 1px; background: var(--line); }
.payment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.payment-card { display: grid; gap: 11px; min-height: 230px; padding: 22px; text-align: left; background: #fffdf8; border: 1px solid var(--line); border-left: 4px solid #8c8b84; border-radius: 16px; transition: transform .16s ease, border-color .16s ease; }
.payment-card:hover { transform: translateY(-2px); border-color: var(--ink); }
.payment-card.status-approved { border-left-color: #b76f34; }
.payment-card.status-paid { border-left-color: #2c6b50; }
.payment-card.status-needs_review, .payment-card.status-rejected { border-left-color: #a14437; }
.payment-card-head, .payment-card-foot, .payment-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.payment-card-head > span, .payment-card > small { color: var(--muted); font-size: 11px; }
.payment-card h2 { margin: 3px 0 0; font-size: 20px; }
.payment-card p { min-height: 38px; margin: 0; color: #55534d; font-size: 13px; line-height: 1.45; overflow: hidden; }
.payment-card-meta { justify-content: flex-start; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.payment-card-meta span + span::before { content: "·"; margin-right: 8px; }
.payment-card-foot strong { font-size: 20px; }
.payment-tax { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.payment-tax.confirmed { color: #205d45; background: #e3f0e8; }
.payment-tax.pending { color: #8a3c2f; background: #f5e2dd; }
.payment-tax.optional { color: #66635c; background: #eceae3; }
.payment-scope-note { display: grid; grid-column: 1 / -1; gap: 5px; padding: 14px 16px; background: #eeeae0; border-left: 3px solid var(--ink); }
.payment-scope-note span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.payment-amount { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px; margin-top: 18px; color: var(--paper); background: var(--ink); border-radius: 14px; }
.payment-amount span { color: rgba(242, 240, 233, .65); font-size: 12px; }
.payment-amount strong { font-size: 28px; }
.payment-description { padding: 16px; margin: 0; background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; line-height: 1.65; }
.payment-attachments { display: grid; gap: 8px; }
.payment-attachment { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px; color: inherit; background: #fffdf8; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; }
.payment-attachment b { display: grid; place-items: center; width: 36px; height: 36px; color: var(--paper); background: var(--ink); border-radius: 8px; font-size: 10px; }
.payment-attachment small { color: var(--muted); }
.payment-review-note, .payment-paid-stamp { display: grid; gap: 5px; padding: 15px 17px; margin-top: 14px; border-radius: 12px; }
.payment-review-note { background: #f2e9df; }
.payment-paid-stamp { color: #dcece3; background: #214c3b; }
.payment-review-note p, .payment-paid-stamp span, .payment-paid-stamp p { margin: 0; font-size: 12px; line-height: 1.5; }
.payment-pay-confirm { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; padding: 16px; margin-bottom: 16px; color: var(--paper); background: var(--ink); border-radius: 12px; }
.payment-pay-confirm span { grid-column: 1 / -1; color: rgba(242, 240, 233, .6); font-size: 10px; }
.payment-pay-confirm b { font-size: 20px; }
.payment-project-row { width: 100%; text-align: left; }
.calendar-event.payment { color: #542f17; background: #efd5bf; border-left-color: #b96d38; }
.calendar-event.payment.paid { color: #184934; background: #dcebe2; border-left-color: #2f7555; }
.calendar-legend i.payment { background: #b96d38; }
.work-payment-event { display: grid; gap: 2px; width: 100%; padding: 7px 8px; text-align: left; color: #61351a; background: #efd5bf; border: 0; border-left: 3px solid #b96d38; border-radius: 7px; }
.work-payment-event.paid { color: #174934; background: #dcebe2; border-left-color: #2f7555; }
.work-payment-event span { overflow: hidden; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.work-payment-event b { overflow: hidden; font-size: 9px; font-weight: 600; opacity: .7; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 980px) {
  .payment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .payment-hero { align-items: flex-start; padding: 24px 20px; }
  .payment-link-mark { display: none; }
  .payment-summary { grid-template-columns: 1fr; }
  .payment-summary article { grid-template-columns: 1fr auto; align-items: center; }
  .payment-summary article strong { grid-row: 1 / 3; grid-column: 2; }
  .payment-grid { grid-template-columns: 1fr; }
  .payment-flow { margin-inline: -2px; }
  .payment-card { min-height: 0; }
  .payment-amount { align-items: flex-start; flex-direction: column; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(440px, 0.92fr);
  background: var(--paper);
}

.login-story {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 54px clamp(48px, 6vw, 96px) 44px;
  background: var(--ink);
  color: var(--paper);
}

.login-story::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: linear-gradient(rgba(242, 240, 233, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(242, 240, 233, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  mask-image: linear-gradient(135deg, transparent 5%, #000 48%, transparent 92%);
}

.login-story::after {
  position: absolute;
  z-index: -1;
  width: min(62vw, 760px);
  aspect-ratio: 1;
  right: -35%;
  top: 10%;
  border: 1px solid rgba(242, 240, 233, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(242, 240, 233, 0.026), 0 0 0 140px rgba(242, 240, 233, 0.018), 0 0 0 210px rgba(242, 240, 233, 0.012);
  content: "";
}

.bespace-symbol {
  width: 31px;
  height: 32px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  flex: 0 0 auto;
  gap: 3px;
  color: var(--ink);
  line-height: 0;
}

.bespace-symbol > i {
  display: block;
  background: currentColor;
}

.bespace-symbol > i:first-child {
  grid-column: 1;
  grid-row: 1 / 3;
}

.bespace-symbol > i:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.bespace-symbol > i:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.login-brand,
.login-mobile-brand {
  display: flex;
  align-items: center;
}

.login-symbol {
  width: 38px;
  height: 40px;
  gap: 4px;
  color: var(--paper);
}

.login-story-copy {
  max-width: 720px;
  padding: 72px 0;
}

.login-story-copy p {
  margin: 0 0 24px;
  color: rgba(242, 240, 233, 0.56);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.28em;
}

.login-story-copy h1 {
  margin: 0;
  font-size: clamp(42px, 4.2vw, 68px);
  font-weight: 450;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.login-story-copy h1 em {
  position: relative;
  color: var(--paper);
  font-style: normal;
  font-weight: 820;
}

.login-story-copy h1 em::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: rgba(242, 240, 233, 0.72);
  content: "";
}

.login-story-copy > span {
  display: block;
  margin-top: 36px;
  color: rgba(242, 240, 233, 0.62);
  font-size: 15px;
  line-height: 1.8;
}

.login-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(242, 240, 233, 0.2);
  border-bottom: 1px solid rgba(242, 240, 233, 0.2);
}

.login-principles article {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 20px 16px;
  border-right: 1px solid rgba(242, 240, 233, 0.2);
}

.login-principles article:last-child {
  border-right: 0;
}

.login-principles b {
  position: absolute;
  top: 18px;
  right: 14px;
  color: rgba(242, 240, 233, 0.28);
  font-size: 10px;
}

.login-principles span {
  color: rgba(242, 240, 233, 0.42);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.login-principles strong {
  font-size: 12px;
  font-weight: 620;
}

.login-story > small {
  margin-top: 28px;
  color: rgba(242, 240, 233, 0.34);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px clamp(34px, 6vw, 92px);
  background: var(--paper);
}

.login-card {
  width: min(100%, 430px);
}

.login-card .eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.login-card h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 780;
  letter-spacing: -0.055em;
}

.login-description {
  max-width: 390px;
  margin: 16px 0 38px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-field {
  display: grid;
  gap: 9px;
}

.login-field > span {
  font-size: 10px;
  font-weight: 750;
}

.login-field input {
  height: 54px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid #aaa79e;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input:focus {
  border-color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--ink);
}

.login-field input[readonly] {
  color: var(--muted);
}

.login-submit {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: transform 0.18s ease, background 0.18s ease;
}

.login-submit:hover {
  transform: translateY(-2px);
  background: #30302d;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.login-submit b {
  font-size: 20px;
  font-weight: 400;
}

.login-error {
  padding: 12px 14px;
  border-left: 3px solid var(--red);
  background: rgba(168, 72, 66, 0.08);
  color: #813b36;
  font-size: 11px;
  line-height: 1.5;
}

.passkey-login {
  display: grid;
  justify-items: stretch;
  gap: 9px;
  margin-top: 18px;
  text-align: center;
}

.passkey-login > span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.passkey-login > span::before,
.passkey-login > span::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.passkey-login > button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.passkey-login > button:hover { background: rgba(25, 25, 23, 0.055); }
.passkey-login > button:disabled { cursor: wait; opacity: 0.58; }
.passkey-login > button i,
.passkey-device > i {
  width: 20px;
  height: 24px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50% 50% 45% 45%;
  transform: rotate(12deg);
}

.passkey-login > button b { font-size: 11px; }
.passkey-login > small { color: var(--muted); font-size: 9px; }

.login-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 10px;
}

.login-help a {
  color: var(--ink);
  text-underline-offset: 4px;
}

.login-password-rule {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.login-security {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #858279;
  font-size: 9px;
}

.login-security i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(25, 25, 23, 0.08);
}

.login-mobile-brand {
  display: none;
}

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

@media screen {
  .content > section:not(:first-child),
  .content > article:not(:first-child),
  .project-estimate-panel,
  .project-construction-panel,
  .project-finance-panel,
  .work-team-board,
  .work-focus-panel,
  .goals-grid,
  .work-calendar-details {
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
  }

  .calendar-day,
  .work-event,
  .work-focus-item,
  .site-attendance-card,
  .directory-card {
    contain: layout style;
  }
}

button {
  color: inherit;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--forest);
}

.boot {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #262c31;
}

.boot-video {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.boot.video-ready .boot-video { opacity: 1; }

.boot-fallback {
  display: grid;
  justify-items: center;
  gap: 16px;
  color: var(--paper);
  transition: opacity 0.25s ease;
}

.boot.video-ready .boot-fallback { opacity: 0; }
.boot-fallback > span:last-child { font-size: 10px; letter-spacing: 0.08em; }
.boot-fallback .boot-symbol { color: var(--paper); }

.boot-skip {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(242, 240, 233, 0.28);
  border-radius: 999px;
  background: rgba(25, 25, 23, 0.48);
  color: var(--paper);
  cursor: pointer;
  font-size: 10px;
  backdrop-filter: blur(10px);
}

.boot-mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px 14px 14px 4px;
  background: var(--orange);
  color: white;
  font-family: var(--font-sans);
  font-size: 25px;
  font-weight: 700;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  background: var(--forest);
  color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
}

.brand-home {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.brand-home:hover { opacity: 0.78; }
.brand-home:focus-visible { outline: 2px solid var(--paper); outline-offset: 5px; }

.brand-copy strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 21px;
  letter-spacing: 0.06em;
}

.brand-copy span {
  color: #c9c6bc;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.nav-label {
  margin: 8px 10px;
  color: #9f9c93;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.attendance-quick {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  margin: 0 0 14px;
  border: 1px solid rgba(242, 240, 233, 0.42);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.attendance-quick:hover,
.attendance-quick.active {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.attendance-quick-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ink);
}

.attendance-quick-mark::before,
.attendance-quick-mark::after {
  position: absolute;
  background: var(--paper);
  content: "";
}

.attendance-quick-mark::before {
  width: 2px;
  height: 9px;
  top: 7px;
  left: 15px;
  transform-origin: bottom;
  transform: rotate(-18deg);
}

.attendance-quick-mark::after {
  width: 7px;
  height: 2px;
  top: 15px;
  left: 15px;
  transform-origin: left;
  transform: rotate(28deg);
}

.attendance-quick-mark i {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(242, 240, 233, 0.7);
  border-radius: 50%;
}

.attendance-quick-copy strong,
.attendance-quick-copy small {
  display: block;
}

.attendance-quick-copy strong {
  font-size: 13px;
  font-weight: 850;
}

.attendance-quick-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.attendance-quick > b {
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(25, 25, 23, 0.08);
  font-size: 8px;
}

.attendance-quick.active > b {
  background: var(--ink);
  color: var(--paper);
}

.nav {
  display: grid;
  gap: 7px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(242, 240, 233, 0.26) transparent;
  scrollbar-width: thin;
}

.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: rgba(242, 240, 233, 0.26); border-radius: 999px; }

.nav button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  background: transparent;
  color: #d7d3c9;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-token {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #f2f0e9;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-foot {
  flex: 0 0 auto;
  margin-top: 14px;
  padding: 16px 12px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--forest);
}

.sidebar-account-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-account-actions button,
.sidebar-account-actions a {
  flex: 1;
  border: 1px solid rgba(242, 240, 233, 0.22);
  border-radius: 9px;
  padding: 7px 8px;
  background: transparent;
  color: #f2f0e9;
  text-align: center;
  text-decoration: none;
  font-size: 9px;
  cursor: pointer;
}

.user-mini {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(242, 240, 233, 0.22);
  border-radius: 11px;
  background: rgba(242, 240, 233, 0.04);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: white;
  font-weight: 800;
}

.user-mini strong,
.user-mini span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-mini strong {
  font-size: 13px;
}

.user-mini span {
  margin-top: 2px;
  color: #aaa79e;
  font-size: 11px;
}

.main {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 42px) 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: var(--font-sans);
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.top-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 15px;
  background: var(--forest);
  color: white;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 6px 15px rgba(25, 25, 23, 0.12);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.btn.ghost {
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--forest-2);
  box-shadow: none;
}

.btn.orange {
  background: var(--orange);
}

.btn.danger {
  border-color: var(--red);
  background: var(--red);
  color: white;
  box-shadow: 0 6px 15px rgba(168, 72, 66, 0.2);
}

.danger-note {
  grid-column: 1 / -1;
  padding: 15px 16px;
  border: 1px solid rgba(168, 72, 66, 0.35);
  border-radius: 12px;
  background: #f6deda;
  color: #6f2925;
}

.danger-note strong {
  display: block;
  margin-bottom: 5px;
}

.danger-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}

.hero-strip {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 28px 32px;
  border-radius: 24px;
  background: var(--forest);
  color: white;
  box-shadow: var(--shadow);
}

.hero-strip::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  border: 54px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
}

.hero-strip p {
  max-width: 630px;
  margin: 10px 0 0;
  color: #d4d1c8;
  line-height: 1.65;
}

.hero-strip .today {
  color: #f2f0e9;
  font-size: 12px;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 16px 0 26px;
}

.metric {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font: inherit;
}

.metric-link { cursor: pointer; transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.metric-link:hover { transform: translateY(-2px); border-color: #aaa69b; box-shadow: 0 12px 28px rgba(25, 25, 23, 0.08); }
.metric-link:focus-visible { outline: 3px solid rgba(25, 25, 23, 0.2); outline-offset: 2px; }
.metric-link-arrow { position: absolute; right: 18px; bottom: 17px; color: var(--muted); font-size: 10px; }

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 9px;
  font-family: var(--font-sans);
  font-size: 30px;
}

.metric i {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--forest-2);
}

.metric.attention i {
  background: var(--orange);
}

.metric.danger { border-color: rgba(177, 60, 47, 0.48); background: #fff7f5; }
.metric.danger > span, .metric.danger .metric-link-arrow { color: #8f2f25; }
.metric.danger i { background: #c23c2e; box-shadow: 0 0 0 6px rgba(194, 60, 46, 0.13); }

.quick-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 12px 15px; border: 1px solid #cec9bd; border-radius: 12px; background: #ebe8df; }
.quick-filter strong { font-size: 12px; }
.quick-filter button { border: 0; padding: 6px 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; }
.quick-filter.danger { border-color: rgba(177, 60, 47, 0.42); background: #fae8e4; color: #812c23; }
.project-card.risk { border-color: rgba(177, 60, 47, 0.5); }
.project-risk-badge { display: flex; align-items: center; gap: 7px; width: fit-content; margin-top: 12px; padding: 6px 9px; border-radius: 999px; background: #fae8e4; color: #8f2f25; font-size: 10px; font-weight: 800; }
.project-risk-badge i { width: 8px; height: 8px; border-radius: 50%; background: #c23c2e; box-shadow: 0 0 0 4px rgba(194, 60, 46, 0.12); }

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(43, 54, 51, 0.035);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 22px 14px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 0 22px 22px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipe-col {
  min-height: 280px;
  padding: 12px;
  border-radius: 14px;
  background: #f1efe9;
}

.pipe-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lead-card {
  width: 100%;
  margin-bottom: 9px;
  padding: 13px;
  border: 1px solid #e2ded4;
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.lead-card:hover {
  border-color: #b9c9c4;
  box-shadow: 0 6px 16px rgba(35, 53, 49, 0.07);
}

.lead-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.lead-card span,
.lead-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.lead-card small {
  margin-top: 8px;
  color: var(--orange);
  font-weight: 700;
}

.attention-list {
  display: grid;
  gap: 10px;
}

.attention-item {
  padding: 14px;
  border-radius: 12px;
  background: var(--orange-pale);
}

.attention-item strong {
  display: block;
  font-size: 13px;
}

.attention-item span {
  display: block;
  margin-top: 4px;
  color: #4b4a45;
  font-size: 11px;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.searchbox {
  min-width: min(100%, 320px);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.filter.active {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #e6e2d8;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f6f3ec;
}

.status,
.role-chip,
.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status.new,
.status.consulting {
  background: var(--orange-pale);
  color: #4b4a45;
}

.status.consulted,
.status.awaiting_assignment {
  background: #e4e1d7;
  color: #4b4a45;
}

.status.assigned,
.status.proposal_preparing {
  background: var(--sage);
  color: var(--ink);
}

.status.lost,
.status.hold {
  background: #eee9e6;
  color: #756c68;
}

.source-chip {
  background: #f1efe8;
  color: #55544e;
}

.role-chip {
  background: var(--sage);
  color: var(--forest-2);
}

.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}

.empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(18, 31, 29, 0.38);
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer {
  width: min(620px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 26px;
  background: var(--surface);
  box-shadow: -20px 0 55px rgba(20, 35, 32, 0.2);
}

.drawer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.detail-box {
  padding: 13px;
  border-radius: 12px;
  background: #f3f1eb;
}

.detail-box span,
.field-note {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.detail-box strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.section-rule {
  margin: 22px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  position: relative;
  padding-left: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.timeline-item strong {
  font-size: 12px;
}

.timeline-item p {
  margin: 5px 0 3px;
  color: #455254;
  font-size: 12px;
  line-height: 1.6;
}

.timeline-item small {
  color: var(--muted);
  font-size: 10px;
}

dialog {
  width: min(640px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 25px 80px rgba(18, 33, 30, 0.28);
}

dialog::backdrop {
  background: rgba(18, 31, 29, 0.5);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-body {
  padding: 22px 26px 26px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.payment-plan-builder {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f6ef;
}

.payment-plan-head,
.payment-plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-plan-head > div:first-child,
.payment-plan-summary {
  min-width: 0;
}

.payment-plan-head strong,
.payment-plan-head span { display: block; }
.payment-plan-head span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.payment-plan-head > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.payment-installment-list { display: grid; gap: 8px; }

.payment-installment {
  display: grid;
  grid-template-columns: 104px minmax(145px, .8fr) minmax(160px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dedacf;
  border-radius: 11px;
  background: white;
}

.payment-installment-label { align-self: center; }
.payment-installment-label b,
.payment-installment-label small { display: block; }
.payment-installment-label small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.payment-installment label { display: grid; gap: 5px; }
.payment-installment label span { color: var(--muted); font-size: 9px; }
.payment-installment input { padding: 9px 10px; }
.payment-installment-remove { min-height: 38px; padding: 0 10px; border: 1px solid #dfc5c1; border-radius: 9px; background: #f8eae7; color: #8d3934; font-size: 10px; font-weight: 800; cursor: pointer; }
.payment-installment-remove[hidden] { display: none; }
.payment-plan-summary { padding-top: 10px; border-top: 1px solid var(--line); }
.payment-plan-summary span { color: var(--muted); font-size: 10px; }
.payment-plan-summary strong { margin-left: auto; font-size: 16px; }
.payment-plan-summary small { color: #376650; font-size: 10px; font-weight: 750; }
.payment-plan-summary small.mismatch { color: #a84842; }

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field[hidden] {
  display: none !important;
}

label {
  font-size: 11px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(39, 85, 74, 0.1);
}

.field input[data-money],
.payment-installment input[data-money] {
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

.vat-calculation-note {
  grid-column: 1 / -1;
  margin-top: -4px;
  padding: 10px 12px;
  border: 1px solid #d8d3c7;
  border-radius: 10px;
  background: #f2f0e9;
  color: #5c5a54;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.access-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 15px 17px;
  border: 1px solid #cbded7;
  border-radius: 14px;
  background: var(--sage);
}

.access-guide strong {
  font-size: 12px;
}

.access-guide span {
  color: var(--forest-2);
  font-size: 10px;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 26px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(242, 240, 233, 0.38);
  border-radius: 18px;
  background: rgba(242, 240, 233, 0.12);
  font-size: 24px;
  font-weight: 800;
}

.profile-hero h2,
.profile-hero p {
  margin: 0;
}

.profile-hero h2 {
  margin: 4px 0;
  font-size: 24px;
}

.profile-hero span {
  color: #c9c6bc;
  font-size: 11px;
}

.profile-hero .btn {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-panel {
  padding: 20px;
}

.profile-list {
  display: grid;
  gap: 0;
}

.profile-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.profile-list span,
.profile-note span {
  color: var(--muted);
  font-size: 10px;
}

.profile-list strong {
  text-align: right;
  font-size: 11px;
}

.profile-note {
  margin-top: 14px;
  padding: 13px;
  border-radius: 11px;
  background: var(--paper);
}

.profile-note p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.55;
}

.profile-duties {
  margin-top: 8px;
}

.profile-help,
.security-panel > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.security-panel {
  grid-column: 1 / -1;
}

.passkey-section {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.passkey-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.passkey-section-head > div { display: grid; gap: 5px; }
.passkey-section-head strong { font-size: 13px; }
.passkey-section-head span { max-width: 680px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.passkey-devices { display: grid; gap: 8px; }

.passkey-device {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}

.passkey-device > i { width: 17px; height: 20px; color: var(--ink); }
.passkey-device > div { display: grid; gap: 3px; min-width: 0; }
.passkey-device strong { font-size: 11px; }
.passkey-device span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.passkey-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
}

.passkey-empty strong { font-size: 11px; }
.passkey-empty span,
.passkey-domain-note,
.passkey-unsupported { color: var(--muted); font-size: 9px; line-height: 1.5; }

.integration-token-panel { display: grid; gap: 14px; }
.pat-devices { margin-top: 2px; }
.pat-device.inactive { opacity: .58; }
.pat-device > i {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--paper);
  background: currentColor;
}
.pat-secret {
  display: grid;
  gap: 9px;
  padding: 15px;
  border: 1px solid var(--ink);
  border-radius: 13px;
  background: var(--paper);
}
.pat-secret > strong { font-size: 12px; }
.pat-secret > span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.pat-secret textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 68px;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  resize: none;
}

.team-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.team-card.inactive {
  opacity: 0.58;
}

.login-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 14px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #ebe7dc;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.login-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaa69c;
}

.login-state.ready {
  background: var(--ink);
  color: var(--paper);
}

.login-state.ready i {
  background: #cddfc0;
}

.team-account-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.invite-password-note {
  padding: 12px 14px;
  border-left: 3px solid var(--ink);
  background: var(--paper);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.team-card-head,
.team-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-card .avatar {
  margin-bottom: 13px;
}

.team-card-head .avatar {
  margin-bottom: 13px;
}

.team-card p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.team-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.account-chip,
.duty-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.account-chip {
  padding: 5px 9px;
  background: #edf1ef;
  color: var(--forest-2);
}

.account-chip.external {
  background: var(--orange-pale);
  color: #4b4a45;
}

.duty-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 26px;
}

.duty-chip {
  padding: 5px 8px;
  background: #f0eee8;
  color: #566260;
}

.duty-chip.muted {
  color: var(--muted);
}

.duty-field {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfaf7;
}

.duty-field legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
}

.duty-field > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
}

.duty-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.duty-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e4e0d6;
  border-radius: 10px;
  background: white;
  cursor: pointer;
}

.duty-option:has(input:checked) {
  border-color: var(--forest-2);
  background: var(--sage);
}

.duty-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.duty-option span,
.duty-option small {
  display: block;
}

.duty-option strong {
  display: block;
  font-size: 10px;
}

.duty-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: 340px;
  padding: 13px 17px;
  border-radius: 12px;
  background: var(--forest);
  color: white;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.error-card {
  max-width: 560px;
  margin: 12vh auto;
  padding: 30px;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
}

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

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

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

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px 14px 10px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .attendance-quick {
    max-width: 360px;
    margin-bottom: 10px;
  }

  .brand-copy span,
  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav button {
    width: auto;
    flex: 0 0 auto;
  }

  .main {
    padding: 18px 14px 36px;
  }

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

  .hero-strip {
    padding: 24px;
  }

  .metrics,
  .team-grid,
  .profile-grid,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-hero .btn {
    grid-column: 1 / -1;
  }

  .security-panel {
    grid-column: auto;
  }

  .access-guide {
    align-items: flex-start;
    flex-direction: column;
  }

  .duty-options {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }
}

/* PWA install and assigned-work notifications */
.push-prompt[hidden],
.task-alert[hidden] { display: none !important; }

.push-prompt {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  width: min(560px, calc(100vw - 44px));
  padding: 20px 22px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid rgba(242, 240, 233, 0.18);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(25, 25, 23, 0.3);
}
.push-prompt > div:first-child { display: grid; gap: 4px; }
.push-prompt span { color: rgba(242, 240, 233, 0.55); font-size: 8px; font-weight: 800; letter-spacing: 0.14em; }
.push-prompt strong { font-size: 15px; }
.push-prompt p { margin: 0; color: rgba(242, 240, 233, 0.68); font-size: 10px; line-height: 1.5; }
.push-prompt > div:last-child { display: flex; align-items: center; gap: 7px; }
.push-prompt button {
  padding: 9px 11px;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(242, 240, 233, 0.25);
  border-radius: 9px;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}
.push-prompt button.primary { color: var(--ink); background: var(--paper); border-color: var(--paper); }

.task-alert {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 100;
  display: grid;
  gap: 14px;
  width: min(420px, calc(100vw - 44px));
  padding: 20px;
  color: var(--ink);
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(25, 25, 23, 0.26);
  animation: task-alert-in 0.22s ease-out;
}
.task-alert > div:first-child { display: grid; gap: 5px; }
.task-alert span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 0.14em; }
.task-alert strong { font-size: 16px; }
.task-alert p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.task-alert-actions { display: flex; justify-content: flex-end; gap: 8px; }
.task-alert-actions button { padding: 9px 12px; background: transparent; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 9px; font-weight: 800; cursor: pointer; }
.task-alert-actions button:last-child { color: var(--paper); background: var(--ink); border-color: var(--ink); }
@keyframes task-alert-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

.push-settings-panel { align-content: start; }
.push-settings-panel > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.push-settings-panel > small { color: var(--muted); font-size: 9px; }
.push-state { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.push-state.on { color: #245b43; background: #e2eee7; border-color: #b9d3c4; }
.push-state.off { color: var(--muted); background: var(--surface-2); }

@media (max-width: 680px) {
  .push-prompt { right: 12px; bottom: 12px; grid-template-columns: 1fr; width: calc(100vw - 24px); padding: 18px; }
  .push-prompt > div:last-child { justify-content: flex-end; flex-wrap: wrap; }
  .task-alert { top: auto; right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    display: none;
  }

  .login-panel {
    position: relative;
    min-height: 100svh;
    align-content: center;
    padding: 92px 24px 48px;
  }

  .login-panel::before {
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    background: var(--ink);
    content: "";
  }

  .login-mobile-brand {
    position: absolute;
    top: 34px;
    left: 24px;
    display: flex;
  }

  .login-mobile-symbol {
    width: 31px;
    height: 32px;
  }
}

@media (max-width: 520px) {
  .login-card h2 {
    font-size: 31px;
  }

  .login-description {
    margin-bottom: 28px;
  }

  .login-help {
    align-items: flex-start;
    flex-direction: column;
  }

  .team-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .team-account-buttons {
    justify-content: flex-start;
  }
}

/* GPS attendance */
.attendance-consent,
.attendance-punch,
.office-location-card,
.site-attendance-card,
.attendance-privacy-note {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.attendance-consent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  margin-bottom: 14px;
  background: #fffaf0;
  border-color: rgba(222, 113, 58, 0.28);
}

.attendance-consent h2,
.attendance-consent p {
  margin: 0;
}

.attendance-consent h2 {
  margin: 4px 0 7px;
  font-size: 20px;
}

.attendance-consent p:last-child {
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.attendance-consent-ok {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}

.attendance-consent-ok::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3e7b62;
  content: "";
}

.attendance-consent-ok button,
.site-attendance-foot button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.site-attendance-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-attendance-foot button.danger {
  color: #a43d35;
  font-weight: 800;
}

.attendance-policy.danger {
  border: 1px solid rgba(164, 61, 53, 0.28);
  background: #fff2ef;
}

.attendance-delete-warning {
  display: block;
  margin-bottom: 7px;
  color: #a43d35;
}

.attendance-punch {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(440px, 1.2fr);
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 18px 50px rgba(25, 25, 23, 0.15);
}

.punch-date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.punch-date span,
.punch-date small {
  color: rgba(242, 240, 233, 0.62);
  font-size: 11px;
}

.punch-date strong {
  margin: 9px 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.punch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(242, 240, 233, 0.16);
}

.punch-actions.single {
  grid-template-columns: 1fr;
}

.punch-button {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  padding: 28px;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.punch-button:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-2px);
}

.punch-button.check-out {
  background: #d9d6cd;
}

.punch-button.transfer {
  background: #f0c4a8;
}

.attendance-route-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: -12px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.attendance-route-guide article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.64);
}

.attendance-route-guide b {
  grid-row: 1 / 3;
  color: var(--orange);
  font-size: 10px;
}

.attendance-route-guide strong {
  font-size: 12px;
}

.attendance-route-guide span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.punch-button span {
  color: var(--muted);
  font-size: 11px;
}

.punch-button strong {
  font-size: 24px;
}

.punch-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.expected-section,
.attendance-admin {
  margin: 30px 0;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-title h2,
.section-title p {
  margin: 0;
}

.section-title > span {
  max-width: 540px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: right;
}

.expected-grid,
.site-attendance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.expected-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.expected-location span,
.expected-location p,
.expected-location > strong {
  color: var(--muted);
  font-size: 10px;
}

.expected-location h2,
.expected-location p {
  margin: 4px 0 0;
}

.expected-location h2 {
  font-size: 17px;
}

.expected-location.missing {
  grid-column: 1 / -1;
  border-style: dashed;
}

.attendance-history {
  margin: 28px 0;
}

.attendance-event {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dfe9e2;
  color: #315e4a;
  font-size: 9px;
  font-weight: 800;
}

.attendance-event.check_out {
  background: #e8e4da;
  color: #5d584e;
}

.attendance-event.transfer_departure {
  background: #f5d9c8;
  color: #8a3f19;
}

.attendance-event.resume_after_transfer {
  background: #dbe8f0;
  color: #315a73;
}

.office-location-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  margin-bottom: 14px;
  background: var(--ink);
  color: var(--paper);
}

.office-location-card.missing {
  background: #e7e3d8;
  color: var(--ink);
}

.office-location-card h2,
.office-location-card p {
  margin: 4px 0;
}

.office-location-card span,
.office-location-card small,
.office-location-card p {
  color: rgba(242, 240, 233, 0.62);
  font-size: 10px;
}

.office-location-card.missing span,
.office-location-card.missing p {
  color: var(--muted);
}

.site-attendance-grid {
  margin: 14px 0 24px;
}

.attendance-assignment-board {
  margin: 14px 0 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

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

.attendance-assignment-head strong,
.attendance-assignment-head span {
  display: block;
}

.attendance-assignment-head strong {
  font-size: 14px;
}

.attendance-assignment-head span {
  max-width: 650px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.attendance-assignment-head > b {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 8px;
}

.employee-workplace-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.employee-workplace-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.employee-workplace-card > div:first-child,
.employee-workplace-card > div:first-child strong,
.employee-workplace-card > div:first-child small {
  display: block;
}

.employee-workplace-card > div:first-child small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.employee-workplace-card > b {
  display: block;
  margin: 9px 0 7px;
  font-size: 9px;
}

.employee-workplace-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.employee-workplace-list span {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e0ebe4;
  color: #315e4a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-workplace-list span.empty {
  background: #ebe7dd;
  color: var(--muted);
}

.site-attendance-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.6);
}

.site-attendance-card.inactive {
  opacity: 0.56;
}

.site-attendance-card h3,
.site-attendance-card p {
  margin: 7px 0;
}

.site-attendance-card > small {
  color: var(--muted);
  font-size: 10px;
}

.site-attendance-top,
.site-attendance-foot,
.assigned-people {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-attendance-top span,
.site-attendance-top b,
.site-attendance-foot,
.assigned-people {
  font-size: 10px;
}

.site-attendance-top b {
  padding: 4px 7px;
  border-radius: 999px;
  background: #dfe9e2;
  color: #315e4a;
}

.assigned-people {
  align-items: flex-start;
  margin: 16px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.assigned-people span {
  max-width: 70%;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
}

.recent-attendance {
  margin-top: 14px;
}

.attendance-privacy-note {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  padding: 20px 24px;
  background: rgba(25, 25, 23, 0.04);
}

.attendance-privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.attendance-policy {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(242, 240, 233, 0.72);
}

.attendance-policy dl {
  margin: 14px 0;
}

.attendance-policy dl > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.attendance-policy dt {
  font-weight: 800;
}

.attendance-policy dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.attendance-policy.compact {
  padding: 12px;
}

.policy-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  font-weight: 750;
  line-height: 1.5;
  cursor: pointer;
}

.policy-agree input,
.attendance-employee-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--ink);
}

.gps-location-capture {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px dashed rgba(25, 25, 23, 0.28);
  border-radius: var(--radius);
}

.workplace-address-field {
  grid-column: 1 / -1;
}

.workplace-address-field > label,
.workplace-address-field > small {
  display: block;
}

.workplace-address-field > label {
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 800;
}

.workplace-address-field > small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.workplace-address-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.workplace-address-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.address-search-tools {
  display: flex;
  justify-content: flex-end;
  margin-top: 7px;
}

.address-search-tools button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--forest-2);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.address-search-results[hidden] {
  display: none;
}

.address-search-results {
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.address-search-list {
  display: grid;
  max-height: 280px;
  overflow-y: auto;
}

.address-search-list button {
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.address-search-list button:hover {
  background: var(--paper);
}

.address-search-list strong,
.address-search-list span {
  display: block;
}

.address-search-list strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.address-search-list span,
.address-provider-credit,
.address-search-loading,
.address-search-empty {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.address-provider-credit,
.address-search-loading,
.address-search-empty {
  display: block;
  padding: 10px 14px;
}

.address-search-empty strong,
.address-search-empty span {
  display: block;
}

.address-search-empty strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 10px;
}

.address-selected-result {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
}

.address-selected-result strong {
  font-size: 11px;
}

.address-selected-result span,
.address-selected-result small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.postcode-layer {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 25, 23, 0.62);
}

.postcode-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(560px, 100%);
  height: min(720px, calc(100dvh - 40px));
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(25, 25, 23, 0.3);
}

.postcode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.postcode-head div,
.postcode-head strong,
.postcode-head span {
  display: block;
}

.postcode-head strong {
  font-size: 13px;
}

.postcode-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.postcode-frame {
  min-height: 420px;
}

.workplace-coordinate-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eee9de;
  color: var(--muted);
  font-size: 9px;
}

.workplace-coordinate-status i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9b9588;
}

.workplace-coordinate-status.ready {
  background: #e0ebe4;
  color: #315e4a;
}

.workplace-coordinate-status.ready i {
  background: #3e7b62;
}

.gps-location-capture strong,
.gps-location-capture span {
  display: block;
}

.gps-location-capture span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.attendance-employee-field {
  grid-column: 1 / -1;
  padding: 0;
  border: 0;
}

.attendance-employee-field legend {
  font-weight: 800;
}

.attendance-employee-field > p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 9px;
}

.attendance-employee-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.attendance-employee-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.attendance-employee-option strong,
.attendance-employee-option small,
.attendance-employee-option em {
  display: block;
}

.attendance-employee-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.attendance-employee-option em {
  margin-top: 6px;
  color: #315e4a;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

@media (max-width: 900px) {
  .attendance-punch {
    grid-template-columns: 1fr;
  }

  .punch-button {
    min-height: 140px;
  }

  .expected-grid,
  .site-attendance-grid,
  .employee-workplace-grid {
    grid-template-columns: 1fr;
  }

  .attendance-route-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .attendance-consent,
  .section-title,
  .office-location-card,
  .gps-location-capture,
  .attendance-assignment-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .punch-actions,
  .attendance-employee-options,
  .attendance-privacy-note {
    grid-template-columns: 1fr;
  }

  .attendance-route-guide,
  .workplace-address-search {
    grid-template-columns: 1fr;
  }

  .section-title > span,
  .assigned-people span {
    max-width: none;
    text-align: left;
  }

  .attendance-policy dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .boot-video,
  .boot-skip { display: none; }
}

/* BESPACE OS v1 product surfaces */
.boot {
  text-align: center;
}

.boot-symbol {
  width: 38px;
  height: 40px;
  gap: 4px;
  color: var(--ink);
}

.sidebar-symbol {
  width: 34px;
  height: 35px;
  color: var(--paper);
}

.content {
  display: grid;
  gap: 18px;
}

.demo-chip,
.count-chip,
.result-count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.count-chip,
.result-count {
  background: var(--sage);
  color: var(--forest);
  letter-spacing: 0;
  font-size: 10px;
}

.metric small {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-grid {
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
}

.dashboard-work-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 38px rgba(25, 25, 23, 0.04);
}

.dashboard-work-head,
.dashboard-work-section-head,
.dashboard-work-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-work-head h2 {
  margin: 3px 0 4px;
  font-size: clamp(21px, 2vw, 28px);
}

.dashboard-work-head > div > span,
.dashboard-work-section-head p {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-people {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 6px;
  scrollbar-width: thin;
}

.dashboard-person-chip {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  min-width: 112px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 36px 10px 12px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.dashboard-person-chip:hover,
.dashboard-person-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.dashboard-person-chip strong { font-size: 12px; white-space: nowrap; }
.dashboard-person-chip small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.dashboard-person-chip.active small { color: rgba(242, 240, 233, 0.66); }
.dashboard-person-chip > span {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
  font-size: 9px;
  font-weight: 900;
  transform: translateY(-50%);
}

.dashboard-work-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-work-columns > article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
}

.dashboard-work-section-head {
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.dashboard-work-section-head h3 { margin: 0 0 3px; font-size: 15px; }
.dashboard-work-section-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  font-weight: 900;
}

.dashboard-work-list { display: grid; }
.dashboard-work-list > .empty-state { margin: 12px; }
.dashboard-work-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  transition: opacity 0.16s ease, background 0.16s ease;
}
.dashboard-work-row:last-child { border-bottom: 0; }
.dashboard-work-row:hover { background: rgba(25, 25, 23, 0.025); }
.dashboard-work-row.overdue { background: #fff7f5; }
.dashboard-work-row.done { opacity: 0.55; }
.dashboard-work-row.done .dashboard-work-title-line > button { text-decoration: line-through; }
.dashboard-work-row.is-saving { opacity: 0.65; }

.dashboard-work-check,
.dashboard-work-progress {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #aaa79e;
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
button.dashboard-work-check { cursor: pointer; }
button.dashboard-work-check:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.dashboard-work-check.view-only { opacity: 0.45; }
.dashboard-work-progress { grid-template-columns: auto auto; align-content: center; gap: 1px; border-radius: 50%; }
.dashboard-work-progress strong { font-size: 10px; }
.dashboard-work-progress span { font-size: 7px; }
.dashboard-work-copy { min-width: 0; }
.dashboard-work-title-line > button {
  min-width: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.dashboard-work-title-line > em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 6px;
  background: #ebe9e2;
  color: #68655e;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}
.dashboard-work-title-line > em.priority-high { background: #f7dfdb; color: #9c2b2b; }
.dashboard-work-copy > small,
.dashboard-work-due { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.dashboard-work-due.overdue { color: #ae3c33; font-weight: 800; }
.dashboard-work-due.today { color: var(--forest); font-weight: 800; }
.dashboard-work-subtasks { display: grid; gap: 5px; margin-top: 9px; }
.dashboard-work-subtask {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 5px 7px;
  background: #eeece5;
  color: var(--ink);
  text-align: left;
}
button.dashboard-work-subtask { cursor: pointer; }
button.dashboard-work-subtask:hover { background: #e3e0d6; }
.dashboard-work-subtask i { display: grid; width: 16px; height: 16px; place-items: center; border: 1px solid #aaa79e; border-radius: 5px; background: white; font-size: 9px; font-style: normal; }
.dashboard-work-subtask span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-work-subtask.done span { color: var(--muted); text-decoration: line-through; }
.dashboard-work-subtask.is-saving { opacity: 0.55; }
.dashboard-work-more {
  justify-self: center;
  border: 0;
  padding: 2px 8px;
  background: none;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.project-list,
.work-list,
.finance-list {
  display: grid;
  gap: 9px;
}

.project-row,
.work-item,
.finance-item {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(90px, 0.7fr) 50px auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: white;
  text-align: left;
}

button.project-row,
button.project-card {
  cursor: pointer;
}

.project-row:hover,
.project-card:hover {
  border-color: var(--forest-2);
  box-shadow: 0 8px 22px rgba(24, 53, 47, 0.08);
}

.project-row div:first-child,
.work-item div:first-child,
.finance-item div:first-child {
  display: grid;
  gap: 4px;
}

.project-row strong,
.work-item strong,
.finance-item strong {
  font-size: 12px;
}

.project-row span,
.work-item span,
.finance-item span {
  color: var(--muted);
  font-size: 10px;
}

.project-row em {
  color: var(--forest);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.progress {
  position: relative;
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e4e7e2;
}

.progress i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ink), #5a5953);
}

.progress.large {
  height: 9px;
}

.progress.cell {
  min-width: 80px;
}

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

.project-empty-state {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding-bottom: 24px;
}

.project-empty-state .empty {
  padding-bottom: 16px;
}

.project-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  text-align: left;
  transition: 0.18s ease;
}

.project-card h2,
.project-card p {
  margin: 0;
}

.project-card h2 {
  font-size: 17px;
  letter-spacing: -0.04em;
}

.project-card p {
  color: var(--muted);
  font-size: 10px;
}

.project-card-top,
.project-card-foot,
.money-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-card-top > span:first-child {
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.project-card-foot strong,
.project-card-foot span,
.money-strip span,
.money-strip em {
  font-size: 10px;
}

.project-card-foot span,
.money-strip span {
  color: var(--muted);
}

.money-strip {
  margin: 2px -20px -20px;
  padding: 12px 20px;
  border-radius: 0 0 16px 16px;
  background: var(--sage);
}

.money-strip strong {
  margin-left: auto;
  font-size: 13px;
}

.money-strip em {
  color: var(--forest-2);
  font-style: normal;
  font-weight: 900;
}

td strong + small,
td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

tr[data-action] {
  cursor: pointer;
}

tr[data-action]:hover td {
  background: #ece9e1;
}

.status.proposal_submitted,
.status.proposal_passed,
.status.estimate_preparing,
.status.estimate_submitted,
.status.negotiating,
.status.contract_expected,
.status.customer_review,
.status.submitted,
.status.needs_review,
.status.partial {
  background: #e7e4da;
  color: #4b4a45;
}

.status.contracted,
.status.active,
.status.completed,
.status.approved,
.status.paid,
.status.closed {
  background: #dcd9cf;
  color: var(--ink);
}

.status.rejected,
.status.overdue {
  background: #f6deda;
  color: var(--red);
}

.btn.primary {
  background: var(--forest);
  color: white;
}

.btn.small {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 9px;
}

.drawer-actions {
  position: sticky;
  top: -1px;
  z-index: 2;
  margin: 0 -26px;
  padding: 12px 26px;
  border-block: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(8px);
}

.project-drawer {
  width: min(880px, calc(100vw - 30px));
}

.drawer-section {
  margin-top: 24px;
}

.finance-item {
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
}

.finance-grid {
  grid-template-columns: minmax(620px, 1.4fr) minmax(280px, 0.6fr);
}

.panel.wide {
  min-width: 0;
}

.positive {
  color: var(--ink);
  font-weight: 800;
}

.negative {
  color: var(--red);
  font-weight: 800;
}

.code {
  color: var(--forest-2);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.team-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
}

.field.checkbox {
  align-content: center;
  min-height: 44px;
}

.field.checkbox label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.field.checkbox input {
  width: 16px;
  height: 16px;
}

.toast.bad {
  background: var(--red);
}

.error-symbol {
  width: 38px;
  height: 40px;
  gap: 4px;
  margin-bottom: 12px;
}

body.drawer-open {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .boot {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .sidebar-symbol {
    width: 31px;
    height: 32px;
  }

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

  .project-row,
  .work-item,
  .finance-item {
    grid-template-columns: 1fr;
  }

  .project-row .progress,
  .work-item .progress {
    width: 100%;
  }

  .drawer-actions {
    position: static;
    margin-inline: -18px;
    padding-inline: 18px;
  }

  .top-actions .role-chip {
    display: none;
  }
}

/* Calendar workspaces */
.site-calendar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.38fr);
  gap: 16px;
  margin-bottom: 16px;
}

.site-picker,
.site-progress {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.site-picker {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.site-picker label,
.site-progress span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.site-picker select {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 7px 26px 7px 2px;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.site-picker > span {
  color: var(--muted);
  font-size: 11px;
}

.site-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 16px;
}

.site-progress strong {
  font-size: 24px;
}

.site-progress .progress {
  grid-column: 1 / -1;
}

.calendar-panel,
.expanded-week,
.goal-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(25, 25, 23, 0.035);
}

.calendar-panel,
.expanded-week {
  padding: 20px;
  overflow-x: auto;
}

.calendar-toolbar,
.goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calendar-toolbar {
  margin-bottom: 18px;
}

.calendar-toolbar h2,
.goal-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.calendar-toolbar > div > span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.calendar-weekdays,
.calendar-grid {
  min-width: 840px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 13px 13px 0 0;
  background: var(--ink);
  color: var(--paper);
}

.calendar-weekdays span {
  padding: 9px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
}

.calendar-day {
  min-width: 0;
  min-height: 128px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}

.calendar-day:nth-child(7n + 1) {
  border-left: 1px solid var(--line);
}

.calendar-day.outside {
  background: #e9e6dd;
  color: #929087;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.calendar-day-head {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day-head time {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.calendar-day.today .calendar-day-head time {
  background: var(--ink);
  color: var(--paper);
}

.calendar-add,
.week-day-card header button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.calendar-events {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}

.calendar-event,
.work-event {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
}

.calendar-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 7px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 9px;
}

.calendar-event span,
.work-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event b {
  flex: 0 0 auto;
  font-size: 8px;
}

.calendar-event.in_progress {
  background: var(--ink);
  color: var(--paper);
}

.calendar-event.completed {
  opacity: 0.58;
  text-decoration: line-through;
}

.calendar-more {
  padding: 2px 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.calendar-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-2);
}

.calendar-legend i.in-progress {
  background: var(--ink);
}

.calendar-legend i.completed {
  border: 1px solid var(--ink);
  background: transparent;
}

.calendar-legend small {
  margin-left: auto;
}

.work-calendar-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.work-calendar-summary article {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.work-calendar-summary article.focus {
  background: var(--ink);
  color: var(--paper);
}

.work-calendar-summary span,
.work-calendar-summary small,
.week-empty {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.work-calendar-summary .focus span,
.work-calendar-summary .focus small {
  color: #c8c5bb;
}

.work-calendar-summary strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 26px;
}

.work-scope-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--ink);
  border-radius: 15px;
  background: var(--surface);
}

.work-scope-bar strong,
.work-scope-bar > div > span {
  display: block;
}

.work-scope-bar strong {
  margin: 4px 0;
  font-size: 15px;
}

.work-scope-bar > div > span,
.work-scope-bar label > span {
  color: var(--muted);
  font-size: 10px;
}

.work-scope-bar label {
  min-width: 260px;
}

.work-scope-bar label > span {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.work-scope-bar select {
  width: 100%;
  min-height: 42px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.work-team-board,
.work-focus-panel,
.work-selection-empty,
.work-calendar-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.work-team-board,
.work-focus-panel {
  margin-bottom: 16px;
  padding: 20px;
}

.work-team-head,
.work-focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.work-team-head h2,
.work-focus-head h2 {
  margin: 2px 0 6px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.work-team-head > div > span,
.work-focus-head > div > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.work-employee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}

.work-employee-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f5ee;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.work-employee-card:hover,
.work-employee-card:focus-visible {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.work-employee-card.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.work-employee-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #dedbd1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.work-employee-copy,
.work-employee-copy strong,
.work-employee-copy small {
  min-width: 0;
  display: block;
}

.work-employee-copy strong,
.work-employee-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-employee-copy strong {
  font-size: 12px;
}

.work-employee-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.work-employee-card.selected .work-employee-copy small {
  color: rgba(242, 240, 233, 0.62);
}

.work-employee-card > em {
  padding: 3px 5px;
  border-radius: 5px;
  background: #f1d9d4;
  color: #8e3731;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}

.work-employee-counts {
  display: flex;
  align-items: center;
  gap: 4px;
}

.work-employee-counts b {
  min-width: 40px;
  padding: 6px 7px;
  border-radius: 8px;
  background: #e8e5db;
  color: var(--ink);
  text-align: center;
  font-size: 11px;
}

.work-employee-counts b.important {
  background: #d7d4ca;
}

.work-employee-counts small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
}

.work-calendar-summary.compact {
  margin-top: 0;
}

.work-selection-empty {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
}

.work-selection-empty > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.work-selection-empty strong,
.work-selection-empty span,
.work-focus-empty strong,
.work-focus-empty span {
  display: block;
}

.work-selection-empty strong,
.work-focus-empty strong {
  font-size: 13px;
}

.work-selection-empty span,
.work-focus-empty span {
  max-width: 580px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.read-only-chip {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.work-focus-list {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.work-focus-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid #77756e;
  border-radius: 11px;
  background: #f8f6f0;
  color: var(--ink);
  text-align: left;
}

button.work-focus-item {
  cursor: pointer;
}

button.work-focus-item:hover,
button.work-focus-item:focus-visible {
  border-color: var(--ink);
}

.work-focus-item.priority-high {
  border-left-color: var(--ink);
  background: #e8e5db;
}

.work-focus-item.priority-low {
  border-left-color: #bbb8ae;
}

.work-focus-item.sales-inquiry {
  border-color: #d98958;
  border-left-color: #c85f2c;
  background: #f6e1d3;
}

.work-focus-item.sales-inquiry.priority-high {
  border-left-color: #9f3f18;
  background: #f2d1bd;
}

.work-focus-item.done {
  opacity: 0.62;
}

.work-focus-item.is-saving,
.work-event.is-saving,
.goal-item.is-saving,
.work-checklist-item.is-saving {
  opacity: 0.78;
}

.work-focus-item,
.work-event,
.goal-item,
.work-checklist-item {
  transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.work-focus-check {
  width: 24px;
  height: 24px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
}

button.work-focus-item:hover .work-focus-check::after {
  content: "✓";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 10px;
}

button.work-focus-check {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.work-focus-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.work-focus-copy,
.work-focus-copy strong,
.work-focus-copy small {
  min-width: 0;
  display: block;
}

.work-focus-copy strong {
  margin: 5px 0 4px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-focus-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-focus-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.work-focus-badges b,
.work-focus-badges em {
  padding: 2px 5px;
  border-radius: 4px;
  background: #d9d6cc;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.work-focus-badges em {
  background: var(--ink);
  color: var(--paper);
}

.work-focus-badges em.pending {
  background: #f1d9d4;
  color: #8e3731;
}

.work-focus-due {
  min-width: 120px;
  text-align: right;
}

.work-focus-due strong,
.work-focus-due span {
  display: block;
}

.work-focus-due strong {
  font-size: 10px;
}

.work-focus-due.overdue strong {
  color: #8e3731;
}

.work-focus-due span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.work-focus-empty {
  padding: 24px 4px;
}

.work-calendar-details {
  margin-top: 16px;
  overflow: hidden;
}

.work-calendar-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
}

.work-calendar-details > summary::-webkit-details-marker {
  display: none;
}

.work-calendar-details > summary strong,
.work-calendar-details > summary span {
  display: block;
}

.work-calendar-details > summary strong {
  font-size: 12px;
}

.work-calendar-details > summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.work-calendar-details > summary b {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
}

.work-calendar-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.work-calendar-detail-body {
  padding: 16px;
  background: #ece9e1;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.goal-panel {
  padding: 20px;
}

.goal-panel.weekly {
  border-color: var(--ink);
}

.goal-list {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}

.goal-item {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f5ee;
  text-align: left;
  cursor: pointer;
}

.goal-item i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 7px;
  font-style: normal;
  font-size: 11px;
}

.goal-item.done {
  opacity: 0.58;
}

.goal-item.done span {
  text-decoration: line-through;
}

.goal-item:not(button) {
  cursor: default;
}

.goal-item span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  text-decoration: none;
}

.goal-empty {
  padding: 18px 3px;
  color: var(--muted);
  font-size: 11px;
}

.work-month-panel {
  margin-bottom: 16px;
}

.primary-work-calendar {
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(25, 25, 23, 0.06);
}

.work-day {
  min-height: 108px;
  cursor: pointer;
}

.work-day.selected-week {
  background: #dedbd1;
}

.work-day.outside.selected-week {
  background: #d7d4ca;
}

.work-day .calendar-day-head > span {
  color: var(--muted);
  font-size: 9px;
}

.work-owner-groups {
  display: grid;
  gap: 5px;
}

.work-owner-group {
  min-width: 0;
}

.work-owner-group > summary {
  position: relative;
  z-index: 3;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid #c9c6bc;
  border-radius: 8px;
  background: #f7f5ee;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-size: 9px;
  font-weight: 850;
}

.work-owner-group > summary::-webkit-details-marker {
  display: none;
}

.work-owner-group > summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-owner-group > summary b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 8px;
}

.work-owner-group > summary:hover,
.work-owner-group > summary:focus-visible,
.work-owner-group[open] > summary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  outline: 0;
}

.work-owner-group[open] > summary b {
  background: var(--paper);
  color: var(--ink);
}

.work-owner-group.all-done > summary {
  opacity: 0.58;
}

.work-owner-tasks {
  display: grid;
  gap: 4px;
  padding: 5px 0 2px 5px;
  transform-origin: top;
}

.work-owner-group[open] .work-owner-tasks {
  animation: work-owner-reveal 0.18s ease-out;
}

.work-owner-group .owner-badge {
  display: none;
}

@keyframes work-owner-reveal {
  from { opacity: 0; transform: translateY(-4px) scaleY(0.97); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.work-event {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border-left: 3px solid #77756e;
  background: #e6e3d9;
  color: var(--ink);
  font-size: 9px;
}

.work-event-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.work-event-open:hover {
  background: rgba(25, 25, 23, 0.035);
}

.work-event-open:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.work-event-top {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
}

.work-event-check {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.work-event-check:hover,
.work-event-check:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.work-event-check.view-only {
  opacity: 0.45;
  cursor: default;
}

.work-event-check:disabled,
.work-focus-check:disabled,
.goal-item:disabled,
.work-checklist-item:disabled {
  cursor: wait;
}

.work-event:not(button) {
  cursor: default;
}

.work-event-badges {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.work-event .work-event-badges {
  overflow: visible;
  white-space: normal;
}

.owner-badge {
  width: fit-content;
  padding: 2px 4px;
  border: 1px solid #aaa79e;
  border-radius: 3px;
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  text-decoration: none;
}

.work-event.priority-high {
  border-left-color: var(--ink);
  background: #d7d4ca;
  font-weight: 800;
}

.work-event.priority-low {
  border-left-color: #aaa79e;
  color: var(--muted);
}

.work-event.sales-inquiry,
.work-event.sales-inquiry.priority-high,
.work-event.sales-inquiry.priority-low {
  border-left-color: #c85f2c;
  background: #f2d1bd;
  color: #5c2b16;
}

.work-event.sales-inquiry.priority-high {
  border-left-color: #9f3f18;
  background: #ecc3aa;
}

.sales-inquiry-badge,
.inquiry-channel-badge,
.work-category-badge {
  width: fit-content;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
  text-decoration: none;
}

.sales-inquiry-badge {
  background: #191917;
  color: #f2f0e9;
}

.inquiry-channel-badge {
  border: 1px solid #c85f2c;
  background: #fff8f3;
  color: #7c3518;
}

.work-category-badge {
  border: 1px solid #aaa79e;
  background: #f7f5ee;
  color: #4f4e49;
}

.work-category-badge.category-internal {
  border-color: #191917;
  background: #191917;
  color: #f2f0e9;
}

.work-category-badge.category-design { border-style: dashed; }
.work-category-badge.category-construction { border-width: 2px; }
.work-category-badge.category-finance { background: #dedbd1; }

.work-focus-badges .sales-inquiry-badge {
  border-radius: 999px;
  background: #191917;
  color: #f2f0e9;
  letter-spacing: 0;
}

.work-focus-badges .inquiry-channel-badge {
  border: 1px solid #c85f2c;
  border-radius: 999px;
  background: #fff8f3;
  color: #7c3518;
  letter-spacing: 0;
}

.inquiry-status-view,
.inquiry-status-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #6a3a25;
  font-size: 8px;
  font-weight: 850;
  text-decoration: none;
}

.inquiry-status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border: 2px solid #8b877e;
  border-radius: 50%;
  background: transparent;
}

.inquiry-status-dot.status-contacted { border-color: #48765a; background: #5b916d; }
.inquiry-status-dot.status-kakao_consulting { border-color: #8c741f; background: #f4d64b; }
.inquiry-status-dot.status-phone_consulting { border-color: #4d6e84; background: #6d96ad; }
.inquiry-status-dot.status-meeting_scheduled { border-color: #a84e24; background: #df7948; }
.inquiry-status-dot.status-closed { border-color: #191917; background: #191917; }

.inquiry-status-control {
  padding: 5px 7px;
  border: 1px solid #d8a586;
  border-radius: 8px;
  background: #fff8f3;
}

.inquiry-status-control select {
  max-width: 150px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #5c2b16;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.work-event small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
}

.notion-badge {
  width: fit-content;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font-size: 6px;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.pending-member-badge {
  width: fit-content;
  padding: 2px 4px;
  border-radius: 3px;
  background: #f1d9d4;
  color: #8e3731;
  font-size: 6px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.work-event.done {
  opacity: 0.5;
  text-decoration: none;
}

.work-event.done .work-event-title {
  text-decoration: line-through;
}

.work-event-progress {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(25, 25, 23, 0.1);
  font-size: 7px;
  font-weight: 900;
}

.work-focus-progress {
  border-color: #b7b2a6 !important;
  background: #ece9e0 !important;
  color: #34332f !important;
}

.work-detail-modal .modal-head h2 {
  margin: 10px 0 0;
  font-size: 23px;
  line-height: 1.35;
}

.work-detail-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.work-detail-type,
.work-detail-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
}

.work-detail-type {
  border: 1px solid var(--line);
  background: #e7e4da;
}

.work-detail-type.sales {
  border-color: #c85f2c;
  background: #f2d1bd;
  color: #6b2e15;
}

.work-detail-type.category-sales_inquiry {
  border-color: #c85f2c;
  background: #f2d1bd;
  color: #6b2e15;
}

.work-detail-type.category-internal {
  border-color: #191917;
  background: #191917;
  color: #f2f0e9;
}

.work-detail-status.planned {
  background: var(--ink);
  color: var(--paper);
}

.work-detail-status.completed {
  background: #d7e4d9;
  color: #315b3e;
}

.work-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.work-detail-inquiry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d8a586;
  border-radius: 13px;
  background: #fff3eb;
}

.work-detail-inquiry span,
.work-detail-inquiry strong {
  display: block;
}

.work-detail-inquiry span {
  color: #76513f;
  font-size: 8px;
  font-weight: 800;
}

.work-detail-inquiry strong {
  margin-top: 5px;
  font-size: 11px;
}

.work-detail-inquiry strong .inquiry-status-dot {
  display: inline-block;
  margin-right: 6px;
  vertical-align: -1px;
}

.work-detail-copy {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f5ee;
}

.work-detail-copy > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.work-detail-copy h3,
.work-detail-copy p {
  margin: 0;
}

.work-detail-copy p {
  color: #3f3e39;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.work-detail-copy p.empty-copy {
  color: var(--muted);
}

.work-detail-source {
  color: var(--ink);
  font-size: 9px;
  font-weight: 850;
  text-underline-offset: 3px;
}

.work-detail-checklist {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.work-checklist-head,
.work-checklist-head > div {
  display: flex;
  align-items: center;
}

.work-checklist-head {
  justify-content: space-between;
  gap: 12px;
}

.work-checklist-head > div {
  gap: 8px;
}

.work-checklist-head h3,
.work-checklist-head span,
.work-checklist-head strong {
  margin: 0;
}

.work-checklist-head h3 {
  font-size: 13px;
}

.work-checklist-head span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.work-checklist-head strong {
  font-size: 22px;
}

.work-checklist-progress {
  height: 7px;
  margin: 12px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e4da;
}

.work-checklist-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 180ms ease;
}

.work-checklist-items {
  display: grid;
  gap: 7px;
}

.work-checklist-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #d8d4c8;
  border-radius: 10px;
  background: #f7f5ee;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

button.work-checklist-item {
  cursor: pointer;
}

button.work-checklist-item:hover,
button.work-checklist-item:focus-visible {
  border-color: var(--ink);
  background: #efede5;
  outline: none;
}

.work-checklist-item > i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #aaa69a;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.work-checklist-item > span {
  min-width: 0;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.work-checklist-item > em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
}

.work-checklist-item.done {
  border-color: #c3d5c6;
  background: #edf4ee;
}

.work-checklist-item.done > i {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.work-checklist-item.done > span {
  color: #66635c;
  text-decoration: line-through;
}

.work-checklist-item.is-saving > em {
  color: var(--ink);
}

.work-checklist-note {
  align-self: center;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

@media (max-width: 540px) {
  .work-detail-grid,
  .work-detail-inquiry {
    grid-template-columns: 1fr;
  }

  .work-detail-checklist {
    padding: 13px;
  }

  .work-checklist-head > div {
    display: grid;
    gap: 2px;
  }
}

.expanded-week {
  border: 2px solid var(--ink);
  background: #e7e4da;
}

.expanded-week-grid {
  min-width: 940px;
  display: grid;
  grid-template-columns: repeat(7, minmax(125px, 1fr));
  gap: 8px;
}

.week-day-card {
  min-height: 230px;
  padding: 11px;
  border: 1px solid #c8c4b9;
  border-radius: 13px;
  background: var(--surface);
}

.week-day-card.today {
  border: 2px solid var(--ink);
}

.week-day-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.week-day-card header div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.week-day-card header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.week-day-card header strong {
  font-size: 20px;
}

.week-tasks {
  display: grid;
  gap: 7px;
}

.week-empty {
  padding: 12px 2px;
}

@media (max-width: 960px) {
  .site-calendar-head,
  .work-calendar-summary,
  .goals-grid {
    grid-template-columns: 1fr;
  }

  .work-employee-grid {
    grid-template-columns: 1fr;
  }

  .site-picker {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .work-scope-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .work-team-head,
  .work-focus-head,
  .work-calendar-details > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .work-employee-card {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .work-employee-card > em {
    grid-column: 3;
    grid-row: 1;
  }

  .work-employee-counts {
    grid-column: 1 / -1;
  }

  .work-employee-counts b {
    flex: 1;
  }

  .work-focus-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .work-focus-due {
    min-width: 0;
    text-align: left;
  }

  .work-focus-side {
    grid-column: 2;
    justify-items: start;
  }

  .work-scope-bar label {
    min-width: 0;
  }

  .calendar-toolbar,
  .goal-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-panel,
  .expanded-week {
    padding: 15px;
  }

  .calendar-legend {
    min-width: 620px;
  }
}

/* Performance reviews */
.status.draft {
  background: #e8e5db;
  color: var(--muted);
}

.status.self_submitted {
  background: #dcd9cf;
  color: var(--ink);
}

.status.reviewer_completed {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.status.finalized {
  background: var(--ink);
  color: var(--paper);
}

.evaluation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.evaluation-summary article {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.evaluation-summary article.attention {
  border-color: var(--ink);
}

.evaluation-summary span,
.evaluation-summary small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.evaluation-summary strong {
  display: block;
  margin: 4px 0;
  font-size: 27px;
}

.evaluation-flow {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px 19px;
  border-radius: 15px;
  background: var(--ink);
  color: var(--paper);
}

.evaluation-flow > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.evaluation-flow b {
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(242, 240, 233, 0.45);
  border-radius: 50%;
  font-size: 10px;
}

.evaluation-flow span,
.evaluation-flow small {
  display: block;
  white-space: nowrap;
}

.evaluation-flow span {
  font-size: 11px;
  font-weight: 800;
}

.evaluation-flow small {
  margin-top: 2px;
  color: #aaa79e;
  font-size: 8px;
  font-weight: 500;
}

.evaluation-flow > i {
  height: 1px;
  background: rgba(242, 240, 233, 0.22);
}

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

.evaluation-section-head h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.evaluation-section-head > div > span {
  color: var(--muted);
  font-size: 11px;
}

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

.evaluation-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.evaluation-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.evaluation-card-head,
.evaluation-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.evaluation-card-head em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.evaluation-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 17px 0;
}

.evaluation-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.evaluation-person h2,
.evaluation-person p {
  margin: 0;
}

.evaluation-person h2 {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evaluation-person p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.evaluation-score {
  text-align: right;
}

.evaluation-score strong,
.evaluation-score small {
  display: block;
}

.evaluation-score strong {
  font-size: 24px;
}

.evaluation-score .score-pending {
  color: var(--muted);
}

.evaluation-score small {
  color: var(--muted);
  font-size: 8px;
}

.evaluation-period {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.evaluation-next {
  margin: 12px -18px -18px;
  padding: 10px 18px;
  border-radius: 0 0 15px 15px;
  background: #e8e5db;
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
}

.evaluation-drawer {
  width: min(940px, calc(100vw - 30px));
}

.review-total {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
  border-radius: 15px;
  background: var(--ink);
  color: var(--paper);
}

.review-total > div:first-child {
  display: grid;
  align-content: center;
  justify-items: center;
  border-right: 1px solid rgba(242, 240, 233, 0.2);
}

.review-total > div:first-child span,
.review-total > div:first-child b {
  color: #c8c5bb;
  font-size: 10px;
}

.review-total > div:first-child strong {
  margin: 3px 0;
  font-size: 46px;
}

.score-bars {
  display: grid;
  gap: 9px;
}

.score-bar {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  font-size: 9px;
}

.score-bar > div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(242, 240, 233, 0.18);
}

.score-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--paper);
}

.score-bar b {
  text-align: right;
  font-size: 9px;
}

.automatic-score-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  padding: 16px;
  border-radius: 15px;
  background: var(--ink);
  color: var(--paper);
}

.automatic-score-hero > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 5px 9px;
}

.automatic-score-hero > i {
  display: grid;
  place-items: center;
  color: #aaa79e;
  font-size: 16px;
  font-style: normal;
  font-weight: 800;
}

.automatic-score-hero span,
.automatic-score-hero p {
  display: block;
  margin: 0;
  color: #c8c5bb;
  font-size: 8px;
}

.automatic-score-hero strong {
  overflow: hidden;
  font-size: 29px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automatic-score-hero strong small {
  margin-left: 3px;
  color: #aaa79e;
  font-size: 9px;
}

.automatic-score-hero .final {
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.automatic-score-hero .final span,
.automatic-score-hero .final p {
  color: var(--muted);
}

.automatic-metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.automatic-metric {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f5ee;
}

.automatic-metric > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.automatic-metric span,
.automatic-metric strong,
.automatic-metric small {
  font-size: 8px;
}

.automatic-metric span,
.automatic-metric small,
.automatic-metric p {
  color: var(--muted);
}

.automatic-metric p {
  min-height: 24px;
  margin: 5px 0;
  line-height: 1.45;
  font-size: 8px;
}

.automatic-meter {
  height: 5px;
  overflow: hidden;
  margin-bottom: 5px;
  border-radius: 999px;
  background: #d7d4ca;
}

.automatic-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}

.automatic-metric.unavailable {
  opacity: 0.55;
}

.automatic-metric.no-data {
  border-style: dashed;
}

.automatic-score-note {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 8px;
}

.evidence-link-list {
  display: grid;
  gap: 7px;
}

.evidence-link-list a {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.evidence-link-list a:hover {
  border-color: var(--ink);
}

.evidence-link-list b {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 8px;
}

.evidence-link-list span {
  font-size: 10px;
  font-weight: 800;
}

.evidence-link-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.self-auto-preview,
.review-auto-panel {
  margin-bottom: 14px;
}

.self-auto-preview .automatic-metric-list,
.review-auto-panel .automatic-metric-list {
  max-height: 220px;
  overflow-y: auto;
}

.expense-duplicate-warning {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-radius: 11px;
  background: #e8e5db;
}

.expense-duplicate-warning strong {
  font-size: 10px;
}

.expense-duplicate-warning span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.duplicate-chip,
.cost-issue-chip {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 7px;
  font-style: normal;
  vertical-align: middle;
}

.cost-issue-chip {
  background: #9c3b24;
}

.evaluation-score-empty,
.review-self-copy,
.acknowledgment {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f5ee;
}

.evaluation-score-empty,
.review-self-copy span {
  color: var(--muted);
  font-size: 10px;
}

.review-self-copy p,
.review-copy p,
.acknowledgment p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 11px;
}

.evidence-list {
  display: grid;
  gap: 7px;
}

.evidence-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.evidence-row i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  font-style: normal;
}

.evidence-row strong,
.evidence-row span {
  display: block;
}

.evidence-row strong {
  font-size: 11px;
}

.evidence-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.review-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.review-copy article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f5ee;
}

.review-copy article > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.acknowledgment {
  display: grid;
  gap: 4px;
}

.acknowledgment strong {
  font-size: 11px;
}

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

.acknowledgment.pending {
  border-style: dashed;
}

.evaluation-form-note,
.reviewer-evidence-summary {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #e8e5db;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.evidence-field {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.evidence-field legend {
  padding: 0 5px;
  font-size: 10px;
  font-weight: 800;
}

.evidence-field > p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
}

.evidence-options {
  max-height: 240px;
  display: grid;
  gap: 7px;
  overflow-y: auto;
}

.evidence-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.evidence-option input {
  width: 16px;
  height: 16px;
}

.evidence-option strong,
.evidence-option small {
  display: block;
}

.evidence-option strong {
  font-size: 10px;
}

.evidence-option small,
.evidence-option-empty {
  color: var(--muted);
  font-size: 8px;
}

.score-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.reviewer-evidence-summary {
  margin-top: 0;
}

.reviewer-evidence-summary strong,
.reviewer-evidence-summary p,
.reviewer-evidence-summary small {
  display: block;
  white-space: pre-wrap;
}

.reviewer-evidence-summary p {
  margin: 6px 0;
}

.review-copy-fields {
  margin-top: 8px;
}

.view-loading {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 320px;
  gap: 9px;
  color: var(--muted);
  text-align: center;
}

.view-loading i,
.notion-sync-progress.active > i {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(25, 25, 23, 0.16);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: bespace-spin 0.8s linear infinite;
}

.view-loading strong,
.view-loading span {
  display: block;
}

.view-loading strong {
  color: var(--ink);
  font-size: 13px;
}

.view-loading span {
  max-width: 360px;
  font-size: 10px;
  line-height: 1.55;
}

.notion-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
}

.notion-hero h2 {
  margin: 5px 0 8px;
  font-size: clamp(20px, 2.4vw, 31px);
}

.notion-hero > div > span,
.notion-connection span {
  color: rgba(242, 240, 233, 0.68);
  font-size: 11px;
}

.notion-connection {
  min-width: 190px;
  padding: 15px 17px;
  border: 1px solid rgba(242, 240, 233, 0.22);
  border-radius: 13px;
  background: rgba(242, 240, 233, 0.07);
}

.notion-connection i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: #b9b6ac;
}

.notion-connection.connected i {
  background: #a9d2a4;
  box-shadow: 0 0 0 4px rgba(169, 210, 164, 0.12);
}

.notion-connection strong,
.notion-connection span {
  display: block;
}

.notion-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.notion-sync-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.notion-sync-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.notion-sync-card.running {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(211, 103, 55, 0.1);
}

.notion-sync-card small,
.notion-sync-card span,
.notion-sync-card p {
  display: block;
}

.notion-sync-card > div > small {
  color: var(--orange);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.notion-sync-card h3 {
  margin: 8px 0 7px;
  font-size: 18px;
}

.notion-sync-card p,
.notion-sync-card span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.notion-sync-card .notion-running-note {
  margin-top: 10px;
  color: var(--orange-dark);
  font-weight: 800;
}

.notion-summary span,
.notion-summary small,
.notion-last span,
.notion-last small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.notion-summary strong,
.notion-last strong {
  display: block;
  margin: 4px 0;
  font-size: 13px;
}

.notion-source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.notion-source {
  min-height: 105px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.notion-source.schedule {
  background: #e5e2d8;
}

.notion-source span,
.notion-source strong,
.notion-source small {
  display: block;
}

.notion-source span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.notion-source strong {
  margin: 8px 0;
  font-size: 13px;
}

.notion-source small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.notion-grid {
  align-items: start;
}

.notion-issues {
  display: grid;
  gap: 8px;
}

.notion-issue {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 9px;
  padding: 10px;
  border-radius: 10px;
  background: #ece9e1;
}

.notion-issue > i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  font-style: normal;
}

.notion-issue strong,
.notion-issue span,
.notion-issue small {
  display: block;
}

.notion-issue strong {
  font-size: 10px;
}

.notion-issue span,
.notion-issue small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.notion-confirm {
  padding: 16px 18px;
  border-radius: 12px;
  background: #e8e5db;
}

.notion-confirm ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.notion-full-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.notion-full-option input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--orange);
}

.notion-full-option strong,
.notion-full-option small {
  display: block;
}

.notion-full-option strong { font-size: 11px; }
.notion-full-option small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }

.notion-sync-progress {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.notion-sync-progress > i {
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: #b9b6ac;
}

.notion-sync-progress strong,
.notion-sync-progress span {
  display: block;
}

.notion-sync-progress strong {
  font-size: 11px;
}

.notion-sync-progress span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.notion-sync-meter {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1ded5;
}

.notion-sync-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  transition: width 0.22s ease;
}

@keyframes bespace-spin {
  to { transform: rotate(360deg); }
}

.incentive-month-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.incentive-month-control strong {
  min-width: 110px;
  text-align: center;
  font-size: 16px;
}

.incentive-privacy {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.incentive-privacy i {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ivory);
  background: var(--charcoal);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.incentive-privacy div { display: grid; gap: 4px; }
.incentive-privacy strong { font-size: 13px; }
.incentive-privacy span { color: var(--muted); font-size: 11px; line-height: 1.55; }

.incentive-total {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
  padding: 24px 26px;
  border-radius: 18px;
  color: var(--ivory);
  background: var(--charcoal);
}

.incentive-total div { display: grid; gap: 5px; }
.incentive-total p { margin: 0; font-size: 9px; font-weight: 900; letter-spacing: 0.18em; }
.incentive-total span { color: rgba(242, 240, 233, 0.65); font-size: 11px; }
.incentive-total > strong { font-size: clamp(25px, 4vw, 42px); letter-spacing: -0.05em; }

.incentive-status {
  padding: 7px 10px;
  border: 1px solid rgba(242, 240, 233, 0.24);
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.incentive-status.paid { color: var(--charcoal); background: var(--ivory); }
.incentive-status.finalized { color: #ffd6bd; border-color: rgba(230, 111, 63, 0.55); }

.incentive-metrics,
.incentive-admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.incentive-metrics article,
.incentive-admin-summary article {
  display: grid;
  gap: 6px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}

.incentive-metrics span,
.incentive-admin-summary span { color: var(--muted); font-size: 10px; font-weight: 700; }
.incentive-metrics strong,
.incentive-admin-summary strong { font-size: 19px; letter-spacing: -0.04em; }
.incentive-metrics small,
.incentive-admin-summary small { color: var(--muted); font-size: 9px; }

.incentive-section {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.incentive-section .section-rule { margin-bottom: 12px; }
.incentive-section .section-rule span { color: var(--muted); font-size: 10px; }
.incentive-table { min-width: 650px; }
.incentive-table td strong { display: block; font-size: 11px; }
.incentive-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.incentive-table td b { font-size: 12px; }

.incentive-blocker {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(230, 111, 63, 0.35);
  border-radius: 13px;
  background: rgba(230, 111, 63, 0.08);
}

.incentive-blocker strong { color: var(--orange); font-size: 11px; }
.incentive-blocker span { font-size: 10px; line-height: 1.55; }

.incentive-person-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.incentive-person-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  min-width: 0;
  padding: 17px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  cursor: pointer;
}

.incentive-person-card:hover { transform: translateY(-1px); border-color: var(--charcoal); }
.incentive-person-card > div:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.incentive-person-card strong { font-size: 12px; }
.incentive-person-card span,
.incentive-person-card small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.incentive-person-card > b { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); font-size: 21px; letter-spacing: -0.04em; }

.incentive-confirmation,
.incentive-final-preview {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  color: var(--ivory);
  background: var(--charcoal);
}

.incentive-confirmation strong,
.incentive-final-preview span { font-size: 10px; }
.incentive-confirmation span,
.incentive-confirmation p,
.incentive-final-preview small { margin: 0; color: rgba(242, 240, 233, 0.67); font-size: 9px; }
.incentive-final-preview strong { font-size: 27px; letter-spacing: -0.04em; }
.incentive-drawer { width: min(920px, calc(100vw - 24px)); }

@media (max-width: 1080px) {
  .incentive-person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notion-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .automatic-metric-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evaluation-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .evaluation-flow > i {
    display: none;
  }

  .evaluation-flow > div {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .incentive-month-control { flex-wrap: wrap; justify-content: flex-start; }
  .incentive-month-control strong { order: -1; width: 100%; text-align: left; }
  .incentive-privacy { align-items: flex-start; }
  .incentive-total { grid-template-columns: 1fr; gap: 12px; }
  .incentive-metrics,
  .incentive-admin-summary,
  .incentive-person-grid { grid-template-columns: 1fr; }
  .notion-hero,
  .notion-summary,
  .notion-sync-actions {
    grid-template-columns: 1fr;
  }

  .notion-sync-card {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .notion-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .notion-source-grid {
    grid-template-columns: 1fr;
  }

  .evaluation-summary,
  .evaluation-grid,
  .review-copy,
  .review-total,
  .score-form-grid,
  .automatic-metric-list {
    grid-template-columns: 1fr;
  }

  .automatic-score-hero {
    grid-template-columns: 1fr;
  }

  .automatic-score-hero > i {
    height: 12px;
  }

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

  .evaluation-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-total > div:first-child {
    padding-bottom: 15px;
    border-right: 0;
    border-bottom: 1px solid rgba(242, 240, 233, 0.2);
  }
}

/* Mobile-first operating shell */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

button,
a,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

.mobile-appbar,
.mobile-nav-backdrop,
.mobile-menu-close {
  display: none;
}

@media (max-width: 760px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .shell {
    min-height: 100svh;
    padding-top: calc(64px + env(safe-area-inset-top));
  }

  .mobile-appbar {
    position: fixed;
    z-index: 100;
    inset: 0 0 auto;
    height: calc(64px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(242, 240, 233, 0.96);
    box-shadow: 0 8px 24px rgba(25, 25, 23, 0.08);
    backdrop-filter: blur(16px);
  }

  .mobile-brand-home {
    justify-self: start;
  }

  .mobile-brand-home .mobile-app-symbol {
    width: 28px;
    height: 29px;
  }

  .mobile-menu-toggle,
  .mobile-menu-close {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
  }

  .mobile-menu-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
  }

  .mobile-menu-toggle i {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
  }

  .mobile-attendance-button {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: var(--ink);
    color: var(--paper);
    cursor: pointer;
  }

  .mobile-attendance-button span {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border: 1px solid rgba(242, 240, 233, 0.5);
    border-radius: 50%;
    font-size: 7px;
    font-weight: 900;
  }

  .mobile-attendance-button b {
    font-size: 10px;
  }

  .mobile-nav-backdrop {
    position: fixed;
    z-index: 110;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(25, 25, 23, 0.56);
    backdrop-filter: blur(3px);
  }

  .mobile-nav-backdrop:not([hidden]) {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 120;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    height: auto;
    min-height: 0;
    max-height: none;
    padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--forest);
    background-clip: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    box-shadow: 22px 0 55px rgba(0, 0, 0, 0.28);
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .brand {
    position: sticky;
    z-index: 2;
    top: calc(-14px - env(safe-area-inset-top));
    min-height: 70px;
    padding: 12px 4px 14px;
    background: var(--forest);
  }

  .sidebar-symbol {
    width: 34px;
    height: 35px;
  }

  .brand-copy {
    display: none;
  }

  .mobile-menu-close {
    display: block;
    margin-left: auto;
    border-color: rgba(242, 240, 233, 0.24);
    background: rgba(242, 240, 233, 0.08);
    color: var(--paper);
    font-size: 25px;
    line-height: 1;
  }

  .attendance-quick {
    max-width: none;
    min-height: 58px;
    margin: 0 0 14px;
  }

  .nav-label {
    display: block;
    margin: 10px 8px;
  }

  .nav {
    display: grid;
    gap: 5px;
    flex: none;
    min-height: auto;
    padding-right: 0;
    overflow: visible;
  }

  .nav button {
    width: 100%;
    min-height: 48px;
    flex: none;
    padding: 11px 12px;
    font-size: 13px;
  }

  .nav-token {
    width: 28px;
    height: 28px;
  }

  .sidebar-foot {
    display: block;
    width: 100%;
    padding: 18px 8px 4px;
    flex: 0 0 auto;
    background: var(--forest);
  }

  .sidebar-account-actions button,
  .sidebar-account-actions a {
    min-height: 42px;
    padding: 10px 8px;
    font-size: 11px;
  }

  .main {
    width: 100%;
    padding: 18px 14px calc(42px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
  }

  .topbar .eyebrow {
    font-size: 9px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .top-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .top-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .content {
    gap: 14px;
  }

  .btn {
    min-height: 44px;
    padding: 10px 13px;
  }

  .btn.small {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 10px;
  }

  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  input,
  select,
  textarea {
    max-width: 100%;
    font-size: 16px !important;
  }

  .hero-strip,
  .panel,
  .goal-panel,
  .work-team-board,
  .work-focus-panel,
  .work-scope-bar,
  .profile-hero,
  .notion-hero {
    padding: 18px;
    border-radius: 16px;
  }

  .hero-strip {
    min-height: 132px;
  }

  .hero-strip h2 {
    max-width: calc(100% - 20px);
    font-size: 23px;
  }

  .metrics,
  .team-grid,
  .project-grid,
  .grid-two,
  .dashboard-grid,
  .finance-grid,
  .profile-grid,
  .site-attendance-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .section-title,
  .toolbar,
  .attendance-consent,
  .attendance-punch {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .searchbox {
    width: 100%;
  }

  .row-actions {
    width: 100%;
    gap: 8px;
  }

  .row-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .table-wrap {
    width: calc(100% + 32px);
    margin-inline: -16px;
    padding-inline: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 680px;
  }

  th,
  td {
    padding: 12px 10px;
  }

  .calendar-panel,
  .expanded-week {
    margin-inline: -14px;
    padding: 16px 12px;
    border-inline: 0;
    border-radius: 0;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-toolbar,
  .goal-head {
    gap: 12px;
  }

  .calendar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-actions .btn {
    width: 100%;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 700px;
  }

  .calendar-weekdays span {
    padding: 8px 4px;
  }

  .calendar-day {
    min-height: 104px;
    scroll-snap-align: start;
  }

  .work-day {
    min-height: 96px;
  }

  .calendar-legend {
    min-width: 0;
    flex-wrap: wrap;
    gap: 9px 12px;
  }

  .calendar-legend small {
    width: 100%;
    margin-left: 0;
  }

  .expanded-week-grid {
    min-width: 700px;
    grid-template-columns: repeat(7, minmax(92px, 1fr));
  }

  .week-day-card {
    min-height: 190px;
  }

  .work-calendar-summary article,
  .evaluation-summary article,
  .incentive-metrics article {
    padding: 15px 16px;
  }

  .drawer-backdrop {
    align-items: flex-end;
  }

  .drawer,
  .project-drawer,
  .evaluation-drawer,
  .incentive-drawer {
    width: 100%;
    height: min(94dvh, calc(100dvh - env(safe-area-inset-top)));
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }

  .drawer-actions {
    position: sticky;
    top: -20px;
    margin-inline: -16px;
    padding: 10px 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .drawer-actions .btn {
    flex: 0 0 auto;
  }

  dialog {
    width: 100%;
    max-width: none;
    max-height: min(94dvh, calc(100dvh - env(safe-area-inset-top)));
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }

  dialog[open] {
    position: fixed;
    inset: auto 0 0;
  }

  .modal-head {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: 18px 16px 14px;
    background: var(--surface);
  }

  .modal-body {
    padding: 16px;
  }

  .modal-actions {
    position: sticky;
    z-index: 2;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
  }

  .modal-actions .btn {
    flex: 1;
  }

  .postcode-layer {
    padding: 0;
  }

  .postcode-panel {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .toast {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
    text-align: center;
  }

  .login-panel {
    padding: calc(94px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  }

  .login-mobile-brand {
    top: calc(28px + env(safe-area-inset-top));
    left: 20px;
  }

  .login-mobile-symbol {
    width: 31px;
    height: 32px;
  }

  .login-card {
    width: 100%;
  }

  .login-card h2 {
    font-size: clamp(28px, 9vw, 34px);
  }

  .login-description {
    margin: 14px 0 25px;
  }

  .login-field input {
    height: 58px;
  }

  .login-submit {
    height: 58px;
  }

  .passkey-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .passkey-section-head .btn { width: 100%; }

  .passkey-device {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .passkey-device .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 390px) {
  .mobile-appbar {
    gap: 8px;
    padding-inline: 10px;
  }

  .mobile-brand-home .mobile-app-symbol {
    width: 27px;
    height: 28px;
  }

  .mobile-attendance-button {
    padding-inline: 9px;
  }

  .mobile-attendance-button b {
    font-size: 9px;
  }

  .main {
    padding-inline: 12px;
  }

  .topbar h1 {
    font-size: 25px;
  }

  .calendar-panel,
  .expanded-week {
    margin-inline: -12px;
  }
}

/* Fast interaction feedback */
[data-action] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(25, 25, 23, 0.08);
}

button[data-action]:active,
tr[data-action]:active,
.project-card:active,
.attention-item:active {
  filter: brightness(0.96);
}

.drawer-loading .view-loading {
  min-height: 320px;
  border: 0;
  background: transparent;
}

/* Project hub */
.project-access-line,
.project-hub-head,
.project-member-strip,
.project-hub-actions,
.project-profit-strip,
.hub-schedule-row,
.project-document-row,
.hub-money-row {
  display: flex;
  align-items: center;
}

.project-access-line {
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.project-access-line b { color: var(--ink); }

.project-hub-head {
  position: relative;
  justify-content: space-between;
  gap: 22px;
  padding: 30px;
  border-radius: 22px;
  color: var(--ivory, #f2f0e9);
  background: #191917;
}

.project-hub-head h2 {
  margin: 4px 0 7px;
  font-size: clamp(27px, 4vw, 42px);
  letter-spacing: -.04em;
}

.project-hub-head .eyebrow,
.project-hub-head span { color: rgba(242, 240, 233, .7); }

.hub-back {
  position: absolute;
  top: 14px;
  left: 18px;
  border: 0;
  color: rgba(242, 240, 233, .75);
  background: transparent;
  cursor: pointer;
}

.project-hub-head > div:first-of-type { padding-top: 22px; }

.project-hub-progress {
  flex: 0 0 auto;
  display: grid;
  width: 122px;
  height: 122px;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(242, 240, 233, .25);
  border-radius: 50%;
}

.project-hub-progress b { font-size: 30px; }
.project-hub-progress span { font-size: 11px; }

.project-member-strip {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.project-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #f2f0e9;
}

.project-member-chip small { color: var(--muted); }

.project-hub-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.project-estimate-panel { margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.estimate-panel-head, .estimate-panel-head > div, .estimate-trade, .estimate-row-actions, .estimate-change-log > div:first-child, .estimate-change-row, .payment-card-budget { display: flex; align-items: center; }
.estimate-panel-head { justify-content: space-between; gap: 20px; padding: 22px; border-bottom: 1px solid var(--line); }
.estimate-panel-head > div:first-child { display: block; }
.estimate-panel-head h2 { margin: 4px 0 5px; font-size: 25px; }
.estimate-panel-head span { color: var(--muted); font-size: 12px; }
.estimate-panel-head > div:last-child { gap: 8px; }
.estimate-state { padding: 7px 10px; border-radius: 999px; font-weight: 800; }
.estimate-state.draft { color: #7e5b1c; background: #fff0cf; }
.estimate-state.confirmed { color: #1d6044; background: #dff2e9; }
.estimate-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.estimate-summary > div { display: grid; gap: 5px; padding: 15px 18px; background: #f8f6f0; }
.estimate-summary span, .estimate-metric span { color: var(--muted); font-size: 10px; }
.estimate-summary strong { font-size: 15px; }
.estimate-summary .danger strong { color: #a72d2d; }
.estimate-summary .safe strong { color: #287354; }
.estimate-list { display: grid; gap: 8px; padding: 16px; }
.estimate-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) repeat(6, minmax(90px, .7fr)) auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.estimate-row.warning { border-color: #e8c87a; background: #fffaf0; }
.estimate-row.danger { border-color: #e3a6a1; background: #fff5f4; }
.estimate-trade { min-width: 0; gap: 7px; flex-wrap: wrap; }
.estimate-trade > i { width: 9px; height: 9px; border-radius: 50%; background: #2d8a63; }
.estimate-row.warning .estimate-trade > i { background: #d69a24; }
.estimate-row.danger .estimate-trade > i { background: #cf493f; box-shadow: 0 0 0 5px rgba(207, 73, 63, .12); }
.estimate-trade > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.estimate-trade > strong { min-width: 90px; }
.estimate-trade > em { padding: 4px 6px; border-radius: 999px; color: #287354; background: #e2f2eb; font-size: 9px; font-style: normal; font-weight: 800; }
.estimate-row.warning .estimate-trade > em { color: #815a12; background: #fff0cf; }
.estimate-row.danger .estimate-trade > em { color: #992f29; background: #f9deda; }
.estimate-metric { display: grid; gap: 4px; min-width: 0; }
.estimate-metric b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.estimate-row-actions { gap: 5px; }
.estimate-inline-alert { display: inline-block; margin-left: 7px; padding: 3px 6px; border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 900; vertical-align: middle; }
.estimate-inline-alert.warning { color: #815a12; background: #fff0cf; }
.estimate-inline-alert.danger { color: #992f29; background: #f9deda; }
.estimate-change-log { padding: 0 16px 16px; }
.estimate-change-log > div:first-child { justify-content: space-between; gap: 12px; margin-bottom: 9px; padding-top: 14px; border-top: 1px solid var(--line); }
.estimate-change-log > div:first-child span { color: var(--muted); font-size: 10px; }
.estimate-change-row { gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; }
.estimate-change-row + .estimate-change-row { margin-top: 7px; }
.estimate-change-row > i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #8d8b84; }
.estimate-change-row.open > i { background: #cf493f; box-shadow: 0 0 0 4px rgba(207,73,63,.12); }
.estimate-change-row > div { flex: 1; min-width: 0; }
.estimate-change-row span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.estimate-change-row > em { color: var(--muted); font-size: 10px; font-style: normal; }
.estimate-change-fields { padding: 15px; border: 1px solid #e4c97f; border-radius: 13px; background: #fffaf0; }
.estimate-change-fields > span { display: block; margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.estimate-review-summary { margin-bottom: 14px; padding: 15px; border-radius: 13px; color: #f2f0e9; background: #191917; }
.estimate-review-summary p { margin: 7px 0; }
.estimate-review-summary span { color: #c7c4ba; font-size: 11px; }
.payment-card-budget { justify-content: space-between; gap: 8px; margin-top: 10px; }
.payment-card-budget > small { margin: 0; }
.payment-budget-chip { padding: 5px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; }
.payment-budget-chip.safe { color: #276f52; background: #dff2e9; }
.payment-budget-chip.warning { color: #815a12; background: #fff0cf; }
.payment-budget-chip.danger { color: #992f29; background: #f9deda; }
.payment-budget-check { margin: 14px 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8f6f0; }
.payment-budget-check.warning, .payment-review-budget.warning { border-color: #e8c87a; background: #fffaf0; }
.payment-budget-check.danger, .payment-review-budget.danger { border-color: #e3a6a1; background: #fff5f4; }
.payment-budget-check > div { display: flex; justify-content: space-between; gap: 12px; }
.payment-budget-check > div span, .payment-budget-check small, .payment-review-budget span, .payment-review-budget small { color: var(--muted); font-size: 10px; }
.payment-budget-check dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.payment-budget-check dl div { display: grid; gap: 4px; }
.payment-budget-check dt { color: var(--muted); font-size: 9px; }
.payment-budget-check dd { margin: 0; font-size: 12px; font-weight: 800; }
.payment-review-budget { display: grid; gap: 4px; margin-bottom: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }

.project-calendar { margin-top: 0; }
.project-hub-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; margin-top: 18px; }
.project-hub-grid .panel { min-width: 0; }
.hub-schedule-list, .project-document-list, .hub-money-list { display: grid; gap: 8px; }

.hub-schedule-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(90px, .45fr) 46px auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.schedule-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.schedule-entry-builder,
.schedule-entry-list {
  display: grid;
  gap: 12px;
}

.schedule-entry-guide {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border-radius: 12px;
  color: #f2f0e9;
  background: #191917;
}

.schedule-entry-guide strong { font-size: 12px; }
.schedule-entry-guide span,
.schedule-entry-builder > small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.schedule-entry-guide span { color: #cbc8bf; }

.schedule-entry {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f6f0;
}

.schedule-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.schedule-entry-head strong { font-size: 12px; }
.schedule-entry-remove { padding: 5px 8px; border: 1px solid #dfc5c1; border-radius: 8px; color: #8d3934; background: #f8eae7; font-size: 10px; font-weight: 800; cursor: pointer; }
.schedule-entry-remove[hidden] { display: none; }
.schedule-entry-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.schedule-entry-fields label { display: grid; gap: 6px; }
.schedule-entry-fields .schedule-entry-title { grid-column: 1 / -1; }
.schedule-entry-add { justify-self: start; }

.hub-schedule-row > div:first-child,
.project-document-row > div,
.hub-money-row > div { min-width: 0; }

.hub-schedule-row span,
.project-document-row small,
.hub-money-row span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.project-document-row {
  width: 100%;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.project-document-row > div { flex: 1; }
.project-document-row > b { font-size: 11px; }
.document-type { flex: 0 0 auto; padding: 5px 7px; border-radius: 7px; color: #f2f0e9; background: #191917; font-size: 10px; }
.importance { padding: 5px 7px; border-radius: 999px; font-size: 10px; font-style: normal; }
.importance.low { background: #eceae3; }
.importance.normal { color: #254b76; background: #dfeafb; }
.importance.high { color: #825412; background: #fff0cf; }
.importance.urgent { color: #8c1f1f; background: #ffe0e0; }

.calendar-event.project-money { align-items: flex-start; flex-direction: column; gap: 2px; border-left-width: 4px; }
.calendar-event.project-money b { max-width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; }
.calendar-event.money-out { border-color: #bd3b3b; color: #8c1f1f; background: #fff1f1; }
.calendar-event.money-out.paid { background: #f5dddd; }
.calendar-event.money-in { border-color: #377ab6; color: #215a8b; background: #ecf5ff; }
.calendar-event.money-in.received { color: #fff; background: #377ab6; }
.project-legend i { border-radius: 3px; }
.construction-key { background: #191917; }
.money-out-key { background: #bd3b3b; }
.money-in-planned-key { border: 2px solid #377ab6; background: #ecf5ff; }
.money-in-key { background: #377ab6; }

.hub-money-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  width: 100%;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
}

button.hub-money-row { cursor: pointer; }
.hub-money-row > i { width: 7px; height: 42px; border-radius: 999px; background: #bd3b3b; }
.hub-money-row.in > i { background: #377ab6; }
.hub-money-row > em { color: var(--muted); font-size: 11px; font-style: normal; }
.hub-money-row.out > b, .money-out-text { color: #a72d2d; }
.hub-money-row.in > b, .money-in-text { color: #286da8; }

.receivable-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.receivable-actions em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.receivable-plan-warning {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #d7a94a;
  border-radius: 11px;
  color: #704d0f;
  background: #fff3d4;
}

.receivable-plan-warning strong { font-size: 12px; }
.receivable-plan-warning span { margin: 0; color: #704d0f; font-weight: 800; }
.receivable-plan-warning small { color: #856a36; font-size: 10px; line-height: 1.5; }

.project-profit-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 18px;
  color: #f2f0e9;
  background: #3b3b37;
}

.project-profit-strip > div { padding: 20px; background: #191917; }
.project-profit-strip span { display: block; margin-bottom: 7px; color: rgba(242,240,233,.65); font-size: 11px; }
.project-profit-strip strong { font-size: 20px; }
.project-profit-strip > small { grid-column: 1 / -1; padding: 10px 18px; color: rgba(242,240,233,.7); }

.automation-blueprint {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid #d7d2c5;
  border-radius: 18px;
  background: linear-gradient(135deg, #f2f0e9, #fbfaf7);
}

.automation-blueprint h2 { margin: 4px 0 16px; }
.automation-blueprint > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.automation-blueprint article { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.72); }
.automation-blueprint article b, .automation-blueprint article span { display: block; }
.automation-blueprint article b { margin-bottom: 7px; }
.automation-blueprint article span, .automation-blueprint > small { color: var(--muted); line-height: 1.55; }
.automation-blueprint > small { display: block; margin-top: 12px; }

.people-field { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.people-field legend { padding: 0 6px; font-weight: 700; }
.people-field > p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.people-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.people-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; padding: 9px; border-radius: 9px; background: #f2f0e9; cursor: pointer; }
.people-option input { width: 16px; height: 16px; margin: 0; padding: 0; }
.people-option span, .people-option strong, .people-option small { display: block; min-width: 0; }
.people-option strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; word-break: keep-all; }
.people-option small { overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

@media (max-width: 980px) {
  .project-hub-grid, .automation-blueprint > div { grid-template-columns: 1fr; }
  .project-profit-strip { grid-template-columns: repeat(2, 1fr); }
  .estimate-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .estimate-trade, .estimate-row-actions { grid-column: 1 / -1; }
  .estimate-row-actions { justify-content: flex-end; }
}

@media (max-width: 640px) {
  .estimate-panel-head { align-items: flex-start; flex-direction: column; }
  .estimate-panel-head > div:last-child { width: 100%; justify-content: space-between; }
  .estimate-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate-summary > div:last-child { grid-column: 1 / -1; }
  .estimate-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate-trade, .estimate-row-actions { grid-column: 1 / -1; }
  .estimate-row-actions { justify-content: flex-end; }
  .estimate-change-log > div:first-child, .estimate-change-row { align-items: flex-start; flex-direction: column; }
  .payment-budget-check dl { grid-template-columns: repeat(2, 1fr); }
  .project-hub-head { align-items: flex-start; flex-direction: column; padding: 48px 20px 20px; }
  .project-hub-progress { position: absolute; top: 52px; right: 18px; width: 86px; height: 86px; }
  .project-hub-progress b { font-size: 22px; }
  .project-hub-head > div:first-of-type { max-width: calc(100% - 94px); padding-top: 0; }
  .project-hub-actions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .project-hub-actions .btn { flex: 0 0 auto; }
  .hub-schedule-row { grid-template-columns: minmax(0, 1fr) 42px auto; }
  .hub-schedule-row .progress, .hub-schedule-row .btn.secondary { display: none; }
  .hub-schedule-row .schedule-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .schedule-row-actions { flex-wrap: wrap; }
  .schedule-entry-fields { grid-template-columns: 1fr; }
  .schedule-entry-fields .schedule-entry-title { grid-column: auto; }
  .project-profit-strip { grid-template-columns: 1fr 1fr; }
  .project-profit-strip strong { font-size: 15px; }
  .people-options { grid-template-columns: 1fr; }
  .payment-plan-head { align-items: flex-start; flex-direction: column; }
  .payment-plan-head > div:last-child { width: 100%; justify-content: flex-start; }
  .payment-installment { grid-template-columns: 1fr 1fr; }
  .payment-installment-label { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; }
  .payment-installment-remove { grid-column: 1 / -1; }
  .payment-plan-summary { align-items: flex-start; flex-wrap: wrap; }
  .payment-plan-summary strong { margin-left: 0; }
  .payment-plan-summary small { width: 100%; }
}

/* Representative dashboard drill-downs and private finance calendar */
.dashboard-drill-modal { min-width: min(760px, 84vw); }
.dashboard-drill-list { display: grid; gap: 9px; max-height: min(62vh, 660px); overflow-y: auto; }
.dashboard-drill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  text-align: left;
  background: #fbfaf6;
}
.dashboard-drill-row > div > span,
.dashboard-drill-row > div > strong,
.dashboard-drill-row > div > small,
.dashboard-drill-row > div > em { display: block; }
.dashboard-drill-row > div > span { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.dashboard-drill-row > div > strong { font-size: 14px; }
.dashboard-drill-row ul { margin: 8px 0 0; padding-left: 18px; color: #8c1f1f; font-size: 11px; line-height: 1.55; }
.dashboard-drill-row.risk { border-color: #e9aaa3; background: #fff5f3; }
button.dashboard-drill-row { width: 100%; grid-template-columns: 28px minmax(0, 1fr) auto; cursor: pointer; }
.dashboard-drill-row.payment > i { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--paper); background: var(--ink); font-size: 10px; font-style: normal; font-weight: 800; }
.dashboard-drill-row.payment small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.dashboard-drill-row.payment em { margin-top: 4px; color: #4b4943; font-size: 10px; font-style: normal; }
.dashboard-drill-row.payment > b { color: #9c2b2b; white-space: nowrap; }
.dashboard-drill-row.deletion { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; }
.dashboard-drill-row.deletion > i { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #8c1f1f; background: #f8e3df; font-size: 10px; font-style: normal; font-weight: 800; }
.dashboard-drill-row.deletion p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.finance-private-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  color: var(--paper);
  background: var(--ink);
}
.finance-private-banner > i { padding: 7px 9px; border: 1px solid rgba(242,240,233,.35); border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 900; letter-spacing: .08em; }
.finance-private-banner strong,
.finance-private-banner span { display: block; }
.finance-private-banner span { margin-top: 4px; color: rgba(242,240,233,.7); font-size: 11px; }
.finance-calendar-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.finance-calendar-summary article { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.finance-calendar-summary span,
.finance-calendar-summary strong { display: block; }
.finance-calendar-summary span { color: var(--muted); font-size: 10px; }
.finance-calendar-summary strong { margin-top: 7px; font-size: 17px; }
.finance-calendar { margin-bottom: 18px; }
.finance-day { min-height: 150px; }
.finance-calendar-event {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 2px;
  padding: 6px 7px;
  border: 0;
  border-left: 4px solid;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
}
.finance-calendar-event span,
.finance-calendar-event b,
.finance-calendar-event small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-calendar-event span { font-size: 9px; font-weight: 800; }
.finance-calendar-event b { font-size: 9px; }
.finance-calendar-event small { font-size: 8px; opacity: .78; }
.finance-calendar-event.request { border-color: #e17b33; color: #7a3b0e; background: #fff0e5; }
.finance-calendar-event.project-out { border-color: #bd3b3b; color: #8c1f1f; background: #fff1f1; }
.finance-calendar-event.income-planned { border-color: #377ab6; color: #215a8b; background: #ecf5ff; }
.finance-calendar-event.income-paid { border-color: #1d669f; color: #fff; background: #377ab6; }
.finance-calendar-event.operating { border-color: #6d54a4; color: #4c3978; background: #f1ecfb; }
.finance-calendar-event.operating.paid { color: #fff; background: #6d54a4; }
.finance-legend i { border-radius: 3px; }
.income-paid-key { background: #377ab6 !important; }
.income-planned-key { border: 2px solid #377ab6; background: #ecf5ff !important; }
.payment-request-key { background: #e17b33 !important; }
.project-out-key { background: #bd3b3b !important; }
.operating-key { background: #6d54a4 !important; }
.operating-expense-panel { margin-bottom: 18px; }
.operating-expense-list { display: grid; gap: 8px; }
.operating-expense-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-align: left; background: var(--surface); cursor: pointer; }
.operating-category { padding: 6px 8px; border-radius: 8px; color: #4c3978; background: #f1ecfb; font-size: 9px; font-weight: 800; }
.operating-expense-row strong,
.operating-expense-row small { display: block; }
.operating-expense-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.operating-expense-row > b { white-space: nowrap; }
.operating-expense-row > em { padding: 5px 7px; border-radius: 999px; color: #6d54a4; background: #f1ecfb; font-size: 9px; font-style: normal; }
.operating-expense-row > em.paid { color: #215a8b; background: #e5f1fb; }

@media (max-width: 980px) {
  .finance-calendar-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .dashboard-drill-modal { min-width: 0; }
  .dashboard-drill-row { align-items: flex-start; grid-template-columns: minmax(0, 1fr); }
  button.dashboard-drill-row { grid-template-columns: 24px minmax(0, 1fr); }
  .dashboard-drill-row.payment > b { grid-column: 2; }
  .dashboard-drill-row.deletion { grid-template-columns: 24px minmax(0, 1fr); }
  .dashboard-drill-row.deletion > button { grid-column: 2; justify-self: start; }
  .finance-private-banner { align-items: flex-start; }
  .finance-calendar-summary { grid-template-columns: 1fr 1fr; }
  .finance-calendar-summary strong { font-size: 14px; }
  .operating-expense-row { grid-template-columns: auto minmax(0, 1fr); }
  .operating-expense-row > b,
  .operating-expense-row > em { grid-column: 2; }
}

/* Regional partner and daily-workforce directory */
.directory-hero { display: flex; justify-content: space-between; gap: 24px; padding: 28px; margin-bottom: 18px; border-radius: 22px; color: var(--paper); background: var(--ink); }
.directory-hero h2 { margin: 6px 0 8px; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.05em; }
.directory-hero span { color: rgba(242, 240, 233, .7); font-size: 12px; }
.directory-security { align-self: center; width: min(330px, 40%); padding: 16px; border: 1px solid rgba(242, 240, 233, .18); border-radius: 14px; }
.directory-security b,
.directory-security span { display: block; }
.directory-security b { margin-bottom: 5px; font-size: 11px; }
.directory-toolbar { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 20px; }
.directory-filters,
.directory-create-buttons { display: flex; gap: 7px; }
.directory-filter { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-weight: 800; cursor: pointer; }
.directory-filter.active { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.directory-group { margin-bottom: 24px; }
.directory-group-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 3px 10px; border-bottom: 1px solid var(--line); }
.directory-group-head p { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.directory-group-head h2 { margin: 0; font-size: 20px; }
.directory-group-head > span { color: var(--muted); font-size: 10px; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.directory-card { display: flex; flex-direction: column; min-height: 190px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-align: left; background: var(--surface); cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.directory-card:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 10px 24px rgba(25, 25, 23, .08); }
.directory-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.directory-card-head small { color: var(--muted); font-size: 9px; }
.directory-type { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 999px; color: #6e4e09; background: #fff0bd; font-size: 9px; font-weight: 900; }
.directory-type.daily_worker { color: #1f5782; background: #e4f2ff; }
.directory-card > strong { font-size: 17px; }
.directory-card > p { margin: 5px 0 10px; color: var(--muted); font-size: 11px; }
.directory-note { display: -webkit-box; overflow: hidden; min-height: 34px; color: #474740; font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.directory-card-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.directory-card-foot b,
.directory-card-foot small { font-size: 9px; }
.directory-card-foot small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.directory-usage-list { display: grid; gap: 8px; }
.directory-usage-list > span { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.directory-usage-list b,
.directory-usage-list small { font-size: 10px; }
.directory-usage-list small { color: var(--muted); text-align: right; }
.directory-sensitive { display: grid; gap: 8px; padding: 14px; border: 1px solid #d4cdae; border-radius: 13px; background: #fbf8ec; }
.directory-sensitive > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.directory-sensitive span { color: var(--muted); font-size: 10px; }
.directory-sensitive strong { overflow-wrap: anywhere; font-size: 11px; }
.directory-sensitive.locked { color: var(--muted); border-style: dashed; background: var(--paper); }
.directory-sensitive.locked b,
.directory-sensitive.locked span { display: block; }
.directory-sensitive.locked b { margin-bottom: 5px; color: var(--ink); }
.directory-form-divider { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 15px; padding: 12px; border-radius: 11px; background: #eeece4; }
.directory-form-divider strong,
.directory-form-divider span { font-size: 10px; }
.directory-form-divider span { color: var(--muted); }
.directory-form-divider.locked { border: 1px dashed var(--line); background: transparent; }
.payment-directory-note { padding: 11px 13px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.payment-new-directory { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f5f3ed; }
.payment-new-directory[hidden] { display: none; }
.daily-worker-guide { display: grid; gap: 4px; margin-bottom: 14px; padding: 13px; border-radius: 12px; background: var(--ink); color: var(--paper); }
.daily-worker-guide strong { font-size: 11px; }
.daily-worker-guide span { color: rgba(242, 240, 233, .72); font-size: 10px; }
.hub-schedule-main { min-width: 0; }
.schedule-workers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.schedule-worker-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 9px; color: #215a8b; background: #e8f3fc; font-size: 9px; }
.schedule-worker-chip b,
.schedule-worker-chip small { font-size: 9px; }
.schedule-worker-chip button { display: grid; place-items: center; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #377ab6; cursor: pointer; }
.schedule-worker-empty { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.schedule-action-workers { margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.schedule-action-workers > strong { font-size: 10px; }

@media (max-width: 980px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-toolbar { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .directory-hero { display: grid; padding: 20px; }
  .directory-security { width: auto; }
  .directory-grid { grid-template-columns: 1fr; }
  .directory-create-buttons .btn { flex: 1; }
  .payment-new-directory { grid-template-columns: 1fr; }
  .directory-usage-list > span { display: grid; }
  .directory-usage-list small { text-align: left; }
  .directory-sensitive > div { grid-template-columns: 1fr; gap: 3px; }
}

/* A4 construction calendar export */
.schedule-export-presets {
  display: grid;
  grid-template-columns: minmax(230px, .7fr) 1fr;
  align-items: end;
  gap: 14px;
  padding: 18px;
  margin-bottom: 14px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 14px;
}
.schedule-export-presets label { display: grid; gap: 7px; }
.schedule-export-presets label > span { color: rgba(242, 240, 233, .68); font-size: 11px; font-weight: 750; }
.schedule-export-presets select { width: 100%; min-height: 42px; padding: 0 12px; color: var(--ink); background: var(--paper); border: 0; border-radius: 9px; font: inherit; font-weight: 750; }
.schedule-export-presets p { margin: 0; color: rgba(242, 240, 233, .7); font-size: 12px; line-height: 1.55; }
.schedule-export-group { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.schedule-export-group > div:first-child { display: grid; align-content: start; gap: 5px; }
.schedule-export-group > div:first-child strong { font-size: 14px; }
.schedule-export-group > div:first-child small { color: var(--muted); line-height: 1.45; }
.schedule-export-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.schedule-export-option { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; min-width: 0; padding: 12px; background: #fffdf8; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.schedule-export-option:has(input:checked) { background: #e5e2d8; border-color: var(--ink); }
.schedule-export-option.locked { cursor: default; }
.schedule-export-option input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--ink); }
.schedule-export-option span { display: grid; gap: 3px; min-width: 0; }
.schedule-export-option strong { font-size: 12px; }
.schedule-export-option small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.schedule-export-permission { display: grid; gap: 4px; padding: 16px; color: var(--muted); background: #efede6; border-radius: 12px; }
.schedule-export-permission strong { color: var(--ink); font-size: 12px; }
.schedule-export-permission span { font-size: 11px; }

@media (max-width: 680px) {
  .schedule-export-presets, .schedule-export-group { grid-template-columns: 1fr; }
  .schedule-export-options { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .dashboard-work-panel { gap: 13px; padding: 16px; border-radius: 17px; }
  .dashboard-work-head { align-items: stretch; flex-direction: column; }
  .dashboard-work-head > button { width: 100%; }
  .dashboard-work-columns { grid-template-columns: 1fr; }
  .dashboard-person-chip { min-width: 104px; }
  .dashboard-work-row { padding: 12px; }
  .dashboard-work-title-line > button { white-space: normal; }
}

/* Internal document center */
.company-document-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  margin-bottom: 16px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 22px;
}
.company-document-hero h2 { margin: 6px 0 8px; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.05em; }
.company-document-hero > div > span { color: rgba(242, 240, 233, .7); font-size: 12px; }
.company-document-lock { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 2px 12px; min-width: 230px; padding: 15px; border: 1px solid rgba(242, 240, 233, .18); border-radius: 14px; }
.company-document-lock i { grid-row: 1 / 3; width: 30px; height: 35px; border: 2px solid var(--paper); border-radius: 7px; }
.company-document-lock i::before { content: ""; display: block; width: 15px; height: 12px; margin: -10px auto 0; border: 2px solid var(--paper); border-bottom: 0; border-radius: 9px 9px 0 0; }
.company-document-lock strong { font-size: 11px; }
.company-document-lock span { color: rgba(242, 240, 233, .65); font-size: 9px; }
.company-document-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.company-document-tab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.company-document-tab strong { font-size: 12px; }
.company-document-tab span { display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; color: var(--muted); background: var(--paper); border-radius: 999px; font-size: 9px; }
.company-document-tab.active { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.company-document-tab.active span { color: var(--ink); background: var(--paper); }
.company-document-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; margin-bottom: 14px; color: #4c3978; background: #f1ecfb; border-radius: 12px; }
.company-document-notice.private { color: #215a8b; background: #e8f3fc; }
.company-document-notice.manage { color: #6e4e09; background: #fff3cf; }
.company-document-notice strong { font-size: 11px; }
.company-document-notice span { font-size: 10px; }
.company-document-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.company-document-toolbar > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.company-document-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.company-document-filter { padding: 9px 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 800; cursor: pointer; }
.company-document-filter.active { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.company-document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.company-document-grid > .empty { grid-column: 1 / -1; }
.company-document-card { display: flex; flex-direction: column; min-height: 280px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.company-document-card:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 12px 28px rgba(25, 25, 23, .08); }
.company-document-card.archived { opacity: .62; border-style: dashed; }
.company-document-open { display: flex; flex: 1; flex-direction: column; align-items: stretch; width: 100%; padding: 18px; color: var(--ink); text-align: left; background: transparent; border: 0; cursor: pointer; }
.company-document-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 22px; }
.company-document-category,
.company-document-audience,
.company-document-ack,
.company-document-archived { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; }
.company-document-category { color: var(--ink); background: #e9e6dc; }
.company-document-audience { color: #1f5782; background: #e4f2ff; }
.company-document-audience.personal { color: #4c3978; background: #f1ecfb; }
.company-document-audience.representative { color: #8c1f1f; background: #fff1f1; }
.company-document-open > strong { margin-bottom: 8px; font-size: 18px; line-height: 1.3; }
.company-document-open > p { display: -webkit-box; overflow: hidden; min-height: 38px; margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.65; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.company-document-meta { display: flex; flex-wrap: wrap; gap: 6px 11px; margin-top: auto; color: var(--muted); font-size: 9px; }
.company-document-owner { margin-top: 12px; color: #4c3978; font-size: 10px; font-weight: 800; }
.company-document-ack { margin-top: 10px; color: #8c1f1f; background: #fff1f1; }
.company-document-ack.done { color: #215a8b; background: #e5f1fb; }
.company-document-archived { margin-top: 10px; color: var(--muted); background: #e9e6dc; }
.company-document-card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.company-document-drawer { width: min(720px, 92vw); }
.company-document-read-note { display: grid; gap: 4px; padding: 14px; margin: 15px 0; color: #8c1f1f; background: #fff1f1; border-radius: 12px; }
.company-document-read-note.done { color: #215a8b; background: #e5f1fb; }
.company-document-read-note strong { font-size: 11px; }
.company-document-read-note span { font-size: 10px; line-height: 1.5; }
.company-document-versions { display: grid; gap: 8px; }
.company-document-version { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px; background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; }
.company-document-version.current { border-color: var(--ink); }
.company-document-version > div:first-child { min-width: 0; }
.company-document-version > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.company-document-version span,
.company-document-version strong,
.company-document-version small { display: block; }
.company-document-version span { margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.company-document-version strong { font-size: 13px; }
.company-document-version p { margin: 5px 0; color: var(--muted); font-size: 10px; }
.company-document-version small { color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.company-document-file-field { display: grid; gap: 7px; }
.company-document-file-field > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.company-document-file-field input { width: 100%; padding: 12px; background: #fffdf8; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.company-document-file-field small { color: var(--muted); font-size: 9px; line-height: 1.45; }

@media (max-width: 980px) {
  .company-document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .company-document-hero { display: grid; padding: 21px; }
  .company-document-lock { min-width: 0; }
  .company-document-tabs { grid-template-columns: 1fr; }
  .company-document-notice,
  .company-document-toolbar,
  .company-document-version { align-items: stretch; flex-direction: column; }
  .company-document-grid { grid-template-columns: 1fr; }
  .company-document-version > div:last-child { justify-content: flex-start; }
}

/* Customer quotation builder */
.quote-saved-strip,
.quote-empty-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffdf8;
}
.quote-saved-strip > div { display: grid; gap: 3px; min-width: 0; margin-right: auto; }
.quote-saved-strip span,
.quote-saved-strip small,
.quote-empty-strip span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.quote-saved-strip strong,
.quote-empty-strip strong { font-size: 12px; }
.quote-saved-strip > b { color: #1f5782; font-size: 16px; white-space: nowrap; }
.quote-empty-strip { align-items: flex-start; flex-direction: column; gap: 4px; border-style: dashed; }

.action-dialog:has([data-quote-builder]) { width: min(1180px, calc(100vw - 36px)); max-width: 1180px; }
[data-quote-builder] { display: grid; gap: 14px; }
.quote-builder-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdf8;
}
.quote-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.quote-section-head > div { display: grid; grid-template-columns: 28px auto; align-items: center; gap: 2px 9px; }
.quote-section-head > div > span { grid-row: 1 / 3; display: grid; place-items: center; width: 28px; height: 28px; color: var(--paper); background: var(--ink); border-radius: 50%; font-size: 8px; font-weight: 900; }
.quote-section-head strong { font-size: 13px; }
.quote-section-head small { color: var(--muted); font-size: 9px; }
.quote-section-head em { padding: 6px 9px; color: #1f5782; background: #e5f1fb; border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 850; }
.quote-section-head em.locked { color: var(--muted); background: #e9e6dc; }
.quote-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quote-field { display: grid; gap: 7px; min-width: 0; }
.quote-field.full { grid-column: 1 / -1; }
.quote-field > span { color: var(--muted); font-size: 9px; font-weight: 800; }
.quote-field input,
.quote-field textarea,
.quote-rounding select {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 11px;
}
.quote-field textarea { min-height: 105px; line-height: 1.55; resize: vertical; }
.quote-field input:disabled { color: var(--muted); background: #efede6; }
.quote-field input:focus,
.quote-field textarea:focus,
.quote-rounding select:focus { border-color: var(--ink); outline: 2px solid rgba(25, 25, 23, .07); }

.quote-responsibility-section {
  border-color: #1d2523;
  background: linear-gradient(135deg, #f7f5ed 0%, #fffdf8 62%, #e8f2ee 100%);
  box-shadow: inset 5px 0 0 #1d2523;
}
.quote-responsibility-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.quote-responsibility-grid article {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid #cbd5d0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .76);
}
.quote-responsibility-grid article span { color: var(--muted); font-size: 9px; font-weight: 800; }
.quote-responsibility-grid article strong { font-size: 12px; }
.quote-responsibility-grid article small { color: var(--muted); font-size: 8px; }

.quote-section-actions { display: flex !important; grid-template-columns: none !important; gap: 7px !important; }
.quote-lines-section { overflow-x: auto; }
.quote-line-list { display: grid; gap: 8px; min-width: 1090px; }
.quote-major-divider {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 8px;
  padding: 0 14px;
  color: #f7f3e8;
  background: var(--ink);
  border-left: 7px solid #ff5935;
  border-radius: 8px 8px 2px 2px;
}
.quote-major-divider:first-child { margin-top: 0; }
.quote-major-divider b { color: #ff7a59; font-size: 10px; letter-spacing: .08em; }
.quote-major-divider strong { font-size: 12px; }
.quote-major-divider span { color: rgba(247, 243, 232, .45); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.quote-line {
  display: grid;
  grid-template-columns: 38px 108px 118px 150px 68px 48px 55px repeat(3, 78px) 82px 92px 30px;
  align-items: end;
  gap: 5px;
  padding: 10px;
  border: 1px solid #d2cfc5;
  border-left: 3px solid #9c9a92;
  border-radius: 3px 9px 9px 3px;
  background: #f7f5ee;
}
.quote-line + .quote-line { border-top-style: dashed; }
.quote-line > label { display: grid; gap: 5px; min-width: 0; }
.quote-line > label > span,
.quote-line > .quote-line-total > span { color: var(--muted); font-size: 8px; font-weight: 800; }
.quote-line input,
.quote-line select { width: 100%; min-width: 0; height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; font: inherit; font-size: 10px; }
.quote-major-field select { color: #171915; background: #e7e5dc; font-weight: 850; }
.quote-minor-field select { border-color: #bcb8ab; background: #fff; font-weight: 750; }
.quote-line-number { align-self: center; color: var(--muted); font-size: 9px; font-weight: 900; text-align: center; }
.quote-line-total { display: grid; align-content: center; gap: 6px; min-height: 38px; padding: 0 8px; border-radius: 8px; color: #1f5782; background: #e8f3fc; }
.quote-line-total strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quote-line-remove { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 4px; padding: 0; border: 0; border-radius: 50%; color: #8c1f1f; background: #fff1f1; cursor: pointer; }

.quote-legal-section { border-top-color: #1f5782; background: #f8fbfd; }
.quote-legal-toggle { display: flex; align-items: center; gap: 7px; padding: 7px 10px; color: #174a70; background: #e5f1fb; border-radius: 999px; font-size: 9px; font-weight: 900; }
.quote-legal-toggle input,
.quote-legal-check input { width: 15px; height: 15px; accent-color: #1f5782; }
.quote-legal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quote-legal-grid > label { display: grid; align-content: end; gap: 6px; min-width: 0; }
.quote-legal-grid > label > span { color: var(--muted); font-size: 9px; font-weight: 800; }
.quote-legal-grid select,
.quote-legal-grid input:not([type="checkbox"]) { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #c7d7e3; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: 10px; }
.quote-legal-grid .quote-auto-total input { color: #174a70; background: #e5f1fb; font-size: 12px; font-weight: 950; }
.quote-legal-grid .quote-auto-total small { color: #42708f; font-size: 8px; line-height: 1.4; }
.quote-legal-grid .quote-legal-check { display: flex; align-items: center; align-self: end; min-height: 42px; padding: 9px 11px; border: 1px solid #c7d7e3; border-radius: 9px; background: #fff; }
.quote-legal-status { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; color: #174a70; background: #e5f1fb; border-left: 4px solid #1f5782; border-radius: 5px 9px 9px 5px; }
.quote-legal-status strong { font-size: 9px; white-space: nowrap; }
.quote-legal-status span { font-size: 9px; line-height: 1.45; }
.quote-legal-caution { margin: 8px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.quote-rate-field.auto-rate input { color: #174a70; background: #eaf4fb; font-weight: 900; }

.quote-rate-notice { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 12px; color: #6e4e09; background: #fff3cf; border-radius: 11px; }
.quote-rate-notice strong { font-size: 10px; }
.quote-rate-notice span { font-size: 9px; line-height: 1.5; }
.quote-rate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.quote-rate-field { display: grid; grid-template-columns: 1fr; gap: 7px; padding: 11px; border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 5px 5px 10px 10px; background: var(--surface); transition: opacity .15s ease; }
.quote-rate-field > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.quote-rate-field > span b { font-size: 10px; }
.quote-rate-field > span em { padding: 3px 5px; color: #1d5f89; background: #e5f1fb; border-radius: 999px; font-size: 7px; font-style: normal; font-weight: 900; }
.quote-rate-field > div { display: grid; grid-template-columns: 58px 1fr 12px; align-items: center; gap: 5px; min-width: 0; }
.quote-rate-field small { overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.quote-rate-field select,
.quote-rate-field input { width: 100%; height: 35px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; font: inherit; font-size: 9px; }
.quote-rate-field input { text-align: right; }
.quote-rate-field > div > b { color: var(--muted); font-size: 9px; }
.quote-rate-field output { display: block; padding-top: 7px; border-top: 1px dashed var(--line); color: #174a70; font-size: 9px; font-weight: 900; text-align: right; }
.quote-rate-field.excluded { opacity: .48; border-top-color: #a09e96; background: #ebe9e2; }
.quote-rate-field.excluded > span b { text-decoration: line-through; }
.quote-rounding { display: grid; grid-template-columns: 150px minmax(180px, 320px); align-items: center; gap: 12px; margin-top: 13px; }
.quote-rounding > span { color: var(--muted); font-size: 9px; font-weight: 800; }

.quote-commercial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quote-commercial-grid label { display: grid; gap: 7px; }
.quote-commercial-grid span { color: var(--muted); font-size: 9px; font-weight: 800; }
.quote-commercial-grid input,
.quote-commercial-grid select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font: inherit; font-size: 10px; }
.quote-payment-total { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; color: var(--muted); font-size: 9px; }
.quote-payment-total b { padding: 5px 8px; color: #1d5f89; background: #e5f1fb; border-radius: 999px; }
.quote-payment-total b.warning { color: #8c3b22; background: #ffe7dc; }
.quote-payment-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.quote-payment-head strong { font-size: 11px; }
.quote-payment-list { display: grid; gap: 7px; margin-top: 9px; }
.quote-payment-row { display: grid; grid-template-columns: 30px minmax(130px, .8fr) 110px minmax(180px, 1.4fr) 30px; align-items: end; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 4px 9px 9px 4px; background: var(--surface); }
.quote-payment-row > span { align-self: center; color: #ff5935; font-size: 9px; font-weight: 950; }
.quote-payment-row label { display: grid; gap: 5px; }
.quote-payment-row small { color: var(--muted); font-size: 8px; font-weight: 800; }
.quote-payment-row input { width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; font: inherit; font-size: 10px; }
.quote-payment-row label > div { display: grid; grid-template-columns: 1fr 16px; align-items: center; gap: 3px; }
.quote-payment-row label > div b { color: var(--muted); font-size: 9px; }
.quote-payment-row > button { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 4px; border: 0; border-radius: 50%; color: #8c1f1f; background: #fff1f1; cursor: pointer; }

.quote-live-preview { position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); overflow: hidden; color: var(--paper); background: var(--ink); border: 1px solid var(--ink); border-radius: 14px; box-shadow: 0 -12px 30px rgba(25, 25, 23, .12); }
.quote-live-preview > div { display: grid; gap: 5px; padding: 13px; border-right: 1px solid rgba(242, 240, 233, .14); }
.quote-live-preview > div:last-child { border-right: 0; }
.quote-live-preview span { color: rgba(242, 240, 233, .58); font-size: 8px; }
.quote-live-preview strong { font-size: 12px; }
.quote-live-preview .grand { color: var(--ink); background: #f1c75b; }
.quote-live-preview .grand span { color: rgba(25, 25, 23, .6); }
.quote-builder-save { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.quote-builder-save > span { color: var(--muted); font-size: 9px; }

.sales-quote-intro { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 18px; padding: 24px 26px; color: var(--paper); background: var(--ink); border-radius: 18px; }
.sales-quote-intro h2 { margin: 5px 0 7px; font-size: 23px; }
.sales-quote-intro > div:first-child > span { color: rgba(242, 240, 233, .64); font-size: 11px; }
.sales-quote-flow { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.sales-quote-flow b { padding: 9px 11px; color: var(--ink); background: #f1c75b; border-radius: 8px; font-size: 9px; }
.sales-quote-flow i { color: #ff6a45; font-style: normal; font-weight: 950; }
.sales-quote-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sales-quote-card { display: grid; gap: 18px; padding: 18px; border: 1px solid var(--line); border-top: 5px solid #aaa79d; border-radius: 8px 8px 16px 16px; background: var(--surface); }
.sales-quote-card.ready { border-top-color: #1f5782; }
.sales-quote-state { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sales-quote-state span { color: var(--muted); font-size: 9px; font-weight: 800; }
.sales-quote-state b { padding: 5px 7px; color: #174a70; background: #e5f1fb; border-radius: 999px; font-size: 8px; }
.sales-quote-card.draft .sales-quote-state b { color: #6f5920; background: #fff3cf; }
.sales-quote-main { display: grid; gap: 6px; }
.sales-quote-main small { color: #ff5935; font-size: 8px; font-weight: 950; letter-spacing: .12em; }
.sales-quote-main h2 { margin: 0; font-size: 18px; }
.sales-quote-main p { margin: 0 0 9px; color: var(--muted); font-size: 10px; }
.sales-quote-main > strong { font-size: 19px; }
.sales-quote-main > strong.empty-amount { color: var(--muted); font-size: 13px; }
.sales-quote-main > em { color: var(--muted); font-size: 8px; font-style: normal; }
.sales-quote-actions { display: flex; gap: 8px; }
.sales-quote-actions .btn { flex: 1; }

@media (max-width: 1100px) {
  .quote-rate-grid,
  .quote-legal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-quote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-quote-intro { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 760px) {
  .quote-saved-strip { align-items: stretch; flex-direction: column; }
  .quote-saved-strip > b { white-space: normal; }
  .quote-field-grid,
  .quote-responsibility-grid,
  .quote-rate-grid,
  .quote-legal-grid { grid-template-columns: 1fr; }
  .quote-commercial-grid { grid-template-columns: 1fr; }
  .quote-payment-row { grid-template-columns: 24px 1fr 80px; }
  .quote-payment-row label:nth-of-type(3) { grid-column: 2 / 4; }
  .quote-payment-row > button { grid-column: 3; grid-row: 1; justify-self: end; }
  .quote-rounding { grid-template-columns: 1fr; }
  .quote-live-preview { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-live-preview .grand { grid-column: 1 / -1; }
  .quote-builder-save { align-items: stretch; flex-direction: column; }
  .sales-quote-grid { grid-template-columns: 1fr; }
  .sales-quote-flow { display: grid; grid-template-columns: 1fr auto 1fr; width: 100%; white-space: normal; }
  .sales-quote-flow b { text-align: center; }
}
