:root {
  --bg: #f7f8fa;
  --surface: #fff;
  --sidebar: #fafafa;
  --text: #292e34;
  --muted: #858a92;
  --border: #e9ebee;
  --brand: #55765e;
  --sage: #e7eee8;
  --peach: #fcf0e5;
  --lavender: #eeebf8;
  --blue: #eaf0f9;
  --danger: #b14f43;
  --shadow: 0 8px 36px #1e2a3910;
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
}
:root[data-theme="dark"] {
  --bg: #181c20;
  --surface: #22272c;
  --sidebar: #1e2327;
  --text: #ebedf0;
  --muted: #a0a7b0;
  --border: #353b42;
  --sage: #2f4237;
  --peach: #49392e;
  --lavender: #37324a;
  --blue: #2d3a50;
  --shadow: 0 8px 30px #0003;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 31px;
  letter-spacing: -1.1px;
  font-weight: 650;
  line-height: 1.25;
}
h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
small {
  font-size: 12px;
  color: var(--muted);
}
button {
  border: none;
  background: none;
}
button,
a,
input,
select,
textarea {
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #7ba98a;
  outline-offset: 3px;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--muted);
}
.icon-btn:hover {
  background: var(--border);
  color: var(--text);
}
.btn {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg);
  border-color: #b7bfc5;
}
.btn.primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.btn.primary:hover {
  opacity: 0.9;
  box-shadow: 0 3px 10px #0002;
}
.btn .icon {
  width: 17px;
  height: 17px;
}
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px;
}
.text-btn:hover {
  color: var(--brand);
}
.text-btn .icon {
  width: 15px;
  height: 15px;
}
.danger {
  color: var(--danger) !important;
}
.subtle {
  color: var(--muted);
  font-size: 12px;
}
.text-green {
  color: #507d60;
}
.text-orange {
  color: #b27748;
}
.number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.loading {
  padding: 20vh 30px;
  text-align: center;
}
.loading h1,
.loading p {
  margin-bottom: 20px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 246px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px 36px;
  min-height: 62px;
}
.logo-placeholder {
  height: 55px;
  border: 1.5px dashed #ced2d4;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 4px;
  width: 100%;
  color: #81878b;
}
.brand-logo {
  display: block;
  max-height: 62px;
  max-width: 100%;
  object-fit: contain;
}
.new-button {
  width: 100%;
  height: 46px;
  margin-bottom: 35px;
  justify-content: flex-start;
  padding-left: 22px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 650;
  color: var(--muted);
  padding: 0 16px;
  margin-bottom: 14px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: 9px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #747b84;
  position: relative;
}
.nav-item.active {
  background: var(--sage);
  color: var(--text);
  font-weight: 650;
  box-shadow: inset 3px 0 var(--brand);
}
.nav-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.nav-item > svg {
  flex-shrink: 0;
}
.nav-item:hover {
  background: var(--border);
  color: var(--text);
}
.nav-item em {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 5px;
}
.app-shell {
  margin-left: 246px;
}
.topbar {
  height: 95px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 490px;
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--muted);
}
.search-box #search {
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  width: 100%;
  font-size: 12px;
  min-width: 40px;
}
.search-box:focus-within {
  border-color: #9bb4a2;
}
.search-box .icon {
  width: 18px;
  height: 18px;
}
.search-box kbd {
  font-family: inherit;
  font-size: 10px;
  white-space: nowrap;
  border: 1px solid var(--border);
  padding: 0 4px;
  border-radius: 4px;
}
.account {
  display: flex;
  align-items: center;
  gap: 16px;
}
.account-name {
  text-align: right;
  white-space: nowrap;
}
.account-name strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.account-name small {
  font-size: 10px;
}
.account-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}
.avatar {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #756654;
  background: #eee7dc;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.avatar-button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0;
}
.mobile-nav {
  display: none;
}
main#main {
  padding: 36px 40px 40px;
  max-width: 1800px;
  margin: auto;
  animation: appear 0.3s ease;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-head .actions {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.date-label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-right: 8px;
}
.date-label .icon {
  width: 16px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}
