@import url("./print.css");
:root {
  --navy: #16365f;
  --navy-deep: #102a4d;
  --blue: #285a9b;
  --ink: #172b43;
  --muted: #758298;
  --line: #e4e9ef;
  --canvas: #f5f7fa;
  --white: #fff;
  --orange: #e49b53;
  --green: #217c68;
  --red: #b64a48;
  --radius: 12px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Tahoma,
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #dd9c58;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  font-weight: 650;
}
h3 {
  font-size: 14px;
}
p {
  line-height: 1.6;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
  min-height: 42px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #285a9b12;
}
input[type="checkbox"] {
  width: 17px;
  min-height: auto;
  height: 17px;
  accent-color: var(--blue);
}
textarea {
  resize: vertical;
  min-height: 90px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #526078;
}
label.check {
  display: flex;
  align-items: center;
  font-size: 13px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  border: 1px solid #dce3ec;
  padding: 10px 15px;
  min-height: 40px;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 550;
  white-space: nowrap;
}
.btn:hover {
  background: #f0f4f8;
}
.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.btn.primary:hover {
  background: #244e81;
}
.btn.soft {
  background: #edf3fb;
  border-color: transparent;
  color: var(--blue);
}
.btn.danger {
  color: var(--red);
}
.btn.icon {
  padding: 8px;
  min-width: 38px;
}
.btn.small {
  padding: 6px 10px;
  min-height: 32px;
  font-size: 12px;
}
.text-btn {
  background: none;
  border: 0;
  color: var(--blue);
  padding: 6px;
  font-size: 12px;
  font-weight: 600;
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--navy-deep);
  color: #b8c8df;
  position: fixed;
  inset-block: 0;
  width: 230px;
  display: flex;
  flex-direction: column;
  padding: 27px 18px;
  z-index: 20;
}
.brand {
  padding: 0 14px 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}
