:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #191c22;
  background: #f5f6f8;
  font-synthesis: none;
  --ink: #191c22;
  --muted: #5d6470;
  --line: #e1e4e9;
  --red: #a81929;
  --red-hover: #871422;
  --red-soft: #fbecef;
  --panel: #fff;
  --side: #171a20;
  --radius: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 290px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.58;
  cursor: wait;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #d78792;
  outline-offset: 2px;
}
a {
  color: var(--red);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 4vw, 39px);
  letter-spacing: -0.045em;
  line-height: 1.15;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.022em;
}
h3 {
  font-size: 16px;
  letter-spacing: -0.015em;
}
small {
  font-size: 12px;
}
p {
  line-height: 1.56;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 680;
  min-width: 0;
}
label small {
  font-weight: 480;
  color: var(--muted);
}
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #cfd4db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}
textarea {
  resize: vertical;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.boot {
  padding: 28px;
  color: var(--muted);
}
.eyebrow {
  display: block;
  color: var(--red);
  font-size: 10px;
  letter-spacing: 0.13em;
  font-weight: 790;
  text-transform: uppercase;
  line-height: 1.45;
}
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 690;
  white-space: normal;
  text-align: center;
}
.button.primary {
  background: var(--red);
  color: white;
  box-shadow: 0 1px 2px #53131b26;
}
.button.primary:hover {
  background: var(--red-hover);
}
.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: #dce0e6;
}
.button.secondary:hover {
  background: #f8f9fb;
  border-color: #bcc3ce;
}
.button.plain,
.button.danger-link {
  background: transparent;
  color: var(--red);
}
.button.plain:hover,
.button.danger-link:hover {
  background: var(--red-soft);
}
.button.full {
  width: 100%;
  justify-content: space-between;
}
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  flex: 0 0 auto;
}
.icon-button:hover {
  background: #f1f2f5;
  color: var(--ink);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.actions.end {
  justify-content: flex-end;
}
.stack {
  display: grid;
  gap: 16px;
}
.quiet {
  color: var(--muted);
  font-size: 14px;
}
.form-error {
  color: #a81929;
  font-size: 13px;
  font-weight: 620;
  min-height: 0;
}
.form-error:empty {
  display: none;
}

.auth-shell {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(320px, 0.88fr) 1.12fr;
  background: #fff;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 5vw, 72px);
  min-height: 100svh;
}
.auth-brand,
.customer-brand {
  display: flex;
  gap: 13px;
  align-items: center;
}
.auth-brand img,
.customer-brand img {
  object-fit: contain;
}
.auth-brand strong,
.customer-brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.025em;
}
.auth-brand span,
.customer-brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.auth-form {
  margin: 42px auto;
  max-width: 410px;
  width: 100%;
}
.auth-form h1 {
  margin: 10px 0 9px;
}
.auth-form p {
  color: var(--muted);
  font-size: 14px;
}
.auth-form form {
  margin-top: 25px;
}
.auth-form input {
  min-height: 48px;
}
.auth-form .form-error {
  color: var(--red);
}
.auth-foot {
  color: #626874;
  font-size: 12px;
}
.auth-aside {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 86% 20%, #54202b 0%, transparent 46%),
    linear-gradient(140deg, #2a2d35, #15171c 70%);
  padding: clamp(25px, 6.5vw, 110px);
  color: #fff;
}
.auth-aside h2 {
  font-size: clamp(32px, 4.1vw, 66px);
  letter-spacing: -0.055em;
  line-height: 1.05;
  margin: 12px 0 15px;
  max-width: 580px;
}
.auth-aside p {
  color: #e3dfe2;
  max-width: 355px;
}
.auth-aside .eyebrow {
  color: #f0a4ad;
}
.auth-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    125deg,
    transparent,
    transparent 88px,
    #ffffff0e 89px,
    #ffffff0e 90px
  );
  mask-image: linear-gradient(160deg, #000, transparent 82%);
}

.layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100svh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  background: var(--side);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 15px 15px;
}
.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 4px 24px;
}
.sidebar-brand img {
  width: 47px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}
.sidebar-brand strong {
  font-size: 16px;
  letter-spacing: -0.025em;
}
.sidebar-brand small {
  display: block;
  color: #b1b8c5;
  margin-top: 4px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 10px 11px;
  background: transparent;
  color: #ccd0da;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 620;
}
.sidebar nav button:hover {
  background: #252831;
  color: #fff;
}
.sidebar nav button[aria-current] {
  background: #31343e;
  border-color: #3e424e;
  color: #fff;
}
.sidebar nav button[aria-current] svg {
  color: #ffb3bc;
}
.sidebar-foot {
  margin-top: auto;
  padding: 15px 5px 3px;
  border-top: 1px solid #353740;
  color: #afb5c1;
  font-size: 11px;
  line-height: 1.55;
}
.main {
  min-width: 0;
}
.topbar {
  min-height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 8px clamp(15px, 3.5vw, 46px);
}
.breadcrumb {
  color: #555c68;
  font-size: 13px;
  font-weight: 600;
}
.breadcrumb span {
  margin: 0 6px;
  color: #777e89;
}
.profile {
  display: flex;
  align-items: center;
  gap: 9px;
}
.profile strong,
.profile small {
  display: block;
}
.profile strong {
  font-size: 13px;
}
.profile small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 780;
  border-radius: 9px;
  font-size: 13px;
}
.content {
  max-width: 1390px;
  margin: 0 auto;
  padding: clamp(18px, 3.3vw, 42px);
  display: grid;
  gap: 18px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 13px;
  padding-bottom: 2px;
}
.page-heading h1 {
  margin: 7px 0 5px;
}
.page-heading p {
  font-size: 14px;
  color: var(--muted);
}
.page-heading .actions {
  flex-shrink: 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metrics article {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 128px;
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}
.metrics article span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 690;
  color: #4b5361;
}
.metrics svg {
  color: var(--red);
  flex-shrink: 0;
}
.metrics article strong {
  font-size: 32px;
  letter-spacing: -0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metrics article small {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  box-shadow: 0 1px 2px #1d1e2205;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.panel-content {
  padding: 18px;
}
.table-wrap {
  width: 100%;
  overflow: auto;
}
.documents {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
.documents th {
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.015em;
  color: #59616e;
  background: #f8f9fb;
  white-space: nowrap;
}
.documents th,
.documents td {
  padding: 12px 15px;
  border-bottom: 1px solid #edf0f3;
}
.documents tbody tr:last-child td {
  border-bottom: 0;
}
.documents tbody tr:hover {
  background: #fbfcfd;
}
.documents .money {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.doc-link,
.text-button {
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
  color: var(--red);
}
.doc-link small {
  display: block;
  color: #616875;
  font-size: 10px;
  margin-bottom: 4px;
  white-space: nowrap;
}
.doc-link strong {
  font-size: 13px;
  overflow-wrap: anywhere;
  color: #20232a;
}
.doc-link:hover strong,
.text-button:hover {
  text-decoration: underline;
  color: var(--red);
}
.text-button {
  font-size: 12px;
  font-weight: 720;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 50px;
  background: #f0f2f5;
  color: #414a57;
  line-height: 1;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ready {
  background: #fff2d7;
  color: #765016;
}
.badge.sent,
.badge.viewed {
  background: #eaf1fb;
  color: #275182;
}
.badge.accepted,
.badge.paid {
  background: #e8f4ec;
  color: #246044;
}
.badge.declined,
.badge.cancelled {
  background: #fbecee;
  color: #972131;
}
.empty {
  padding: 30px 16px 33px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  margin: 9px 0 3px;
}
.empty p {
  font-size: 13px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: auto;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 11px;
}
.filters {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.search {
  position: relative;
  flex: 1;
}
.search svg {
  position: absolute;
  top: 12px;
  left: 11px;
  color: #676f7a;
  pointer-events: none;
}
.search input {
  padding-left: 35px;
}
.filter-label {
  flex: 0 0 min(180px, 32%);
}
.timeline {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #eef0f3;
}
.timeline li:last-child {
  border-bottom: 0;
}
.timeline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  margin-top: 6px;
}
.timeline strong,
.timeline div span,
.timeline div button {
  display: block;
}
.timeline strong {
  font-size: 13px;
}
.timeline div span,
.timeline time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.timeline div button {
  margin-top: 4px;
}
.followups {
  display: grid;
  gap: 9px;
}
.followups article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 10px;
}
.followups h3 {
  margin: 4px 0;
}
.followups small {
  color: var(--muted);
}

dialog {
  padding: 0;
  border: 1px solid #dfe2e8;
  border-radius: 16px;
  max-width: calc(100vw - 24px);
  width: 490px;
  max-height: calc(100dvh - 34px);
  color: var(--ink);
  box-shadow: 0 20px 70px #14151a40;
}
dialog.wide {
  width: 790px;
}
dialog::backdrop {
  background: #1518219e;
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 17px;
}
.dialog-body {
  padding: 18px;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.items-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.items {
  display: grid;
  gap: 8px;
}
.item-row {
  display: grid;
  grid-template-columns: minmax(110px, 2.3fr) minmax(73px, 0.7fr) minmax(
      85px,
      0.9fr
    ) 36px;
  align-items: start;
  gap: 8px;
  padding: 10px;
  background: #f7f8fa;
  border-radius: 9px;
}
.item-row .icon-button {
  margin-top: 17px;
  width: 36px;
}
.estimate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--red-soft);
  border-radius: 9px;
  padding: 13px;
  color: #741523;
  font-size: 13px;
  font-weight: 690;
}
.estimate strong {
  font-size: 17px;
  letter-spacing: -0.025em;
}
.detail-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.detail-intro h3 {
  font-size: 25px;
  overflow-wrap: anywhere;
  margin: 5px 0;
}
.detail-intro p:last-child {
  color: var(--muted);
  font-size: 14px;
}
.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 15px 0;
}
.detail-facts div,
.customer-meta div {
  min-width: 0;
  background: #f7f8fa;
  border: 1px solid #eceef1;
  border-radius: 9px;
  padding: 10px;
}
.detail-facts span,
.detail-facts small,
.customer-meta small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-facts strong,
.customer-meta strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.detail-facts small {
  margin: 4px 0 0;
}
.detail-actions {
  margin-bottom: 17px;
}
.detail-lines h3,
.history h3,
.share-box h3,
.delivery-list h3 {
  margin-bottom: 7px;
}
.detail-lines div {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.detail-lines span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 0;
}
.detail-lines strong {
  white-space: nowrap;
}
.notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #4f5660;
  font-size: 13px;
  padding: 10px 0;
}
.assignment,
.record-sent {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
}
.assignment label,
.record-sent label {
  flex: 0 1 240px;
}
.share-box {
  border: 1px solid #efd7db;
  background: #fff8f9;
  border-radius: 11px;
  padding: 13px;
  margin: 0 0 15px;
}
.share-box .actions {
  margin-top: 8px;
}
.share-box p,
.delivery-list p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.history,
.delivery-list {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 13px;
}
.status-actions {
  margin: 8px 0;
}
.customer-shell {
  max-width: 760px;
  margin: auto;
  padding: clamp(14px, 5vw, 38px);
}
.customer-brand {
  margin: 0 0 18px;
}
.customer {
  padding: clamp(16px, 4vw, 28px);
}
.customer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.customer h1 {
  margin: 7px 0;
}
.customer-head p {
  font-size: 15px;
  color: var(--muted);
}
.customer-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.customer .estimate {
  margin: 14px 0;
}
.customer .actions {
  margin-top: 14px;
}
#toast {
  display: none;
  position: fixed;
  z-index: 10;
  bottom: 16px;
  right: 16px;
  max-width: min(400px, calc(100vw - 32px));
  background: #182a23;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  padding: 11px 14px;
  border-radius: 8px;
  box-shadow: 0 5px 22px #14151a30;
}
#toast.show {
  display: block;
}
#toast.error {
  background: #921b2a;
}