.metric {
  text-align: left;
  padding: 20px 22px;
  border-radius: 13px;
  min-width: 0;
  border: 1px solid #00000003;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.metric:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.sage {
  background: var(--sage);
}
.peach {
  background: var(--peach);
}
.lavender {
  background: var(--lavender);
}
.blue {
  background: var(--blue);
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 500;
}
.metric-top .icon {
  opacity: 0.65;
  width: 19px;
  height: 19px;
}
.metric > strong {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -1px;
  display: block;
  white-space: nowrap;
}
.metric-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 10px;
  opacity: 0.68;
  gap: 4px;
}
.metric-foot .icon {
  width: 13px;
  height: 13px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 23px;
  gap: 10px;
}
.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.count {
  font-size: 11px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--muted);
  font-weight: 500;
}
.dashboard-middle {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(230px, 1fr);
  gap: 22px;
  margin-bottom: 26px;
}
.chart-total {
  padding: 0 24px;
  position: relative;
}
.chart-total > strong {
  display: block;
  font-size: 25px;
  font-weight: 550;
  letter-spacing: -0.7px;
}
.chart-total > span {
  font-size: 10px;
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 16px;
  position: absolute;
  right: 24px;
  top: 16px;
  font-size: 10px;
  color: var(--muted);
}
.legend span {
  display: flex;
  gap: 6px;
  align-items: center;
}
.legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}
.in {
  background: #97b7a1;
}
.out {
  background: #e5c5a9;
}
.chart {
  height: 175px;
  display: flex;
  justify-content: space-around;
  gap: 20px;
  padding: 10px 30px 20px;
  margin: 15px 24px 4px;
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 34px,
    var(--border) 35px,
    transparent 36px
  );
  background-size: 100% calc(100% - 30px);
  background-repeat: no-repeat;
}
.chart-group {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1;
}
.chart-group > span {
  font-size: 10px;
  color: var(--muted);
}
.bars {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  width: 100%;
}
.bar {
  width: 20px;
  max-width: 40%;
  border-radius: 5px 5px 0 0;
  min-height: 2px;
  transform-origin: bottom;
  animation: grow 0.6s ease;
}
.goal-panel {
  background: linear-gradient(135deg, var(--surface), var(--sage));
  position: relative;
}
.tiny-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--surface);
  border-radius: 9px;
  color: var(--brand);
}
.goal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 20px 25px;
  gap: 12px;
}
.progress-ring {
  height: 108px;
  width: 108px;
  border-radius: 50%;
  background: conic-gradient(#7ba487 var(--progress), #dbe6de 0);
  padding: 8px;
  transform: rotate(-25deg);
}
.progress-ring > div {
  height: 100%;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(25deg);
}
.progress-ring strong {
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -1px;
}
.progress-ring small {
  font-size: 13px;
  margin-left: 2px;
}
.progress-ring .icon {
  height: 16px;
  color: #91b29b;
}
.goal-body h3 {
  font-size: 12px;
  margin-top: 2px;
}
.goal-dots {
  display: flex;
  gap: 7px;
}
.goal-dots i {
  height: 5px;
  width: 16px;
  background: #dbe6de;
  border-radius: 3px;
}
.goal-dots .filled {
  background: #85aa91;
}
.goal-body .btn {
  background: transparent;
  border: none;
  font-size: 11px;
  min-height: 28px;
  padding: 3px;
  margin-top: 4px;
}
.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr);
  gap: 22px;
}
.dashboard-bottom th {
  font-size: 10px;
  padding: 11px 15px;
}
.dashboard-bottom td {
  font-size: 11px;
  padding: 14px 15px;
}
.dashboard-bottom td:nth-child(4),
.dashboard-bottom th:nth-child(4) {
  display: none;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  padding: 13px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 19px 22px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--bg);
}
td strong {
  font-size: 12px;
  font-weight: 550;
}
td small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}
td:last-child {
  width: 44px;
  padding-right: 14px;
}
.row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 0;
}
.row-link strong {
  display: block;
}
.row-link small {
  display: block;
  font-size: 10px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.building-icon {
  width: 37px;
  height: 37px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.building-icon .icon {
  width: 20px;
  height: 20px;
}
.tone-0 {
  background: var(--sage);
  color: #728d79;
}
.tone-1 {
  background: var(--peach);
  color: #b68c68;
}
.tone-2 {
  background: var(--lavender);
  color: #9184b7;
}
.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10px;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}
.pill.miet,
.pill.green {
  background: var(--sage);
  color: #60836a;
}
.pill.weg,
.pill.orange {
  background: var(--peach);
  color: #aa7c54;
}
.pill.sev {
  background: var(--lavender);
  color: #8a7caa;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 22px;
  border-top: 1px solid var(--border);
}
.task-row > div {
  flex: 1;
  min-width: 0;
}
.task-row strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.task-row span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.task-row time {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.task-check {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid #cfd5d2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.task-check:hover {
  background: var(--sage);
  border-color: var(--brand);
}
.done .task-check {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
.task-check .icon {
  width: 13px;
  height: 13px;
}
.done strong {
  text-decoration: line-through;
  color: var(--muted);
}
.task-row .overdue {
  color: #b17a53;
}
.dashboard-bottom .task-row {
  padding: 16px 20px;
}
.dashboard-bottom .task-row .more {
  display: none;
}
.onboarding {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-top: 25px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 12px;
  background: var(--surface);
}
.onboarding span {
  color: var(--muted);
}
.onboarding .btn {
  margin-left: auto;
}
.empty {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 220px;
  padding: 35px;
  color: var(--muted);
}
.empty > .icon {
  width: 34px;
  height: 34px;
  opacity: 0.5;
}
.empty h3 {
  font-size: 14px;
  font-weight: 450;
}
.empty.compact {
  min-height: 110px;
  padding: 25px;
  font-size: 12px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.tabs button {
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.tabs button.active {
  background: var(--border);
  font-weight: 600;
  color: var(--text);
}
.tabs button:hover {
  background: var(--border);
}
.tabs span {
  font-size: 10px;
  margin-left: 7px;
  opacity: 0.6;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}
.toolbar .tabs {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}
.toolbar select {
  max-width: 250px;
}
.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 28px;
  padding: 22px 0;
}
.mini-metrics > div {
  padding: 0 24px;
  border-right: 1px solid var(--border);
}
.mini-metrics > div:last-child {
  border: 0;
}
.mini-metrics span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.mini-metrics strong {
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.5px;
}
.reversed {
  opacity: 0.55;
}
.reversed td > strong {
  text-decoration: line-through;
}
.breadcrumb {
  margin-bottom: 18px;
  font-size: 11px;
}
.object-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 25px;
  flex-wrap: wrap;
}
.object-summary span {
  display: flex;
  gap: 8px;
  align-items: center;
}
.section-gap {
  margin-top: 22px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.list-row > span:first-child {
  flex: 1;
}
.list-row small {
  display: block;
  margin-top: 4px;
}
.list-row > strong {
  flex: 1;
}
.list-row:hover {
  background: var(--bg);
}
.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 44px;
}
.document-row .row-link,
.document-row .row-link > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.document-actions {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  flex-shrink: 0;
}
.search-result {
  width: 100%;
  text-align: left;
}
.billing-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.billing-type {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 12px;
  padding: 24px;
  text-align: left;
}
.billing-type strong {
  flex: 1;
  font-size: 14px;
}
.billing-type > .icon:last-child {
  width: 17px;
}
.billing-type:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.task-progress {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 25px;
  background: var(--sage);
  padding: 22px;
  border-radius: 12px;
  font-size: 12px;
}
.task-progress > span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.task-progress > div {
  flex: 1;
  max-width: 400px;
  background: #cadace;
  height: 7px;
  border-radius: 7px;
  overflow: hidden;
}
.task-progress i {
  height: 100%;
  background: #6e9679;
  display: block;
  transition: width 0.4s;
}
.settings-card {
  max-width: 720px;
}
.brand-preview {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 35px 24px;
}
.brand-preview .logo-placeholder,
.brand-preview .brand-logo {
  max-width: 170px;
}
.swatch {
  height: 26px;
  width: 26px;
  border-radius: 50%;
  border: 1px solid #0001;
  margin-left: auto;
}
.profile-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
}
.profile-summary .avatar {
  height: 60px;
  width: 60px;
  font-size: 18px;
}
.profile-summary h3 {
  margin-bottom: 5px;
}
.profile-summary span {
  font-size: 12px;
  color: var(--muted);
}
.security-line {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.security-line > .icon {
  color: #789b82;
}
.security-line .pill {
  margin-left: auto;
}
.integration-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 20px 24px;
}
.integration-card > div {
  flex: 1;
}
.integration-card p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.integration-card > .icon {
  color: var(--brand);
  width: 26px;
  height: 26px;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(580px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px #0003;
  animation: modal-in 0.2s ease;
}
dialog::backdrop {
  background: #18241f66;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  font-size: 20px;
}
.modal-body {
  padding: 24px 25px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.modal-body p {
  font-size: 13px;
  line-height: 1.7;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 25px;
  border-top: 1px solid var(--border);
}
.field[hidden] {
  display: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
}
.field input,
.field select,
.field textarea,
input:not([type="checkbox"]),
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  min-width: 0;
  max-width: 100%;
}
input[type="color"] {
  min-height: 42px;
  max-width: 110px;
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  font-size: 12px;
}
input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
input[type="file"] {
  font-size: 11px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-error {
  color: var(--danger);
  font-size: 12px;
  white-space: pre-wrap;
  padding: 0 25px;
}
.form-error:not(:empty) {
  padding: 10px 25px 20px;
}
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  font-weight: 400;
}
.notice {
  background: var(--bg);
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 12px !important;
  color: var(--muted);
}
.payment-summary {
  background: var(--sage);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 8px;
}
.payment-summary span {
  font-size: 12px;
}
.allocation-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.allocation-list .check-label {
  grid-column: 1/-1;
}
.budget-row {
  display: grid;
  grid-template-columns: 1fr 110px 1fr 26px;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}
.budget-row select,
.budget-row input {
  width: 100%;
  padding: 9px 7px;
  font-size: 11px;
}
.budget-row .field {
  font-size: 10px;
}
.budget-row .icon-btn {
  width: 26px;
}
.review-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.65;
  margin: 18px 0;
}
.new-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.new-grid .btn {
  justify-content: flex-start;
  padding: 20px;
}
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 13px;
}
.details dt {
  color: var(--muted);
}
.details dd {
  margin: 0;
}
.panel > .details {
  padding: 0 24px 24px;
  overflow-wrap: anywhere;
}
.context {
  position: fixed;
  z-index: 1000;
  width: 232px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 45px #0002;
  animation: appear 0.12s ease;
}
.context[hidden] {
  display: none;
}
.context button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  font-size: 12px;
}
.context button:hover,
.context button:focus {
  background: var(--bg);
}
.context .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--surface);
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 2000;
  font-size: 13px;
  transition:
    opacity 0.2s,
    transform 0.2s;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.paper {
  max-width: 1050px;
  background: var(--surface);
  padding: 45px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 auto;
}
.paper-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.paper-top h2 {
  font-size: 23px;
  margin: 26px 0 8px;
}
.paper-top p {
  color: var(--muted);
  font-size: 12px;
}
.paper-top img {
  height: 40px;
  max-width: 180px;
  object-fit: contain;
}
.print-logo {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}
.paper-meta {
  display: flex;
  gap: 36px;
  padding: 26px 0;
  margin: 15px 0;
  border-block: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.paper-meta strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
}
.paper table {
  font-size: 11px;
}
.paper td,
.paper th {
  padding: 12px 8px;
}
.paper .number {
  text-align: right;
}
.paper-note {
  font-size: 12px;
  line-height: 1.7;
  margin: 20px 0;
  color: var(--muted);
  padding: 15px 20px;
  background: var(--bg);
  border-radius: 8px;
}
.panel > .paper-note {
  margin: 0 24px 24px;
}
.recipient {
  margin-top: 30px;
  break-inside: avoid;
}
.recipient h3 {
  margin: 20px 0 12px;
}
.recipient-total {
  padding: 15px 0;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}