.brand-mark {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -2px;
  color: white;
  border: 2px solid #6982a4;
  width: 38px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.brand strong {
  font-size: 20px;
  letter-spacing: -0.8px;
}
.brand span {
  display: block;
  font-size: 10px;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  margin-top: 3px;
  color: #a4b9d6;
}
.nav-caption {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: #7993b4;
  margin: 10px 14px 12px;
}
.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #bacbe2;
  padding: 12px 14px;
  border-radius: 7px;
  margin: 3px 0;
  font-size: 13px;
}
.nav-link:hover {
  background: #ffffff09;
  color: white;
}
.nav-link.active {
  background: #ffffff12;
  color: white;
  box-shadow: inset 3px 0 0 var(--orange);
}
.nav-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}
.side-bottom {
  margin-top: auto;
  padding-top: 24px;
}
.workspace-note {
  margin: 14px 8px 24px;
  padding: 14px;
  border: 1px solid #ffffff15;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.7;
  color: #8ea6c7;
}
.workspace-note strong {
  color: #c9d7e9;
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-top: 1px solid #ffffff15;
}
.avatar {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #e4ecf7;
  color: var(--navy);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.profile strong {
  display: block;
  font-size: 12px;
  color: #e8eff8;
}
.profile small {
  font-size: 10px;
  color: #8da7c8;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  gap: 20px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb b {
  color: var(--ink);
  font-weight: 500;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.top-search {
  width: 260px;
  position: relative;
}
.top-search input {
  background: #f6f8fb;
  border: 0;
  font-size: 12px;
  padding-inline-start: 35px;
  min-height: 36px;
}
.top-search svg {
  position: absolute;
  inset-inline-start: 10px;
  top: 10px;
  width: 15px;
  height: 15px;
  color: #8a96a6;
}
.language {
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.connection {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #3c9e85;
}
.content {
  max-width: 1580px;
  margin: auto;
  padding: 34px 36px 48px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 9px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 21px;
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6b7b90;
  font-size: 12px;
}
.stat-top svg {
  color: #7e93ae;
  width: 18px;
}
.stat-value {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 14px 0 7px;
}
.stat-value em {
  font-size: 11px;
  font-weight: 500;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0;
  margin-inline-start: 4px;
}
.stat-foot {
  color: #8b97a7;
  font-size: 11px;
}
.stat.alert .stat-value {
  color: var(--red);
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.quick-card:hover {
  border-color: #9db4d1;
  transform: translateY(-2px);
}
.quick-icon {
  height: 40px;
  width: 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #edf3fc;
  color: var(--blue);
  flex-shrink: 0;
}
.quick-icon.warm {
  background: #fcf2e8;
  color: #ad7641;
}
.quick-icon.green {
  background: #eaf6f1;
  color: #3e826e;
}
.quick-card b {
  font-size: 12px;
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}
.quick-card small {
  font-size: 10px;
}
.arrow {
  margin-inline-start: auto;
  color: #b5c0ce;
  font-size: 20px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 22px;
}
.card {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  padding: 21px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eff2f6;
  gap: 10px;
}
.card-body {
  padding: 23px;
}
.card-head p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
}
th {
  text-align: start;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #8390a2;
  text-transform: uppercase;
  background: #fbfcfd;
  padding: 13px 20px;
  white-space: nowrap;
  font-weight: 600;
}
td {
  padding: 17px 20px;
  border-bottom: 1px solid #eff2f6;
  font-size: 12px;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr[data-open] {
  cursor: pointer;
}
tbody tr[data-open]:hover {
  background: #f9fbfe;
}
.doc-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-cell svg {
  width: 17px;
  color: #7691b5;
}
.doc-cell strong {
  font-size: 12px;
  display: block;
}
.doc-cell small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10px;
  background: #eef2f7;
  color: #6b7c91;
  white-space: nowrap;
}
.badge.issued,
.badge.claimed {
  background: #eaf5ef;
  color: #367c64;
}
.badge.draft,
.badge.planned {
  background: #fdf4e6;
  color: #a3773c;
}
.badge.cancelled,
.badge.overdue {
  background: #fbeeee;
  color: #b65350;
}
.badge.archived,
.badge.superseded {
  background: #f0f1f4;
  color: #8a8e9a;
}
.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}
.empty {
  text-align: center;
  padding: 42px 22px;
  color: var(--muted);
}
.empty svg {
  width: 30px;
  height: 30px;
  color: #a8b8cc;
  margin-bottom: 12px;
}
.empty h3 {
  color: #4b617e;
  margin-bottom: 8px;
}
.empty p {
  font-size: 12px;
  max-width: 350px;
  margin: 0 auto 17px;
}
.empty.compact {
  padding: 28px 20px;
}
.payment-entry {
  padding: 17px 22px;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.payment-entry strong {
  font-size: 12px;
  display: block;
}
.payment-entry small {
  font-size: 10px;
  display: block;
  margin-top: 5px;
}
.payment-entry .amount {
  font-size: 13px;
  text-align: end;
}
.helper-card {
  background: #edf2f9;
  border: 1px solid #e2e9f2;
  border-radius: 10px;
  padding: 22px;
  margin-top: 20px;
}
.helper-card h3 {
  margin-bottom: 8px;
  font-size: 13px;
}
.helper-card p {
  font-size: 12px;
  color: #71849e;
}
.toolbar {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.toolbar input {
  flex: 1;
  min-width: 150px;
}
.toolbar select {
  width: auto;
  max-width: 210px;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}
.editor-main {
  display: grid;
  gap: 20px;
}
.editor-aside {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wide {
  grid-column: 1/-1;
}
.stack {
  display: grid;
  gap: 15px;
}
.line-item {
  border-bottom: 1px solid var(--line);
  padding: 17px 22px;
}
.line-top {
  display: grid;
  grid-template-columns: 30px minmax(150px, 1fr) 80px 90px 105px 30px;
  gap: 10px;
  align-items: end;
}
.line-index {
  color: #8c9aaf;
  align-self: center;
  font-size: 12px;
}
.line-top label {
  font-size: 10px;
}
.line-top input {
  padding: 9px 10px;
  font-size: 12px;
}
.line-extra {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding-inline-start: 40px;
  margin-top: 10px;
}
.line-extra label {
  font-size: 10px;
}
.line-extra input {
  font-size: 11px;
  min-height: 33px;
  padding: 7px 9px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6c7d94;
  padding: 8px 0;
  gap: 8px;
}
.summary-row.total {
  border-top: 1px solid var(--line);
  margin-top: 9px;
  padding-top: 17px;
  font-weight: 700;
  color: var(--navy);
  font-size: 17px;
}
.save-state {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hint {
  font-size: 11px;
  color: #8391a5;
  line-height: 1.7;
}
.notice {
  background: #fff7e9;
  color: #936828;
  border: 1px solid #f3e1c0;
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.good-notice {
  background: #eaf5f0;
  border-color: #d4e9de;
  color: #37785e;
}
.tabs {
  display: flex;
  gap: 5px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 13px 18px;
  white-space: nowrap;
}
.tabs button.active {
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}
.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.record-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.record-card h3 {
  font-size: 16px;
}
.record-card p {
  font-size: 12px;
  color: var(--muted);
  white-space: pre-line;
}
.record-card .actions {
  margin-top: auto;
}
.record-icon {
  background: #edf3fb;
  color: #5073a1;
  border-radius: 10px;
  height: 40px;
  width: 40px;
  display: grid;
  place-items: center;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #102a4d, #274b75);
}
.login-card {
  background: #fff;
  width: min(430px, 92vw);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 20px 60px #0002;
}
.login-logo {
  max-width: 180px;
  max-height: 70px;
  object-fit: contain;
  margin-bottom: 27px;
}
.login-card h1 {
  font-size: 25px;
}
.login-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 25px;
}
.login-card form {
  display: grid;
  gap: 17px;
}
.loading {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.menu-toggle {
  display: inline-flex;
}
.footer-note {
  font-size: 10px;
  color: #9aa5b3;
  margin-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 13px 22px;
  background: var(--navy-deep);
  color: #fff;
  border-radius: 9px;
  box-shadow: 0 8px 25px #0002;
  z-index: 100;
  transition: transform 0.2s;
  max-width: 90vw;
  font-size: 13px;
}
#toast.visible {
  transform: translateX(-50%) translateY(0);
}
#toast.error {
  background: #923f40;
}
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(720px, 94vw);
  max-height: 90vh;
  box-shadow: 0 20px 90px #102a4d33;
  color: var(--ink);
}
dialog::backdrop {
  background: #102a4d66;
  backdrop-filter: blur(2px);
}
.modal-head {
  padding: 21px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.modal-body {
  padding: 25px;
}
.modal-foot {
  padding: 18px 25px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  background: #fafbfd;
}
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.type-grid button {
  min-height: 85px;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.attachment div {
  flex: 1;
}
.attachment strong {
  font-size: 12px;
  word-break: break-word;
}
.attachment small {
  display: block;
  margin-top: 4px;
}
.history-entry {
  border-inline-start: 2px solid #e1e9f4;
  padding: 0 0 20px 20px;
  margin-inline-start: 6px;
}
.history-entry strong {
  font-size: 13px;
}
.history-entry p {
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0 9px;
}
.payment-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.forecast-bar {
  height: 7px;
  background: #edf1f6;
  border-radius: 10px;
  margin-top: 12px;
  overflow: hidden;
}
.forecast-bar span {
  display: block;
  height: 100%;
  background: #5f87b8;
  border-radius: 10px;
}
.editor-actions-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.inline-error {
  background: #fff0ef;
  color: #ad4540;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
}
.permission-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
details summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  padding: 8px 0;
}
details[open] summary {
  margin-bottom: 12px;
}
.file-input {
  padding: 10px;
  background: #f7f9fc;
}
.preview-container {
  background: #e8edf3;
  padding: 22px;
  overflow: auto;
}
.preview-sheet {
  background: white;
  max-width: 794px;
  margin: auto;
  padding: 45px;
  box-shadow: 0 2px 10px #23364d12;
}
.preview-sheet table {
  font-size: 11px;
}
.preview-sheet th,
.preview-sheet td {
  padding: 10px;
}
.doc-title {
  color: var(--navy);
  font-size: 25px;
  margin-bottom: 18px;
}
.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 22px;
  margin-bottom: 24px;
}
.doc-header img {
  width: 170px;
  object-fit: contain;
  align-self: flex-start;
}
.doc-meta {
  font-size: 11px;
  line-height: 1.9;
}
.doc-notes {
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.8;
  margin-top: 15px;
}
.doc-footer {
  border-top: 1px solid #ccd6e3;
  margin-top: 35px;
  padding-top: 15px;
  text-align: center;
  color: #718096;
  font-size: 9px;
}
.doc-stamp {
  max-width: 140px;
  max-height: 90px;
  object-fit: contain;
  margin-top: 15px;
}
.draft-watermark {
  font-size: 11px;
  letter-spacing: 2px;
  color: #ad7b3e;
  margin-bottom: 12px;
}
.doc-total {
  margin-inline-start: auto;
  max-width: 260px;
  margin-top: 20px;
}
.preview-actions {
  display: flex;
  justify-content: flex-end;
  padding: 15px;
  gap: 8px;
  background: #fff;
}
.mobile-only {
  display: none;
}
[dir="rtl"] .sidebar {
  right: 0;
}
[dir="rtl"] .nav-link.active {
  box-shadow: inset -3px 0 0 var(--orange);
}
[dir="rtl"] .history-entry {
  padding: 0 20px 20px 0;
}
[dir="rtl"] .brand strong {
  letter-spacing: 0;
}
@media (min-width: 1600px) {
  .content {
    padding-top: 42px;
  }
  .stats {
    gap: 22px;
  }
  .quick-grid {
    gap: 18px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .sidebar {
    width: 195px;
    padding: 24px 12px;
  }
  .content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .editor-aside {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
  .record-grid {
    grid-template-columns: 1fr 1fr;
  }
  .top-search {
    width: 190px;
  }
  .stat {
    padding: 17px;
  }
  .stat-value {
    font-size: 25px;
  }
  .workspace-note {
    display: none;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    width: 230px;
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 10px 0 100px #0005;
  }
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }
  [dir="rtl"] .sidebar.open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: inline-flex;
  }
  .mobile-only {
    display: block;
  }
  .topbar {
    height: 62px;
    padding: 0 17px;
    gap: 9px;
  }
  .breadcrumb,
  .top-search,
  .connection {
    display: none;
  }
  .top-actions {
    margin-inline-start: auto;
    gap: 8px;
  }
  .content {
    padding: 25px 17px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 12px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .page-heading > .actions {
    justify-content: flex-end;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    margin-bottom: 24px;
  }
  .stat {
    padding: 16px;
  }
  .stat-value {
    font-size: 25px;
    margin: 12px 0 6px;
  }
  .stat-top {
    font-size: 11px;
  }
  .stat-foot {
    font-size: 10px;
  }
  .quick-grid {
    gap: 10px;
  }
  .quick-card {
    padding: 14px 10px;
    gap: 9px;
  }
  .quick-card .arrow {
    display: none;
  }
  .quick-icon {
    width: 32px;
    height: 35px;
  }
  .quick-card b {
    font-size: 11px;
  }
  .quick-card small {
    font-size: 9px;
  }
  .dashboard-grid {
    gap: 18px;
  }
  .card-head {
    padding: 18px;
  }
  .card-body {
    padding: 18px;
  }
  .form-grid.three {
    grid-template-columns: 1fr 1fr;
  }
  .record-grid {
    grid-template-columns: 1fr;
  }
  .line-top {
    grid-template-columns: 1fr 1fr 1fr 30px;
    gap: 8px;
  }
  .line-index {
    display: none;
  }
  .line-top label:first-of-type {
    grid-column: 1/-1;
  }
  .line-extra {
    padding: 0;
    grid-template-columns: 1fr 1fr;
  }
  .line-item {
    padding: 16px;
  }
  .editor-aside {
    grid-template-columns: 1fr;
  }
  .payment-summary {
    grid-template-columns: 1fr;
  }
  .toolbar {
    padding: 12px;
    gap: 8px;
  }
  .toolbar select {
    max-width: 48%;
    font-size: 12px;
  }
  .type-grid {
    grid-template-columns: 1fr;
  }
  .modal-body {
    padding: 19px;
  }
  .footer-note {
    font-size: 9px;
  }
  .preview-sheet {
    min-width: 650px;
    padding: 30px;
  }
  .preview-container {
    padding: 10px;
  }
  .page-heading .btn {
    font-size: 11px;
    padding: 9px 11px;
  }
  .btn {
    min-height: 42px;
  }
  .editor-actions-bottom {
    flex-wrap: wrap;
  }
  td,
  th {
    padding: 13px;
  }
  .form-grid {
    gap: 13px;
  }
  .tabs button {
    padding: 12px;
    font-size: 12px;
  }
  .mobile-hide {
    display: none;
  }
}
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.preview-actions {
  flex-wrap: wrap;
}
.record-card[hidden] {
  display: none;
}
@media (max-width: 760px) {
  .forecast-grid {
    grid-template-columns: 1fr;
    gap: 23px;
  }
  .preview-actions .btn {
    font-size: 11px;
    padding: 8px 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Historical archive and financial history */
tbody tr[data-action] {
  cursor: pointer;
}
tbody tr[data-action]:hover {
  background: #fafcfe;
}
.archive-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  font-size: 11px;
  color: var(--muted);
}
.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}
.fact-grid small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.fact-grid strong {
  font-size: 13px;
  word-break: break-word;
}
.sub-head {
  font-size: 12px;
  margin: 18px 0 4px;
}
.extracted {
  margin-top: 18px;
}
.extracted summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.extracted pre {
  margin-top: 10px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  font: 12px/1.7 ui-monospace, Menlo, monospace;
}
@media (max-width: 700px) {
  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Renewals forecast */
.nav-count {
  margin-inline-start: auto;
  background: #e9a23b;
  color: #10233e;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
}
tr.month-row td {
  background: #f4f7fb;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  padding: 9px 20px;
}

.notice.related div + div {
  margin-top: 6px;
}

/* Editor: sections, optional request column, internal cost fields */
.line-top.flex {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.line-top.flex .grow {
  flex: 1 1 220px;
}
.line-top.flex .w-s {
  width: 82px;
}
.line-top.flex .w-m {
  width: 108px;
}
.line-top.flex textarea {
  min-height: 0;
}
.line-top label.internal input {
  background: #fffaf0;
  border-color: #f0dcb4;
}
.section-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 22px;
  background: #f4f7fb;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-head label {
  flex: 1;
  font-size: 10px;
}
.section-head input {
  font-weight: 700;
}
.internal-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #e6cf9f;
  border-radius: 8px;
  background: #fffaf0;
}

.warn-list {
  margin: 0;
  padding-inline-start: 18px;
  line-height: 1.9;
  color: #936828;
}

a.today-row,
.today-row[role="button"] {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.today-row:hover,
.today-row[role="button"]:hover {
  background: #fafcfe;
}
.target-bar {
  height: 8px;
  border-radius: 6px;
  background: #e8eef6;
  margin: 8px 0 6px;
  overflow: hidden;
}
.target-bar i {
  display: block;
  height: 100%;
  background: var(--navy);
}

/* Side menu: scrolls when it is taller than the window, and can be hidden on wide screens */
.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform 0.2s ease;
}
.sidebar nav,
.side-bottom {
  flex-shrink: 0;
}
.shell {
  transition: grid-template-columns 0.2s ease;
}
@media (min-width: 761px) {
  .menu-hidden .shell {
    grid-template-columns: 0 minmax(0, 1fr);
  }
  .menu-hidden .sidebar {
    transform: translateX(-100%);
  }
  [dir="rtl"] .menu-hidden .sidebar {
    transform: translateX(100%);
  }
}

.lock-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* Dashboard */
a.stat-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.stat-link:hover .stat {
  border-color: #b9c8dc;
}
.create-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 12px;
  color: var(--muted);
}
.today-row {
  gap: 14px;
}
.today-row a.doc-cell {
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}
.today-side {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.month-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 18px 20px 16px;
  height: 190px;
}
.month-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.month-col .bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.month-col .bars i {
  display: block;
  width: 42%;
  max-width: 14px;
  min-height: 1px;
  border-radius: 3px 3px 0 0;
}
.month-col small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 6px;
  white-space: nowrap;
}
.k1 {
  background: var(--navy);
}
.k2 {
  background: #4fa58b;
}
.chart-key {
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
}
.chart-key i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-inline-end: 5px;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover {
  color: var(--navy);
}

/* Field validation */
input.invalid,
select.invalid,
textarea.invalid {
  border-color: #c9504d !important;
  background: #fdf3f3 !important;
}
.field-error {
  display: block;
  color: #b0413e;
  font-size: 11px;
  margin-top: 4px;
}
.link-state {
  display: block;
  margin-top: 5px;
}
.payment-summary.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
/* Phones: one column of fields, and documents as cards instead of a wide table */
@media (max-width: 760px) {
  .form-grid,
  .form-grid.three,
  .fact-grid,
  .editor-aside,
  .payment-summary.four,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  .line-top.flex .grow,
  .line-top.flex .w-s,
  .line-top.flex .w-m {
    flex: 1 1 45%;
    width: auto;
  }
  .line-top.flex .grow {
    flex-basis: 100%;
  }
  .section-head,
  .page-heading,
  .card-head {
    flex-wrap: wrap;
  }
  .toolbar select,
  .toolbar input {
    flex: 1 1 100%;
    max-width: none !important;
    width: 100% !important;
  }
  table.doc-table thead {
    display: none;
  }
  table.doc-table,
  table.doc-table tbody,
  table.doc-table tr {
    display: block;
    width: 100%;
  }
  table.doc-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  table.doc-table td {
    padding: 0;
    border: 0;
  }
  table.doc-table td:first-child {
    grid-column: 1 / -1;
  }
  table.doc-table td.amount {
    text-align: end;
  }
}

/* Brand: the company logo as supplied, on a light panel so it is never recoloured */
.brand {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0 4px 26px;
}
.brand-logo {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}
.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
}
.brand .brand-sub {
  text-align: center;
  margin-top: 0;
}
.top-logo {
  display: none;
}
.top-logo img {
  height: 26px;
  width: auto;
  display: block;
}
.login-logo {
  max-width: 260px;
  height: auto;
}
@media (max-width: 760px) {
  .top-logo {
    display: block;
  }
  .breadcrumb {
    display: none;
  }
}
/* Job timeline */
.timeline {
  padding: 8px 22px 18px;
}
.timeline-row {
  display: grid;
  grid-template-columns: 92px 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #eff2f6;
}
.timeline-row:last-child {
  border-bottom: 0;
}
.timeline-date {
  font-size: 11px;
  color: var(--muted);
  padding-top: 3px;
}
.timeline-dot svg {
  width: 18px;
  height: 18px;
  color: #6b7c91;
}
.timeline-body small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
/* Statement */
.statement-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.statement-head img {
  height: 46px;
  width: auto;
}
details > summary.card-head {
  cursor: pointer;
  list-style: none;
}
details > summary.card-head::-webkit-details-marker {
  display: none;
}
.btn.danger.primary,
.modal-foot .btn.danger {
  background: #b0413e;
  border-color: #b0413e;
  color: #fff;
}
/* Keyboard focus is always visible; motion is kept small and can be switched off */
:focus-visible {
  outline: 2px solid #f0a54a;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  .statement .card-body {
    padding: 0 0 12px !important;
  }
}

.check-row {
  padding: 6px 0;
  font-size: 13px;
}

/* Sidebar brand: the supplied light mark on navy, with the company name beside it */
.brand {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 0 6px 26px;
  min-width: 0;
}
.brand-mark-img {
  width: 40px;
  height: 40px;
  flex: none;
  display: block;
}
.brand-name {
  min-width: 0;
}
.brand-name strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1.1;
}
.brand .brand-name span {
  display: block;
  font-size: 7px;
  letter-spacing: 1px;
  margin-top: 4px;
  color: #c3d2e6;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip {
  border: 1px solid #b9c8dc;
  background: #f4f7fb;
  color: var(--navy);
  border-radius: 12px;
  padding: 2px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover {
  background: #e8eef6;
}

/* Task centre */
.task-add {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.task-add input {
  flex: 1;
  min-width: 0;
}
.task-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 22px 0;
  flex-wrap: wrap;
}
.task-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: #526078;
}
.task-tabs button.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.task-tabs button span {
  font-weight: 700;
  margin-inline-start: 4px;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid #eff2f6;
  cursor: pointer;
}
.task-row:hover {
  background: #fafcfe;
}
.task-row.is-done strong {
  text-decoration: line-through;
  color: var(--muted);
}
.task-check {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #9fb0c6;
  background: #fff;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.task-row.is-done .task-check {
  background: #4fa58b;
  border-color: #4fa58b;
}
.task-main {
  flex: 1;
  min-width: 0;
}
.task-main strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.task-main small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.task-side {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.task-flag {
  color: #e9a23b;
}
.task-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.task-step label {
  flex: 1;
  margin: 0;
}
.struck {
  text-decoration: line-through;
  color: var(--muted);
}
#toast {
  cursor: pointer;
}
@media (max-width: 760px) {
  .task-row {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .task-side {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-inline-start: 36px;
  }
  .task-check {
    width: 30px;
    height: 30px;
  }
  dialog .modal-foot {
    flex-wrap: wrap;
  }
}
.task-check.auto {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: #7a8aa3;
  cursor: default;
}
a.task-main {
  color: inherit;
  text-decoration: none;
}
tfoot td {
  border-top: 2px solid var(--line);
  background: #fafcfe;
}
.last-sold {
  display: block;
  color: #2f6f5e;
}
