@font-face {
  font-family: "Source Sans 3";
  src: url("/brand/source-sans-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/brand/source-sans-semibold.ttf") format("truetype");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("/brand/manrope-semibold.ttf") format("truetype");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #102641;
  --ink: #132842;
  --muted: #52647b;
  --blue: #17608b;
  --blue-dark: #124c70;
  --blue-soft: #eaf5fc;
  --canvas: #f3f6fa;
  --border: #dbe4ee;
  --field-border: #c9d6e3;
  --radius: 14px;
  --shadow: 0 2px 4px #10264106, 0 8px 24px #10264104;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Source Sans 3", system-ui, sans-serif; font-size: 1rem; line-height: 1.45; }
a { color: var(--blue-dark); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
svg { flex: none; }
h1, h2, p, dl, dd, ol, ul { margin: 0; }
h1, h2 { font-family: Manrope, system-ui, sans-serif; }
:focus-visible { outline: 3px solid #2b86bb; outline-offset: 3px; }
.skip { position: fixed; z-index: 10; left: 12px; top: 12px; transform: translateY(-150%); background: white; border-radius: 8px; padding: 10px 16px; }
.skip:focus { transform: none; }

.frame { width: min(1250px, calc(100% - 88px)); margin-inline: auto; }
.masthead { background: var(--navy); color: white; }
.masthead-inner { width: min(1290px, calc(100% - 88px)); margin-inline: auto; min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 22px; min-width: 0; color: white; text-decoration: none; }
.brand img { display: block; width: 174px; height: auto; }
.brand-divider { width: 1px; height: 30px; background: #ffffff31; }
.brand-product { color: #dfeaf5; font-family: Manrope, system-ui, sans-serif; letter-spacing: -.012em; font-size: .94rem; white-space: nowrap; }
.account { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #234667; color: #e1f4ff; font-size: .88rem; font-weight: 600; }
.account-name { color: #e3edf7; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.navigation { background: #fff; box-shadow: inset 0 -1px var(--border); }
.tabs { display: flex; gap: 27px; min-height: 53px; }
.tabs a { position: relative; display: flex; align-items: center; gap: 8px; padding: 1px 5px 0; color: var(--muted); font-weight: 600; text-decoration: none; }
.tabs a:is(:hover, [aria-current="page"]) { color: var(--blue-dark); }
.tabs a[aria-current="page"]::after { position: absolute; content: ""; inset: auto 0 0; height: 3px; border-radius: 3px 3px 0 0; background: #2481b4; }

.main { padding-block: 35px 62px; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; }
.page-title h1 { color: var(--navy); font-size: clamp(1.75rem, 2.7vw, 2.6rem); letter-spacing: -.053em; line-height: 1.17; }
.page-title p { margin-top: 7px; color: var(--muted); font-size: 1.05rem; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(287px, 330px); gap: 23px; align-items: start; }
.flow { display: flex; flex-direction: column; gap: 17px; min-width: 0; }
.sidebar { position: sticky; top: 20px; }
.card { background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.form-card, .summary-card, .workflow-card, .approvals, .state-card, .signature-card { padding: 22px; }
.section-title { display: flex; gap: 12px; align-items: center; min-height: 39px; margin-bottom: 18px; }
.section-title h2, .state-card h2, .empty h2 { font-size: 1.06rem; letter-spacing: -.022em; }
.section-title p { color: var(--muted); margin-top: 3px; font-size: .94rem; }
.section-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); border-radius: 10px; flex: none; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 17px; }
.span-full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field > label { color: var(--ink); font-weight: 600; font-size: .94rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--field-border); background: white; color: var(--ink);
  border-radius: 8px; min-height: 41px; padding: 8px 11px; line-height: 1.35;
}
input::placeholder, textarea::placeholder { color: #65768a; opacity: 1; }
input[readonly] { background: #f2f6fb; color: #4b6179; }
input[type="date"] { appearance: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid #428fbc; outline-offset: 1px; }
textarea { resize: vertical; }
select {
  appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23425870' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 8px center;
}
.line-header, .line-grid { display: grid; grid-template-columns: minmax(95px, 1fr) 68px 102px 81px minmax(82px, auto) 36px; gap: 9px; align-items: center; }
.line-header { color: var(--muted); font-size: .87rem; font-weight: 600; padding: 0 0 6px; }
.line-grid + .line-grid { margin-top: 9px; }
.line-grid label > span, .line-amount > span { display: none; }
.line-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.line-card > .button { margin-top: 15px; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.button { flex: none; min-height: 42px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.25; }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button.primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { background: #fff; border-color: #bdcddd; color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: #f3f7fb; border-color: #8ba6be; }
.button.soft { background: #eaf4fc; color: var(--blue-dark); }
.button.soft:hover:not(:disabled) { background: #ddebfa; }
.button:disabled { opacity: .58; }
.icon-button {
  width: 36px; height: 38px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: #5b7089;
}
.icon-button:hover:not(:disabled) { background: #eef4f9; color: var(--navy); }
.icon-button:disabled { opacity: .35; }
.delete:hover:not(:disabled) { background: #fcebed; color: #a7253e; }

.summary-card .section-title { margin-bottom: 14px; }
.amounts { display: grid; gap: 8px; color: var(--muted); }
.amounts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.amounts dd { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.amounts .total { margin-top: 3px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.amounts .total dd { font-family: Manrope, system-ui, sans-serif; font-size: clamp(1.15rem, 1.8vw, 1.46rem); line-height: 1.25; overflow-wrap: anywhere; letter-spacing: -.025em; }
.amounts small { color: var(--muted); margin-left: 4px; font-size: .77rem; }
.summary-actions { display: grid; gap: 8px; margin-top: 16px; }
.saved { display: flex; align-items: center; justify-content: center; gap: 6px; color: #176444; margin-top: 10px; font-size: .9rem; }
.workflow { list-style: none; padding: 0; display: grid; gap: 15px; }
.workflow li { position: relative; display: flex; align-items: flex-start; gap: 10px; }
.workflow li:not(:last-child)::after { content: ""; position: absolute; width: 1px; background: #d6e6f3; top: 31px; bottom: -14px; left: 13px; }
.workflow-icon { display: grid; place-items: center; width: 27px; height: 27px; background: #edf6fd; border-radius: 50%; color: var(--blue); flex: none; margin-top: 1px; }
.workflow strong, .workflow li div span { display: block; }
.workflow li div span { color: var(--muted); font-size: .89rem; }
.setup-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 15px; padding: 9px 10px; border-radius: 8px; background: #f2f6fa; color: #455a72; font-size: .86rem; }
.setup-note svg, .notice svg { margin-top: 2px; }
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 11px 14px; border-radius: 8px; background: #edf5fb; color: #1d4d6e; }
.notice.danger { background: #fbecef; color: #942644; }
.notice.success { background: #e9f8ef; color: #185b42; }
.page-notice { margin-bottom: 17px; }
.error-text { color: #942644; }

.review-dialog { border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 16px 70px #0d253f40; color: var(--ink); padding: 0; width: min(880px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.review-dialog[open] { display: flex; flex-direction: column; }
.review-dialog::backdrop { background: #0b1e35a3; }
.dialog-header, .dialog-actions { display: flex; justify-content: space-between; gap: 12px; padding: 17px 22px; flex: none; }
.dialog-header { border-bottom: 1px solid var(--border); }
.dialog-header h2 { font-size: 1.36rem; letter-spacing: -.035em; }
.dialog-header p { color: var(--muted); margin-top: 3px; }
.dialog-body { padding: 17px 22px; overflow: auto; display: grid; gap: 12px; min-height: 0; }
.dialog-actions { border-top: 1px solid var(--border); justify-content: flex-end; }
.dialog-body .document { box-shadow: none; }

.document { padding: 22px; }
.document-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 20px; padding-bottom: 19px; }
.document-fields dt { color: var(--muted); font-size: .88rem; }
.document-fields dd { font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.document-notes { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 15px; padding-bottom: 0; grid-template-columns: 1fr; }
.document-notes dd { font-weight: 400; }
.table-scroll { overflow: auto; }
.data-table { border-collapse: collapse; width: 100%; text-align: left; }
.data-table th { background: #edf4fa; color: #3e5873; white-space: nowrap; font-weight: 600; font-size: .89rem; }
.data-table :is(th, td) { padding: 11px 12px; }
.data-table td { border-bottom: 1px solid var(--border); }
.document-table td:first-child { min-width: 125px; overflow-wrap: anywhere; }
.document-amounts { width: min(100%, 285px); margin: 16px 0 0 auto; }
.history-table :is(th, td) { padding: 15px 18px; }
.history-table tr:last-child td { border-bottom: 0; }
.history-table a { font-weight: 600; }
.history-table td:first-child, .history-table td:nth-child(3) { white-space: nowrap; }
.status { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: .86rem; font-weight: 600; }
.status.complete { background: #e6f8ee; color: #185e43; }
.status.pending { background: #fff1cf; color: #75520c; }
.empty { padding: 54px 18px; display: grid; justify-items: center; gap: 10px; text-align: center; }
.empty .section-icon { width: 48px; height: 48px; }
.empty p, .state-card p, .signature-card p { color: var(--muted); }
.empty .button { margin-top: 7px; }
.self-start { align-self: flex-start; }

.state-card { display: grid; justify-items: start; gap: 10px; }
.approvals-list { padding: 0; list-style: none; }
.approvals-list li { display: flex; align-items: flex-start; padding: 10px 0; gap: 8px; border-top: 1px solid var(--border); }
.approvals-list li:last-child { padding-bottom: 0; }
.approval-dot { width: 24px; height: 24px; display: grid; place-items: center; color: #805e15; background: #fbf0d8; border-radius: 50%; flex: none; }
.approval-dot.signed { background: #e6f8ee; color: #185e43; }
.approval-meta { display: grid; min-width: 0; flex: 1; }
.approval-meta span, .approval-meta small, .approval-waiting { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.approval-meta small { color: #176444; padding-top: 3px; }
.signature-card .notice + p { margin-top: 10px; }
.sign-form { display: grid; gap: 14px; }
.signer-identity { display: grid; gap: 1px; overflow-wrap: anywhere; }
.signer-identity span { color: var(--muted); }
.consent { display: flex; align-items: flex-start; gap: 9px; line-height: 1.36; }
.consent input { accent-color: var(--blue); width: 16px; height: 16px; margin: 3px 0 0; flex: none; }

@media (max-width: 1100px) {
  .frame, .masthead-inner { width: calc(100% - 52px); }
  .workspace-grid { gap: 17px; grid-template-columns: minmax(0, 1fr) 278px; }
  .form-card, .summary-card, .workflow-card, .approvals, .state-card, .signature-card, .document { padding: 18px; }
  .line-header, .line-grid { grid-template-columns: minmax(80px, 1fr) 49px 79px 69px minmax(69px, auto) 31px; gap: 6px; }
  .line-grid .icon-button { width: 31px; }
}
@media (max-width: 830px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .masthead-inner { min-height: 66px; }
  .page-title { margin-bottom: 18px; }
  .main { padding-top: 27px; }
}
@media (max-width: 590px) {
  .frame, .masthead-inner { width: calc(100% - 28px); }
  .brand { gap: 10px; }
  .brand img { width: 125px; }
  .brand-divider { height: 23px; }
  .brand-product { font-size: .78rem; }
  .account-name { display: none; }
  .avatar { width: 30px; height: 30px; }
  .tabs { min-height: 48px; gap: 19px; }
  .page-title { align-items: flex-start; flex-direction: column; gap: 11px; }
  .page-title h1 { letter-spacing: -.04em; }
  .fields, .document-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .line-header { display: none; }
  .line-grid { grid-template-columns: .65fr 1fr 1fr 34px; align-items: end; gap: 7px; padding: 12px 0; border-top: 1px solid var(--border); }
  .line-grid + .line-grid { margin-top: 0; }
  .line-grid label > span, .line-amount > span { display: block; color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 3px; }
  .line-description { grid-column: 1 / -1; }
  .line-amount { grid-column: 1 / 4; display: flex; justify-content: space-between; align-items: baseline; }
  .line-amount span { margin-bottom: 0; }
  .line-grid .icon-button { grid-column: 4; height: 34px; }
  .line-card > .button { margin-top: 3px; }
  .dialog-header, .dialog-body, .dialog-actions { padding-inline: 12px; }
  .dialog-actions { flex-direction: column; }
  .history-table :is(th, td) { padding: 11px 12px; }
}

.signout {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid #8297b0;
  background: transparent;
  color: #fff;
  padding: 4px 10px;
  font-size: .89rem;
  white-space: nowrap;
}
.signout:hover { background: #234667; }
.login-page { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.login-brand { display: flex; align-items: center; min-height: 74px; padding-inline: max(18px, calc((100% - 1250px) / 2)); }
.login-card { width: min(440px, calc(100% - 32px)); padding: 28px; margin: clamp(40px, 12vh, 120px) auto 32px; align-self: start; }
.login-card .section-title h2 { font-size: 1.33rem; }