.paper footer {
  margin-top: 35px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 9px;
  color: var(--muted);
}
.auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface);
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
}
.auth-form {
  width: 360px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: appear 0.4s;
}
.auth-form h1 {
  font-size: 29px;
  margin-bottom: 8px;
}
.auth-submit {
  width: 100%;
  margin-top: 3px;
  justify-content: space-between;
  padding: 13px 18px;
}
.auth-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
}
.auth-security .icon {
  width: 14px;
  height: 14px;
}
.auth-form .form-error {
  padding: 0;
}
.auth-form small {
  line-height: 1.7;
}
.qr {
  width: 210px;
  height: 210px;
  align-self: center;
  background: white;
  padding: 8px;
  border-radius: 8px;
}
.auth-form details {
  font-size: 11px;
  color: var(--muted);
}
.totp-secret {
  display: block;
  word-break: break-all;
  padding: 12px;
  font-size: 11px;
}
.recovery-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px;
  background: var(--bg);
  border-radius: 8px;
}
.recovery-codes code {
  font-size: 12px;
}
body:has(dialog[open]) {
  overflow: hidden;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes grow {
  from {
    transform: scaleY(0.02);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (min-width: 1550px) {
  .sidebar {
    width: 265px;
    padding-inline: 22px;
  }
  .app-shell {
    margin-left: 265px;
  }
  main#main {
    padding: 44px 52px;
  }
  .topbar {
    padding-inline: 52px;
  }
  .metric {
    padding: 24px;
  }
  .metric > strong {
    font-size: 32px;
  }
  .dashboard-middle {
    grid-template-columns: 2fr 1fr;
  }
  .chart {
    height: 205px;
  }
  .bars {
    height: 155px;
  }
  .goal-body {
    gap: 17px;
  }
  .progress-ring {
    width: 124px;
    height: 124px;
  }
  .dashboard-bottom td:nth-child(4),
  .dashboard-bottom th:nth-child(4) {
    display: table-cell;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 212px;
    padding-inline: 13px;
  }
  .app-shell {
    margin-left: 212px;
  }
  .topbar {
    padding-inline: 26px;
    gap: 20px;
  }
  main#main {
    padding: 30px 26px;
  }
  .metric {
    padding: 17px;
  }
  .metric > strong {
    font-size: 23px;
  }
  .metrics {
    gap: 12px;
  }
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
  .date-label {
    display: none;
  }
  .account {
    gap: 10px;
  }
  .search-box {
    max-width: 370px;
  }
  .onboarding {
    gap: 15px;
    flex-wrap: wrap;
  }
  .billing-type {
    padding: 20px 15px;
    gap: 10px;
  }
  .billing-type strong {
    font-size: 12px;
  }
}
@media (max-width: 950px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-middle {
    grid-template-columns: 1fr 230px;
    gap: 15px;
  }
  .legend {
    position: static;
    margin-top: 12px;
  }
  .chart {
    padding-inline: 0;
    margin-inline: 15px;
    gap: 8px;
  }
  .mini-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .mini-metrics > div:nth-child(2) {
    border: 0;
  }
  .billing-types {
    grid-template-columns: 1fr;
  }
  .finance-toolbar .tabs {
    flex-wrap: wrap;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .auth-main {
    padding: 45px;
  }
  .paper {
    padding: 28px;
  }
}
@media (max-width: 740px) {
  .sidebar {
    display: none;
  }
  .app-shell {
    margin-left: 0;
  }
  .topbar {
    height: 74px;
    padding: 0 17px;
    gap: 12px;
  }
  .search-box {
    padding: 8px;
    max-width: none;
  }
  .search-box #search {
    font-size: 11px;
  }
  .search-box kbd {
    display: none;
  }
  .account-divider {
    display: none;
  }
  .account {
    gap: 4px;
  }
  .avatar {
    width: 32px;
    height: 32px;
  }
  .theme-button {
    width: 28px;
  }
  .search-box > .icon {
    display: none;
  }
  main#main {
    padding: 26px 18px;
  }
  .page-head {
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 15px;
  }
  h1 {
    font-size: 26px;
  }
  .page-head .actions {
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .actions .btn {
    padding: 8px 11px;
    font-size: 11px;
  }
  .metrics {
    gap: 12px;
  }
  .metric {
    padding: 17px;
  }
  .metric > strong {
    font-size: 24px;
  }
  .metric-top {
    font-size: 11px;
  }
  .metric-foot {
    font-size: 9px;
  }
  .dashboard-middle {
    grid-template-columns: 1fr;
  }
  .goal-panel .goal-body {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 10px 20px;
    justify-items: start;
    padding: 0 24px 25px;
  }
  .goal-body .progress-ring {
    grid-row: 1/4;
    height: 90px;
    width: 90px;
  }
  .goal-body h3 {
    font-size: 14px;
  }
  .goal-body .btn {
    grid-column: 2;
  }
  .goal-body .progress-ring strong {
    font-size: 25px;
  }
  .panel-head {
    padding: 18px;
  }
  .dashboard-bottom td {
    padding: 14px 12px;
  }
  .dashboard-bottom td:nth-child(3),
  .dashboard-bottom th:nth-child(3) {
    display: none;
  }
  .task-row {
    padding: 16px 18px;
  }
  .task-row .more {
    width: 24px;
  }
  .task-row time {
    font-size: 9px;
  }
  .onboarding {
    gap: 12px;
    font-size: 11px;
  }
  .onboarding > span:not(.tiny-icon) {
    display: none;
  }
  .mini-metrics strong {
    font-size: 20px;
  }
  .mini-metrics > div {
    padding: 0 18px;
  }
  .table-scroll table {
    min-width: 580px;
  }
  .dashboard-bottom .table-scroll table {
    min-width: 0;
  }
  .billing-types {
    gap: 12px;
  }
  .billing-type {
    padding: 20px;
  }
  .billing-type strong {
    font-size: 14px;
  }
  .tabs {
    gap: 0;
  }
  .tabs button {
    font-size: 11px;
    padding: 9px 12px;
  }
  .object-summary {
    gap: 14px;
  }
  .list-row {
    padding: 18px;
    gap: 12px;
  }
  .brand-preview {
    flex-wrap: wrap;
  }
  .security-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .auth-main {
    padding: 48px 28px;
  }
  .auth-form h1 {
    font-size: 28px;
  }
  .form-grid {
    gap: 12px;
  }
  .budget-row {
    grid-template-columns: 1fr 1fr;
  }
  .budget-row .remove-budget {
    justify-self: end;
  }
  .paper {
    padding: 24px 18px;
  }
  .paper-top h2 {
    font-size: 20px;
  }
  .paper-meta {
    gap: 20px;
  }
  .task-progress {
    gap: 12px;
    padding: 18px;
    font-size: 11px;
  }
  .task-progress > div {
    min-width: 45px;
  }
  .new-grid .btn {
    padding: 16px;
    font-size: 12px;
  }
  .page-head .date-label {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  body {
    background: #fff !important;
    color: #222 !important;
    font-size: 10pt;
  }
  .sidebar,
  .topbar,
  .mobile-nav,
  .no-print,
  #toast,
  dialog,
  .context {
    display: none !important;
  }
  .app-shell {
    margin: 0;
  }
  main#main {
    padding: 0;
    max-width: none;
  }
  .paper {
    padding: 0;
    border: 0;
    border-radius: 0;
    max-width: none;
    background: white;
  }
  .paper .table-scroll {
    overflow: visible;
  }
  .paper table {
    min-width: 0;
  }
  .paper td,
  .paper th {
    background: white;
    color: #222;
    padding: 9px 5px;
  }
  .paper-meta,
  .paper footer {
    color: #555;
  }
  .paper-note {
    background: #f6f6f6;
    color: #555;
  }
  .paper-top h2 {
    font-size: 20pt;
  }
  .paper-meta {
    break-inside: avoid;
  }
  .recipient {
    break-inside: avoid;
  }
  .pill {
    border: 1px solid #ccc;
    color: #555;
    background: white;
  }
  thead {
    display: table-header-group;
  }
  @page {
    size: A4;
    margin: 18mm;
  }
}

/* Tasks share one data set across list, board and calendar. */
.task-title {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.task-title:hover {
  color: var(--brand);
}
.done .task-title,
.calendar-task.done {
  text-decoration: line-through;
  color: var(--muted);
}
.kanban-board {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  overflow-x: auto;
  padding: 2px 2px 20px;
}
.kanban-column {
  flex: 1 0 260px;
  min-width: 260px;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--column-color);
  border-radius: 12px;
  padding: 14px;
}
.kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: grab;
}
.kanban-column h2 {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.kanban-column h2 span {
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
  margin-top: 14px;
}
.task-card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px;
  background: var(--bg);
  cursor: grab;
  transition:
    border-color 0.18s,
    transform 0.18s;
}
.task-card:hover {
  border-color: var(--column-color);
  transform: translateY(-2px);
}
.task-card .task-title {
  display: block;
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
}
.task-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}
.task-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.task-card .overdue {
  color: #ad6735;
}
.column-add {
  margin-top: 12px;
  width: 100%;
  background: transparent;
  border-style: dashed;
}
.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}
.calendar-toolbar h2 {
  font-size: 20px;
}
.calendar-toolbar > div {
  display: flex;
  gap: 8px;
}
[data-action="task-month:-1"] .icon {
  transform: rotate(180deg);
}
.calendar-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.task-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  min-width: 700px;
}
.calendar-weekday {
  padding: 12px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.calendar-day {
  min-height: 116px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.calendar-day:nth-child(7n) {
  border-right: 0;
}
.calendar-day.outside {
  background: var(--bg);
}
.calendar-number {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-bottom: 5px;
  cursor: pointer;
}
.calendar-number:hover {
  background: var(--sage);
}
.is-today .calendar-number {
  color: white;
  background: var(--brand);
}
.calendar-task {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 7px;
  margin: 4px 0;
  border: 0;
  border-left: 3px solid var(--column-color);
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  cursor: grab;
  transition: background 0.18s;
}
.calendar-task:hover {
  background: var(--sage);
}

.task-editor {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.task-editor-title {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.task-editor-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--sage);
  color: var(--brand);
}
.task-editor-title .field,
.task-assignment .field {
  flex: 1;
}
.task-editor input[name="title"] {
  font-size: 17px;
  font-weight: 600;
}
.task-assignment {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--sage);
}
.task-assignment > .icon {
  color: var(--brand);
  flex-shrink: 0;
}
.task-assignee,
.task-row .task-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
  min-width: 0;
}
.task-assignee > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-assignee .assignee-mark,
.task-row .assignee-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--brand);
  font-size: 9px;
  font-weight: 600;
}
.calendar-task .task-assignee {
  font-size: 10px;
  margin-top: 4px;
}
.calendar-task .assignee-mark {
  width: 18px;
  height: 18px;
  font-size: 8px;
}
.calendar-task .unassigned {
  display: none;
}