@media (max-width: 1050px) {
  .layout {
    grid-template-columns: 184px minmax(0, 1fr);
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    padding-inline: 11px;
  }
  .documents th,
  .documents td {
    padding: 11px 10px;
  }
  .table-wrap {
    overflow-x: auto;
  }
}
@media (max-width: 710px) {
  .auth-shell {
    display: block;
  }
  .auth-aside {
    display: none;
  }
  .auth-panel {
    padding: 25px 20px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 11px 12px 8px;
  }
  .sidebar-brand {
    padding: 0 0 9px;
  }
  .sidebar-brand img {
    width: 41px;
    height: 35px;
  }
  .sidebar-brand small {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    scrollbar-width: thin;
  }
  .sidebar nav button {
    min-height: 41px;
    flex: 0 0 auto;
    gap: 6px;
    padding: 7px 8px;
    font-size: 11px;
  }
  .sidebar nav svg {
    width: 14px;
    height: 14px;
  }
  .sidebar-foot {
    display: none;
  }
  .topbar {
    min-height: 55px;
    padding: 6px 13px;
  }
  .content {
    padding: 15px;
    gap: 13px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .metrics {
    gap: 8px;
  }
  .metrics article {
    min-height: 103px;
    padding: 11px;
    gap: 6px;
  }
  .metrics article strong {
    font-size: 27px;
  }
  .metrics article small {
    font-size: 10px;
  }
  .panel-head {
    padding: 12px;
  }
  .panel-head .button {
    font-size: 11px;
    padding: 6px;
  }
  .panel-content {
    padding: 12px;
  }
  .documents thead {
    display: none;
  }
  .documents,
  .documents tbody,
  .documents tr,
  .documents td {
    display: block;
    width: 100%;
  }
  .documents tr {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
  }
  .documents tr:last-child {
    border-bottom: 0;
  }
  .documents td {
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .documents td:first-child {
    padding-bottom: 7px;
    display: block;
    text-align: left;
  }
  .documents td:not(:first-child)::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--muted);
    font-weight: 640;
    text-align: left;
    flex: 0 0 auto;
  }
  .documents .money {
    white-space: normal;
  }
  .filters {
    padding: 9px;
    flex-wrap: wrap;
  }
  .search {
    flex: 1 0 100%;
  }
  .filter-label {
    flex: 1 0 100%;
  }
  .timeline li {
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 6px;
  }
  .timeline time {
    grid-column: 2;
    margin: 0;
  }
  .item-row {
    grid-template-columns: 1fr 1fr 33px;
  }
  .item-row label:first-child {
    grid-column: 1 / -1;
  }
  .item-row .icon-button {
    width: 33px;
  }
  .dialog-body {
    padding: 13px;
  }
  .fields {
    gap: 8px;
  }
  .button {
    min-height: 43px;
  }
  .detail-facts {
    gap: 5px;
  }
  .detail-facts div {
    padding: 7px;
  }
  .followups article {
    align-items: flex-start;
  }
}
@media (max-width: 365px) {
  .fields {
    grid-template-columns: 1fr;
  }
  .detail-facts {
    grid-template-columns: 1fr;
  }
  .profile strong {
    font-size: 12px;
  }
  .breadcrumb {
    font-size: 11px;
  }
  .record-sent,
  .assignment {
    align-items: stretch;
    flex-direction: column;
  }
  .record-sent label,
  .assignment label {
    flex: auto;
  }
  .followups article {
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
  }
}