dialog:has(.bank-import) {
  width: min(880px, calc(100vw - 32px));
}
.bank-import,
#bank-columns {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.bank-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--sage);
  flex-wrap: wrap;
}
.bank-upload > .icon {
  color: var(--brand);
}
.bank-upload .field {
  flex: 1;
}
.bank-upload small {
  color: var(--muted);
  font-size: 11px;
}
.bank-sample {
  max-height: 180px;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.bank-sample td,
.bank-sample th {
  min-width: 130px;
  font-size: 11px;
}
.bank-summary {
  padding: 20px;
  border-radius: 12px;
  background: var(--sage);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-wrap: anywhere;
}
.bank-summary strong {
  font-size: 28px;
}
.bank-summary > span {
  font-size: 12px;
  color: var(--muted);
}
.bank-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.bank-filters .active {
  background: var(--sage);
  color: var(--brand);
  border-color: var(--brand);
}
.bank-description {
  max-width: 380px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.page-head h1,
.modal-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.modal-head .icon-btn {
  flex-shrink: 0;
}
.mobile-navigation-menu {
  display: grid;
  gap: 10px;
}
.mobile-navigation-menu .btn {
  justify-content: flex-start;
  min-height: 48px;
}
@media screen and (max-width: 740px) {
  .document-row {
    grid-template-columns: minmax(0, 1fr) auto 44px;
  }
  .document-row .row-link {
    grid-column: 1 / 3;
  }
  .document-row > .pill {
    justify-self: start;
  }
  .document-row .document-actions {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  main#main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    z-index: 100;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px max(6px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px #00000008;
  }
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 52px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 10px;
    transition:
      color 0.18s,
      background 0.18s;
  }
  .mobile-nav button.active {
    background: var(--sage);
    color: var(--brand);
    font-weight: 600;
  }
  .mobile-nav .icon {
    width: 21px;
    height: 21px;
  }
  #toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .page-head .actions {
    width: 100%;
    justify-content: flex-start;
  }
  .page-head .actions > .btn {
    flex: 1 1 auto;
    min-height: 42px;
    justify-content: center;
    font-size: 12px;
  }
  .mini-metrics > div {
    padding: 0 14px;
    min-width: 0;
  }
  .mini-metrics strong {
    display: block;
    font-size: clamp(16px, 4.5vw, 20px);
    overflow-wrap: anywhere;
  }
  .panel-head,
  .paper-top,
  .list-row {
    flex-wrap: wrap;
  }
  .paper-top > div {
    min-width: 0;
  }
  .paper-top h2,
  .paper footer,
  .recipient-total {
    overflow-wrap: anywhere;
  }
  .table-scroll .mobile-records {
    display: block;
    min-width: 0;
  }
  .mobile-records thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .mobile-records tbody {
    display: block;
  }
  .mobile-records tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 12px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  .mobile-records tr:last-child {
    border-bottom: 0;
  }
  .mobile-records td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .mobile-records td:first-child {
    grid-column: 1 / -1;
  }
  .mobile-records td:last-child {
    width: auto;
  }
  .mobile-records td:nth-child(3),
  .mobile-records td:nth-child(5) {
    text-align: right;
  }
  .mobile-records td:nth-child(4) {
    text-align: left;
    font-size: 18px;
    align-self: center;
  }
  .mobile-records td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .journal-records td:first-child {
    padding-right: 34px;
  }
  .journal-records td:last-child {
    position: absolute;
    top: 12px;
    right: 10px;
  }
  .mobile-records .icon-btn {
    min-width: 40px;
    min-height: 40px;
  }
  .bank-records .actions {
    gap: 4px;
  }
}

.contact-filters {
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.deadline-indicator {
  position: relative;
  flex-shrink: 0;
}
.deadline-indicator em {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  border-radius: 9px;
  background: var(--orange-soft, #faeadc);
  color: var(--text);
  font-size: 9px;
  font-style: normal;
}
.deadline-indicator em:empty {
  display: none;
}
.deadline-summary {
  margin-bottom: 24px;
}
.deadline-more {
  border-top: 1px solid var(--border);
  padding: 12px 22px;
}
.deadline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px;
  border-top: 1px solid var(--border);
}
.deadline-row:first-child {
  border-top: 0;
}
.deadline-date {
  display: grid;
  gap: 7px;
  min-width: 125px;
}
.deadline-date strong {
  font-size: 13px;
}
.deadline-copy {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.deadline-copy h3 {
  margin: 0 0 7px;
  font-size: 14px;
}
.deadline-copy p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}
.deadline-row .actions {
  flex-wrap: wrap;
}
.deadline-row .btn {
  font-size: 12px;
}
.deadline-row.resolved {
  opacity: 0.7;
}
.document-templates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.template-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  text-align: left;
  transition:
    transform 0.18s,
    border-color 0.18s;
}
.template-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
}
.template-card strong {
  flex: 1;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.template-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border-radius: 10px;
  background: var(--sage);
  color: var(--brand);
  flex-shrink: 0;
}
.document-paper h2 {
  margin-bottom: 24px;
}
.document-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
  font-family: Georgia, serif;
  font-size: 15px;
}
.document-editor {
  width: min(1080px, calc(100vw - 32px));
}
#document-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: clip;
  margin-top: 22px;
}
.editor-toolbar {
  background: var(--surface);
  padding: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.editor-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  padding-right: 8px;
  border-right: 1px solid var(--border);
}
.editor-tools button,
.editor-tools select,
.editor-color {
  height: 34px;
  min-width: 34px;
  max-width: 100%;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.editor-tools button:hover,
.editor-tools button[aria-pressed="true"] {
  background: var(--sage);
  color: var(--brand);
}
.editor-tools button:disabled,
.editor-tools select:disabled {
  opacity: 0.4;
  cursor: default;
}
.editor-color {
  position: relative;
  text-align: center;
  cursor: pointer;
  border-bottom: 3px solid var(--brand);
}
.editor-color.marker {
  background: #fff2a8;
  color: #262c30;
}
.editor-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.editor-color:focus-within {
  outline: 2px solid var(--brand);
}
.editor-sheet {
  background: var(--bg);
  padding: 20px;
}
.editor-content {
  max-width: 795px;
  margin: auto;
  background: #fff;
  box-shadow: 0 2px 12px #0000000a;
}
.editor-content .rich-document {
  min-height: 400px;
  padding: 36px;
  outline: none;
}
.rich-document {
  white-space: normal;
  font:
    11pt / 1.4 "Times New Roman",
    serif;
  color: #262c30;
  overflow-wrap: anywhere;
}
.document-body.rich-document {
  background: #fff;
  padding: 16px;
  border-radius: 6px;
}
.rich-document p {
  margin: 0 0 8pt;
  font-size: inherit;
  line-height: inherit;
}
.rich-document h1,
.rich-document h2,
.rich-document h3 {
  font-family: inherit;
  line-height: 1.4;
  margin: 12pt 0 8pt;
  font-weight: bold;
}
.rich-document h1 {
  font-size: 22pt;
}
.rich-document h2 {
  font-size: 17pt;
}
.rich-document h3 {
  font-size: 14pt;
}
.rich-document ul,
.rich-document ol {
  padding-left: 22px;
  margin: 8pt 0;
}
.rich-document blockquote {
  margin: 8pt 0;
  border-left: 3px solid #bbc5bf;
  padding-left: 18px;
  color: #52625a;
}
.rich-document hr {
  border: 0;
  border-top: 1px solid #bbc5bf;
  margin: 12pt 0;
}
.rich-document table {
  font: inherit;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 12px 0;
}
.rich-document td,
.rich-document th {
  border: 1px solid #bbc5bf;
  padding: 6px;
  vertical-align: top;
  position: relative;
  min-width: 0;
  color: inherit;
  text-align: left;
  font: inherit;
}
.rich-document th {
  background: #e8eeea;
}
.rich-document tr:last-child td {
  border-bottom: 1px solid #bbc5bf;
}
.rich-document .selectedCell {
  background: #d3e6da;
}
.editor-status {
  padding: 8px 14px;
  color: var(--muted);
  font-size: 11px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
@media (max-width: 740px) {
  .editor-sheet {
    padding: 8px;
  }
  .editor-content .rich-document {
    padding: 14px;
  }
  .editor-toolbar {
    padding: 7px;
  }
  .editor-tools {
    border-right: 0;
    padding: 0;
  }
}
.calendar-task small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}
@media (max-width: 1100px) {
  .document-templates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 740px) {
  .document-templates {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .template-card {
    padding: 16px;
  }
  .deadline-row {
    padding: 18px 16px;
    gap: 12px;
  }
  .deadline-row .actions {
    width: 100%;
  }
  .deadline-row .actions .btn {
    min-height: 40px;
  }
  .deadline-copy {
    flex-basis: 100%;
  }
}
@media (max-width: 950px) {
  .account-name {
    white-space: normal;
    width: 100px;
    overflow-wrap: anywhere;
  }
  .account {
    flex-shrink: 0;
    gap: 10px;
  }
}
@media (max-width: 740px) {
  .topbar {
    height: auto;
    min-height: 74px;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .account {
    margin-left: auto;
  }
  .account-name {
    width: auto;
    max-width: 170px;
  }
  .account-name small {
    display: none;
  }
  .search-box {
    order: 2;
    flex: 1 0 100%;
  }
}

.contact-photo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.contact-photo .field {
  flex: 1;
  min-width: 0;
}
.contact-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.nav-item[data-action="nav:configurator"] > span {
  hyphens: none;
  overflow-wrap: normal;
}

.template-field {
  border-radius: 3px;
  background: #e9f0eb;
  box-decoration-break: clone;
}
[data-theme="dark"] .template-field {
  background: #30463a;
}
#contract-fields {
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* The editor and preview share the same quiet contract typography. */
.document-paper {
  width: 100%;
  max-width: 795px;
  margin-inline: auto;
  padding: 44px 48px;
  background: #fff;
  color: #262c30;
  box-shadow: 0 5px 24px #00000008;
}
.document-paper .paper-top {
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--brand);
}
.document-paper > h2 {
  font-size: 26px;
  margin: 0 0 26px;
}
.document-body.rich-document {
  padding: 0;
  border-radius: 0;
}
.rich-document h1,
.rich-document h2,
.rich-document h3 {
  font-family: Arial, sans-serif;
  margin-top: 12pt;
  margin-bottom: 8pt;
}
.rich-document h3 {
  font-size: 12pt;
}
.rich-document td,
.rich-document th {
  border: 0;
  width: auto;
  border-bottom: 1px solid #cbd2cf;
  padding: 7px 8px;
  font-size: 10.5pt;
}
.rich-document td p:last-child,
.rich-document th p:last-child {
  margin-bottom: 0;
}
.document-annexes {
  margin-top: 24px;
}
.document-annex-index {
  border-top: 1px solid #cbd2cf;
  margin-top: 28px;
  padding-top: 20px;
  font:
    11pt/1.5 "Times New Roman",
    serif;
}
.document-annex-index h3 {
  font:
    bold 12pt Arial,
    sans-serif;
}
.template-refresh {
  margin-bottom: 16px;
}
.template-refresh summary {
  cursor: pointer;
  color: var(--muted);
}
.template-refresh p {
  margin: 12px 0;
}
@media (max-width: 600px) {
  .document-paper {
    padding: 22px 16px;
  }
  .document-annexes .panel-head {
    flex-wrap: wrap;
  }
  .document-annexes .actions {
    flex-wrap: wrap;
  }
}
