@font-face {
  font-family: Vazir;
  src: url("fonts/Vazir-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vazir;
  src: url("fonts/Vazir-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  font-family: Vazir, Tahoma, "Segoe UI", sans-serif;
  color: #172f43;
  background: #edf3f7;
  line-height: 1.65;
  --ink: #172f43;
  --muted: #526979;
  --accent: #006a70;
  --line: #d3e2e8;
  --navy: #102a3d;
  --paper: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #006067; }
a:hover { color: #124565; }
:focus-visible { outline: 3px solid #148c9e; outline-offset: 3px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.1rem;
  min-height: 4.1rem;
  padding: .65rem clamp(1rem, 3vw, 2.4rem);
  background: var(--navy);
  color: #f0fbff;
  box-shadow: 0 2px 6px #0e273b26;
}
.topbar a { color: inherit; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: bold; text-decoration: none; }
.workspace-context { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.context-chip {
  padding: .25rem .6rem;
  border: 1px solid #587482;
  border-radius: .45rem;
  background: #18384c;
  text-decoration: none;
  font-size: .79rem;
  white-space: nowrap;
}
a.context-chip:hover, .profile summary:hover { background: #245366; }
.profile { margin-inline-start: auto; position: relative; }
.profile summary { cursor: pointer; border-radius: .45rem; background: #204559; padding: .3rem .7rem; }
.profile div {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + .4rem);
  z-index: 1;
  min-width: 13rem;
  padding: .75rem;
  border-radius: .55rem;
  background: #17364b;
  display: grid;
  gap: .5rem;
}
.workspace { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); min-height: calc(100vh - 4.1rem); }
.workspace-home {
  background:
    linear-gradient(132deg, #083643ed 3%, #104960ec 53%, #123149e9 94%),
    repeating-linear-gradient(45deg, #63a1ad 0 1px, transparent 1px 5rem),
    #13485a;
}
.workspace-sidebar { padding: 1.2rem .85rem; background: #f5fafb; border-inline-end: 1px solid var(--line); }
.workspace-home .workspace-sidebar { background: #eef7f7; }
.workspace-nav h2 { font-size: .83rem; color: var(--muted); margin: 1rem .58rem .35rem; }
.workspace-nav a, .nav-section summary { display: block; padding: .46rem .58rem; border-radius: .45rem; color: #254254; text-decoration: none; }
.workspace-nav a:hover, .workspace-nav a[aria-current] { background: #d6efeb; color: #075850; }
.workspace-nav a[aria-current] { font-weight: 700; }
.workspace-nav .nav-home { font-weight: 700; margin-bottom: .6rem; }
.nav-section { border-bottom: 1px solid #dfeaed; }
.nav-section summary { cursor: pointer; font-weight: 700; font-size: .84rem; }
.nav-section div { padding: 0 .45rem .25rem; }
.nav-section a, #workspace-favorites a, #workspace-recent a, #workspace-matches a { font-size: .83rem; }
.nav-icon { display: inline-block; margin-inline-end: .45rem; text-align: center; width: 1.22rem; border-radius: .22rem; }
main { margin: 2rem auto; max-width: 65rem; padding: 0 1.25rem; }
.workspace main { width: 100%; max-width: 92rem; padding-inline: clamp(1rem, 3vw, 2.5rem); margin-block: 1.2rem 2rem; min-width: 0; }
h1 { margin: 0 0 1rem; font-size: clamp(1.35rem, 2.5vw, 1.95rem); line-height: 1.5; }
h2 { font-size: 1.06rem; }
.workspace-home h1 { color: #f6ffff; }
.shortcut-section { margin: 0 0 1.5rem; }
.shortcut-section h2 {
  margin: 0 0 .65rem;
  padding: .35rem .7rem;
  border-inline-start: 3px solid #74d8c7;
  border-radius: .35rem;
  color: #e7fbfa;
  background: #0a233d91;
}
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr)); gap: .7rem; }
.shortcut {
  position: relative;
  min-width: 0;
  border-radius: .65rem;
  background: #f0fafb;
  box-shadow: 0 2px 5px #071e2b50;
}
.shortcut a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .58rem;
  min-height: 6.7rem;
  padding: .65rem .45rem;
  border-radius: inherit;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  font-size: .83rem;
}
.shortcut a:hover { background: #fff; box-shadow: inset 0 0 0 2px #76cfc2; }
.shortcut-icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: .6rem;
  font-size: 1.4rem;
  line-height: 1;
}
.tone-blue { color: #186389; background: #dbeefa; }
.tone-green { color: #006552; background: #d6f1e7; }
.tone-violet { color: #614499; background: #eee3fb; }
.tone-amber { color: #815113; background: #ffefd5; }
.pin-page {
  position: absolute;
  inset-inline-end: .25rem;
  inset-block-start: .2rem;
  padding: .1rem .35rem;
  background: transparent;
  color: #526c7e;
  font-size: 1rem;
}
.pin-page[aria-pressed="true"] { color: #85530a; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: 1.15rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  box-shadow: 0 2px 6px #173a520b;
}
.panel[id] { scroll-margin-top: 5rem; }
.panel > h2:first-child { margin-top: 0; }
.narrow { max-width: 36rem; margin-inline: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.card-link { display: block; font-weight: 700; }
label { display: block; margin-bottom: .35rem; }
input, select, button, textarea { font: inherit; }
input, select, textarea {
  max-width: 100%;
  width: 100%;
  padding: .48rem .6rem;
  border: 1px solid #9bb9c3;
  border-radius: .4rem;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 8rem; }
select[multiple] { min-height: 13rem; }
input[type=checkbox] { width: auto; }
button, .button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: .4rem;
  padding: .45rem .8rem;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { color: #fff; background: #005459; }
button:disabled { opacity: .55; cursor: default; }
.secondary, .secondary:hover { background: #d8efed; color: #065854; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1rem; }
.inline { display: inline-block; margin: .25rem; }
.errorlist, [role=alert] { color: #9c2a26; }
.event-field { overflow-wrap: anywhere; }
table { border-collapse: collapse; width: 100%; margin-bottom: .55rem; }
th, td { padding: .53rem .65rem; border-bottom: 1px solid var(--line); text-align: start; overflow-wrap: anywhere; }
thead { background: #e6f0f3; color: #254658; }
tbody tr:nth-child(even) { background: #f9fcfd; }
tfoot { background: #e8f4f1; }
.notice { padding: .75rem; background: #e7f5f2; border-radius: .5rem; }
.notice.error { background: #fcebec; }
.skip { position: absolute; transform: translateY(-160%); background: white; padding: .5rem; z-index: 5; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.report-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-bottom: 1rem; }
.report-filter label { margin: 0; }
.report-filter select, .report-filter input { width: auto; }
#id_permissions { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
#id_permissions > div { background: #eef7f7; padding: .6rem; border-radius: .5rem; }
#id_permissions label { font-size: .86rem; }
@media (max-width: 740px) {
  .topbar { position: relative; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace-sidebar { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .workspace-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .5rem; }
  .workspace-nav input, .workspace-nav > h2, #workspace-matches { grid-column: 1 / -1; }
  .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel[id] { scroll-margin-top: 1rem; }
}

.workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.workbench-header h1, .workbench-header h2 { margin: 0; }
.chart-layout { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr); gap: 1rem; }
.chart-sidebar {
  background: #edf5f6;
  border-radius: .65rem;
  padding: .8rem;
  min-width: 0;
}
.chart-sidebar h3 { font-size: .96rem; margin: 1rem 0 .45rem; }
.chart-search > div { display: flex; gap: .35rem; }
.chart-search input { min-width: 0; margin: 0; }
.chart-results { max-height: 10rem; overflow: auto; margin: 0; padding-inline-start: 1rem; }
.account-tree, .account-tree ul { list-style: none; padding: 0; margin: 0; }
.account-tree { max-height: 34rem; overflow: auto; }
.account-tree ul { border-inline-start: 1px solid #afc8cf; margin: .2rem .55rem .3rem 0; padding-inline-start: .55rem; }
.account-tree details > summary {
  display: flex;
  align-items: baseline;
  color: #29546a;
  list-style: none;
  cursor: pointer;
}
.account-tree details > summary::-webkit-details-marker { display: none; }
.account-tree summary::before { content: "+"; flex: 0 0 1.3rem; text-align: center; }
.account-tree details[open] > summary::before { content: "−"; }
.tree-link { display: inline-flex; }
.tree-link {
  display: inline-flex;
  align-items: baseline;
  padding: .26rem .4rem;
  border-radius: .35rem;
  gap: .4rem;
  max-width: calc(100% - 1.35rem);
  text-decoration: none;
  color: #193d4a;
  overflow-wrap: anywhere;
}
.tree-link:hover, .tree-link[aria-current="true"] { background: #cce6e9; }
.tree-code { font-size: .8rem; font-variant-numeric: tabular-nums; color: #33606d; }
.level-1 { font-weight: 700; }
.chart-detail { padding: .2rem .4rem; min-width: 0; }
.chart-detail h3 { margin-top: 0; }
.workbench-form { max-width: none; }
.workbench-fields, .workbench-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}
.workbench-wide { grid-column: 1 / -1; }
.workbench-check { align-self: end; display: flex; align-items: center; gap: .55rem; }
.workbench-check label { margin: 0; }
.workbench-facts > div, .readout { background: #f0f6f7; border-radius: .4rem; padding: .55rem .7rem; }
.workbench-facts dt, .field-label { color: #335868; font-size: .85rem; }
.workbench-facts dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
.readout { margin: .25rem 0; }
.payment-entry {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .55rem;
  overflow: hidden;
}
.payment-title { padding: .65rem 1rem; background: #193e4d; color: #fff; }
.payment-title h1 { margin: 0; font-size: 1.18rem; color: inherit; }
.payment-toolbar:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .45rem .7rem;
  background: #e8f1f3;
  border-block-end: 1px solid var(--line);
}
.payment-toolbar .button, .payment-toolbar button { font-size: .85rem; padding: .3rem .6rem; }
.payment-info-heading {
  font-size: .94rem;
  margin: .55rem .65rem;
  padding: .32rem .55rem;
  border-inline-start: .2rem solid #007675;
  color: #164a53;
}
.payment-box {
  min-width: 0;
  margin: .65rem;
  padding: .42rem .65rem;
  background: #f4f7f8;
  border: 1px solid var(--line);
  border-radius: .25rem;
}
.payment-box legend { font-size: .85rem; color: #335868; padding-inline: .35rem; }
.payment-header-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .2rem 1rem; }
.payment-field {
  display: grid;
  grid-template-columns: minmax(5.2rem, max-content) minmax(0, 1fr);
  align-items: center;
  gap: .32rem .55rem;
  margin-block: .32rem;
}
.payment-field label { margin: 0; font-size: .85rem; }
.payment-field input, .payment-field select, .payment-field textarea { margin: 0; padding: .34rem .45rem; }
.payment-field input[readonly] { background: #e9f0f2; }
.payment-field .errorlist { grid-column: 2; margin: 0; }
.payment-instruments { margin: .72rem .65rem; min-width: 0; }
.instrument-tabs:not([hidden]) { display: flex; gap: .28rem; }
.instrument-tabs button {
  background: #eaf0f2;
  color: #254658;
  border: 1px solid var(--line);
  border-radius: .35rem .35rem 0 0;
  padding: .4rem .72rem;
}
.instrument-tabs [aria-pressed="true"] { background: #f5fbfb; border-block-start: 2px solid #007675; }
.instrument-grid { height: clamp(12rem, 27vh, 23rem); overflow: auto; border: 1px solid var(--line); }
.instrument-table { width: max-content; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.instrument-table th, .instrument-table td { min-width: 9.5rem; border-inline-end: 1px solid var(--line); }
.instrument-table th { position: sticky; inset-block-start: 0; background: #e9f3f4; font-size: .85rem; white-space: nowrap; z-index: 1; }
.instrument-table .instrument-marker { min-width: 2.3rem; padding-inline: .4rem; text-align: center; }
.instrument-table .instrument-cell { background: #f4faf9; padding: .28rem; vertical-align: top; }
.instrument-cell[data-field="party"], .instrument-cell[data-field$="_account"] { min-width: 12.5rem; }
.instrument-cell input, .instrument-cell select { margin: 0; padding: .28rem .4rem; }
.instrument-cell .errorlist { margin: .3rem 0 0; font-size: .8rem; }
.instrument-table-active label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.payment-toolbar.instrument-actions { border: 1px solid var(--line); border-block-start: 0; }
.payment-footer .payment-field { max-width: 19rem; }
@media (max-width: 1100px) {
  .payment-header-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.workbench-scroll { overflow: auto; }
@media (max-width: 960px) {
  .chart-layout { grid-template-columns: minmax(0, 1fr); }
  .account-tree { max-height: 17rem; }
}

.ledger-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: 1rem;
  border-block-end: 1px solid var(--line);
}
.ledger-tabs a {
  text-decoration: none;
  padding: .5rem .85rem;
  color: #254658;
}
.ledger-tabs a[aria-current="page"] {
  border-block-end: 2px solid #007675;
  color: #164a53;
  font-weight: 700;
}

.company-switch { position: relative; }
.company-switch summary { cursor: pointer; }
.company-switch[open] summary, .company-switch summary:hover { background: #245366; }
.company-switch nav {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + .35rem);
  z-index: 3;
  min-width: max(100%, 12rem);
  padding: .35rem;
  background: #17364b;
  border: 1px solid #587482;
  border-radius: .45rem;
  box-shadow: 0 8px 20px #0003;
}
.company-switch nav a { display: block; padding: .4rem .65rem; border-radius: .25rem; text-decoration: none; }
.company-switch nav a:hover, .company-switch nav [aria-current] { background: #245366; }
.dashboard-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .95rem; }
.dashboard-title h1 { margin: 0; }
.workspace-controls:not([hidden]) { display: flex; gap: .4rem; }
.workspace-editor-group {
  border: 1px dashed #85acb8;
  border-radius: .5rem;
  padding: .65rem;
  background: #eaf5f5;
}
.workspace-editor-group.drop-target { outline: 3px solid #72daca; }
.workspace-editor-fields { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .65rem; }
.workspace-editor-fields input, .workspace-editor-fields select { width: auto; max-width: 100%; margin: 0; flex: 1 1 9rem; }
.workspace-editor-fields button, .workspace-editor-row button { font-size: .83rem; }
.workspace-editor-group .shortcut { min-width: 0; }
.workspace-editor-row { padding: .45rem; }
.workspace-editor-row label { font-size: .77rem; }
.workspace-editor-row input { margin: 0 0 .4rem; }
.workspace-editor-group .shortcut[draggable], .workspace[data-editing] .workspace-nav a[draggable] { cursor: grab; }
.workspace-editor-group .shortcut:active, .workspace[data-editing] .workspace-nav a[draggable]:active { cursor: grabbing; }
.period-switch nav { min-width: max(100%, 16rem); max-height: 65vh; overflow-y: auto; }
.period-switch nav form { margin: 0; }
.period-switch nav button {
  display: block;
  width: 100%;
  text-align: start;
  background: transparent;
  color: inherit;
  border: 0;
  padding: .35rem .65rem;
}
.period-switch nav button:hover, .period-switch nav button[aria-current] { background: #245366; }
.period-switch nav small { display: block; color: #d7edee; }

.journal-entry {
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
  overflow: hidden;
}
.journal-title { padding: .65rem 1rem; background: #193e4d; color: #fff; }
.journal-title h1 { margin: 0; color: inherit; font-size: 1.18rem; }
.journal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .45rem .7rem;
  background: #e8f1f3;
}
.journal-toolbar button, .journal-toolbar a { font-size: .86rem; padding: .3rem .6rem; }
.journal-box { margin: .65rem; min-width: 0; padding: .65rem; border: 1px solid var(--line); background: #f4f7f8; }
.journal-box .workbench-fields { gap: .25rem .7rem; margin-block-end: .25rem; }
.journal-box .journal-description { grid-column: span 2; }
.journal-box input { margin-block-end: .2rem; }
.journal-box input[readonly] { background: #e9f0f2; }
.journal-grid { margin: .65rem; border: 1px solid var(--line); }
.journal-scroll { min-height: clamp(13rem, 35vh, 23rem); max-height: 55vh; overflow: auto; }
.journal-scroll table { width: max-content; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.journal-scroll thead th { position: sticky; inset-block-start: 0; background: #e9f3f4; white-space: nowrap; z-index: 1; }
.journal-scroll thead th, .journal-scroll td { border-inline-end: 1px solid var(--line); }
.journal-cell { padding: .3rem; min-width: 7.5rem; vertical-align: top; }
.journal-account, .journal-party, .journal-description { min-width: 12rem; }
.journal-cell input, .journal-cell select { margin: 0; }
.journal-remove { min-width: max-content; text-align: center; }
.journal-remove button { font-size: 1rem; padding: .2rem .52rem; }
.journal-actions { border-block-start: 1px solid var(--line); }
.journal-summary:not([hidden]) { display: flex; flex-wrap: wrap; gap: .55rem; margin: .65rem; }
.journal-summary output { display: block; font-weight: 700; }
.journal-summary .journal-unbalanced { color: #8c3328; background: #fceae7; }
@media (max-width: 700px) {
  .journal-box .journal-description { grid-column: 1 / -1; min-width: 0; }
}

.choice-results {
  position: fixed;
  z-index: 20;
  max-height: 14rem;
  overflow: auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid #9bb9c3;
  border-radius: .4rem;
  box-shadow: 0 6px 20px #173a4d25;
}
.choice-results [role="option"], .choice-results p { padding: .35rem .65rem; margin: 0; }
.choice-results [role="option"] { cursor: pointer; }
.choice-results [aria-selected="true"], .choice-results [role="option"]:hover { background: #d7edec; }
.journal-row-selected td, .journal-row-selected th { background: #e9f4f3; }
.journal-cell input:disabled { background: #e8edef; color: #74838e; }
.journal-row-info {
  flex: 1 1 22rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .45rem;
  margin: 0;
}
.journal-row-info > div { background: #eef5f7; border-radius: .33rem; padding: .35rem .55rem; }
.journal-row-info dt { font-size: .83rem; color: var(--muted); }
.journal-row-info dd { margin: 0; overflow-wrap: anywhere; }
.journal-totals { flex: 0 1 18rem; width: auto; margin: 0; align-self: flex-start; }
.journal-totals td { text-align: center; }

.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-block: .4rem; }
.table-tools > input { width: auto; min-width: 10rem; margin: 0; }
.table-tools > details { position: relative; }
.table-tools summary { cursor: pointer; color: #155761; padding: .3rem .55rem; border: 1px solid var(--line); border-radius: .35rem; background: #e9f4f3; }
.table-tool-fields { position: absolute; z-index: 4; width: min(17rem, 76vw); max-height: 48vh; overflow: auto; padding: .7rem; background: white; border: 1px solid var(--line); border-radius: .35rem; box-shadow: 0 6px 18px #20465425; }
.table-tool-fields label { display: block; margin-block: .25rem; }
.table-tool-fields input { margin: 0 .2rem; }
.table-tools button { font-size: .83rem; }
.table-filtered-row, .table-hidden-column { display: none !important; }
.listing-table { min-width: max-content; }
.listing-table th { white-space: nowrap; }
.grid-print-frame { position: fixed; width: 1px; height: 1px; inset: auto 0 0 auto; border: 0; pointer-events: none; }
.instrument-table .choice-input { min-width: 11rem; }
.payment-totals:not([hidden]) { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: .35rem; }
.payment-totals div { padding: .35rem .65rem; background: #e8f1f3; border-radius: .3rem; }
.payment-totals dd { margin: 0; font-weight: 700; }

.treasury-entry h2 { font-size: 1rem; margin-block: 1.2rem .55rem; }
.treasury-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .75rem 1rem; margin-block: .85rem; }
.treasury-fields > div { min-width: 0; margin: 0; }
.treasury-fields label { display: block; font-size: .88rem; font-weight: 700; margin-block-end: .25rem; }
.treasury-fields input:not([type=checkbox]), .treasury-fields select, .treasury-fields textarea { width: 100%; }
.treasury-fields .treasury-wide { grid-column: 1 / -1; }
.treasury-fields dt { font-size: .85rem; color: #435967; }
.treasury-fields dd { margin: .2rem 0 0; }
.treasury-grid { min-height: 15rem; }
.treasury-grid td { vertical-align: top; }
.treasury-grid td input { min-width: 9rem; }
.treasury-grid td:has(select) { min-width: 14rem; }
.treasury-grid td output { display: inline-block; min-width: 8rem; }
.treasury-grid td input[type=checkbox] { display: none; }
.treasury-grid small { display: block; color: #435967; }
.treasury-toolbar { padding-block: .5rem; border-block-end: 1px solid #d5e0e6; }
.treasury-toolbar output { margin-inline-start: auto; font-weight: 700; }
.treasury-line-info { margin-block: 1rem 0; }
.access-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
.access-tabs a { background: #e8f1f5; color: #153b4d; text-decoration: none; border: 1px solid #d0e0e9; padding: .55rem .85rem; border-radius: .55rem; }
.access-tabs a[aria-current] { background: #143e52; color: white; border-color: #143e52; }
.access-panel h2 { margin: 0; font-size: 1.18rem; }
.access-permissions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .8rem; margin-block: 1rem; }
.access-permissions fieldset { border: 1px solid #d0e0e9; border-radius: .55rem; padding: .6rem .8rem; min-width: 0; }
.access-permissions legend { font-weight: 700; }
.access-permissions label { display: flex; gap: .35rem; padding-block: .2rem; }
.access-company { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; border: 1px solid #d0e0e9; border-radius: .6rem; padding: .85rem; }
.access-company h3 { margin: 0; }
.access-company a { margin-inline-start: auto; }
.company-logo { display: inline-grid; place-items: center; width: 3rem; height: 3rem; object-fit: contain; border-radius: .45rem; background: #fff; vertical-align: middle; }
.logo-placeholder { background: #e5f1f3; color: #143e52; font-weight: 700; }
.company-logo.top-logo { width: 1.8rem; height: 1.8rem; margin-inline-end: .35rem; }
.access-revoke summary { cursor: pointer; color: #883b32; }

.floating-menu { position: fixed; inset: auto; margin: 0; z-index: 100; overflow: auto; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: .55rem; padding: .7rem; box-shadow: 0 8px 28px #173a4d35; }
.floating-menu[hidden] { display: none; }
.table-tool-trigger { color: #155761; border: 1px solid var(--line); background: #e9f4f3; }
.table-tool-trigger::after { content: " ▾"; }
.table-tool-trigger[aria-expanded=true]::after { content: " ▴"; }
.floating-menu.table-tool-fields { position: fixed; z-index: 100; width: min(17rem, calc(100vw - 1rem)); }

.solar-date-field { position: relative; display: inline-flex; min-width: 0; align-items: center; }
.solar-date-field input { width: 100%; padding-right: 2.25rem; }
.solar-date-field .solar-calendar-toggle { position: absolute; inset: 50% .22rem auto auto; transform: translateY(-50%); display: grid; place-items: center; background: #e8f4f3; border: 0; border-radius: .3rem; padding: .24rem; width: 1.65rem; height: 1.65rem; color: #155761; }
.solar-calendar-toggle svg { width: 1.15rem; height: 1.15rem; }
.workbench-fields .solar-date-field, .treasury-fields .solar-date-field, .payment-field .solar-date-field { width: 100%; }
.solar-calendar { width: min(19rem, calc(100vw - 1rem)); }
.solar-calendar-nav { display: grid; grid-template-columns: auto 1fr 4rem auto; align-items: center; gap: .3rem; }
.solar-calendar button { margin: 0; padding: .27rem .4rem; border-radius: .3rem; }
.solar-calendar-nav input, .solar-calendar-nav select { min-width: 0; width: 100%; margin: 0; padding: .35rem; text-align: center; }
.solar-calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .2rem; margin-block: .6rem; text-align: center; }
.solar-calendar-days button { color: var(--ink); background: #eef5f7; }
.solar-calendar-days button:hover, .solar-calendar-days button[aria-pressed=true] { color: white; background: #155761; }
.solar-calendar-days button[aria-current=date] { outline: 1px solid #155761; }
.solar-calendar-footer { display: flex; justify-content: space-between; gap: .5rem; }
.menu-icon { display: block; width: 1.15rem; height: 1.15rem; }
.shortcut-icon .menu-icon { width: 1.8rem; height: 1.8rem; }
.nav-home .menu-icon { display: inline-block; vertical-align: middle; }

.mobile-menu-toggle { display: none; }
.pwa-install { background: #d7efed; color: #075854; white-space: nowrap; }
.pwa-install-help {
  width: min(28rem, calc(100% - 1.5rem));
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: 1rem;
  color: var(--ink);
  background: var(--paper);
}
.pwa-install-help::backdrop, .mobile-menu::backdrop { background: #0c253bb8; }
.pwa-install-help form { float: inline-end; }
.pwa-install-help h2 { margin: .25rem 0 0; }
.pwa-install-help button { min-width: 2.75rem; min-height: 2.75rem; }
.mobile-table-hint { color: var(--muted); font-size: .79rem; margin: .3rem 0; }

@media (max-width: 740px) {
  body { padding-block-end: env(safe-area-inset-bottom); }
  body:has(.mobile-menu[open]) { overflow: hidden; }
  .topbar {
    display: flex;
    gap: .35rem .45rem;
    padding: calc(.5rem + env(safe-area-inset-top)) max(.65rem, env(safe-area-inset-right)) .5rem max(.65rem, env(safe-area-inset-left));
  }
  .brand { flex: 1 1 7rem; min-width: 0; overflow-wrap: anywhere; font-size: .95rem; }
  .profile { margin-inline-start: 0; min-width: 0; max-width: 9rem; }
  .profile summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .profile div { width: min(16rem, 80vw); min-width: 0; }
  .topbar .profile summary, .mobile-menu-ready .mobile-menu-toggle, .topbar .pwa-install {
    min-height: 2.75rem;
    padding: .5rem .55rem;
    line-height: 1.6;
  }
  .topbar .profile summary { padding-top: .6rem; }
  .mobile-menu-ready .mobile-menu-toggle { display: inline-flex; align-items: center; gap: .25rem; background: #204559; }
  .mobile-menu-toggle svg { width: 1.1rem; height: 1.1rem; }
  .workspace-context { order: 5; flex: 1 0 100%; position: relative; gap: .35rem; min-width: 0; }
  .workspace-context .company-switch { position: static; min-width: 0; flex: 1 1 0; }
  .workspace-context .company-switch:only-of-type { flex: 0 1 auto; max-width: 100%; }
  .workspace-context .company-switch summary { overflow: hidden; text-overflow: ellipsis; padding-block: .55rem; min-height: 2.55rem; }
  .workspace-context .company-switch nav { width: 100%; min-width: 0; max-height: 60vh; overflow-y: auto; }
  .workspace-context .company-switch nav a, .workspace-context .company-switch nav button { min-height: 2.75rem; overflow-wrap: anywhere; }
  .workspace-context .today { display: none; }
  .mobile-menu-ready .workspace > .workspace-sidebar { display: none; }
  .mobile-menu {
    position: fixed;
    inset: 0 0 0 auto;
    margin: 0;
    width: min(20rem, 87vw);
    max-width: none;
    height: 100%;
    max-height: none;
    box-sizing: border-box;
    overflow: auto;
    overscroll-behavior: contain;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) 0;
    border: 0;
    color: var(--ink);
    background: #f5fafb;
  }
  .mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding: .65rem .85rem; border-bottom: 1px solid var(--line); }
  .mobile-menu-header button { min-width: 2.75rem; min-height: 2.75rem; font-size: 1.1rem; }
  .mobile-menu .workspace-sidebar { padding: .55rem .65rem 1rem; border: 0; }
  .mobile-menu .workspace-nav { display: block; }
  .mobile-menu .workspace-nav a, .mobile-menu .nav-section summary { min-height: 2.75rem; padding-block: .6rem; }
  .workspace main, .standalone main { padding-inline: max(.65rem, env(safe-area-inset-right)) max(.65rem, env(safe-area-inset-left)); margin-block: .85rem 1.4rem; }
  .panel { padding: .75rem; }
  main fieldset { min-inline-size: 0; }
  #content h1 { font-size: 1.25rem; overflow-wrap: anywhere; }
  .workbench-header, .dashboard-title { row-gap: .55rem; }
  .workbench-header .button, .workspace-controls button, .actions button { min-height: 2.75rem; }
  main input:not([type=hidden], [type=checkbox], [type=radio]), main select, main textarea,
  .workspace-nav input, .floating-menu input:not([type=checkbox]), .floating-menu select { font-size: 16px; }
  main input:not([type=hidden], [type=checkbox], [type=radio]), main select { min-height: 2.65rem; }
  .table-tools { gap: .35rem; }
  .table-tools > input { flex: 1 0 100%; }
  .table-tools button { min-height: 2.5rem; padding-inline: .55rem; }
  .workbench-scroll, .journal-scroll, .instrument-grid, .table-wrap { position: relative; max-width: 100%; overscroll-behavior-inline: contain; }
  .workbench-scroll th, .workbench-scroll td { min-width: 5.2rem; }
  .workbench-scroll th { white-space: nowrap; }
  .shortcut-grid { gap: .5rem; }
  .shortcut a { min-height: 5.4rem; overflow-wrap: anywhere; }
  .shortcut .pin-page { min-width: 2.65rem; min-height: 2.65rem; inset-block-start: 0; }
  .workspace-controls:not([hidden]), .ledger-tabs, .access-tabs { flex-wrap: wrap; }
  .workspace-editor-fields select, .workspace-editor-fields input { flex-basis: 100%; }
  .journal-totals { flex: 1 1 100%; width: 100%; }
  .solar-calendar-days button { min-height: 2rem; }
  .solar-date-field .solar-calendar-toggle { width: 2.4rem; height: 2.4rem; }
  .solar-date-field input { padding-right: 2.75rem; }
}

@media (min-width: 741px) {
  .mobile-table-hint { display: none; }
}

:root {
  --brand: #006a70;
  --brand-ink: #fff;
  --company-header: #102a3d;
  --header-ink: #fff;
  --foreground: #172f43;
  --background: #eaf1f5;
  --card: #fff;
  --motion: 160ms;
  --press: scale(.96);
  --glass-tint: color-mix(in srgb, var(--brand) 13%, white);
}
.company-themed {
  --accent: var(--brand);
  --navy: var(--company-header);
  isolation: isolate;
  background: var(--background);
}
.company-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 87% 10%, var(--glass-tint), transparent 58%),
    radial-gradient(ellipse at 10% 75%, #f5faff, transparent 56%), var(--background);
}
.appearance-effect { pointer-events: none; overflow: hidden; }
.company-themed .workspace-home { background: none; }
.company-themed .topbar {
  background: color-mix(in srgb, var(--company-header) 96%, transparent);
  color: var(--header-ink);
  backdrop-filter: blur(16px);
}
.company-themed .context-chip, .company-themed .profile summary, .company-themed .mobile-menu-toggle {
  background: color-mix(in srgb, var(--header-ink) 12%, var(--company-header));
  color: var(--header-ink);
  border-color: color-mix(in srgb, var(--header-ink) 24%, var(--company-header));
}
.company-themed .company-switch nav, .company-themed .profile div {
  background: var(--company-header);
  color: var(--header-ink);
}
.company-themed .company-switch nav button { color: inherit; }
.company-themed .company-switch nav :is(a,button):hover,
.company-themed .company-switch nav [aria-current] {
  background: color-mix(in srgb, var(--header-ink) 12%, var(--company-header));
}
.company-themed .workspace-sidebar,
.company-themed .panel, .company-themed .shortcut {
  border-color: #ffffffcf;
  background: #ffffffc9;
  box-shadow: 0 6px 26px #162b4412;
  backdrop-filter: blur(12px);
}
.company-themed .workspace-home h1 { color: var(--ink); }
.company-themed .shortcut-section h2 {
  background: color-mix(in srgb, var(--header-ink) 8%, var(--company-header));
  border-inline-start-color: var(--brand);
  color: var(--header-ink);
}
.company-themed .workspace-nav a[aria-current], .company-themed .workspace-nav a:hover,
.company-themed .table-icon-button[aria-expanded=true] { background: var(--glass-tint); color: var(--ink); }
.company-themed a, .company-themed .ledger-tabs a { color: color-mix(in srgb, var(--brand) 62%, #101f36); }
.company-themed .topbar a, .company-themed .topbar a:hover { color: inherit; }
.company-themed :is(button,.button):not(.secondary,.quiet,.table-icon-button,.pin-page,.solar-calendar-toggle,.pwa-install,.mobile-menu-toggle,.desktop-sidebar-toggle) {
  color: var(--brand-ink);
}
.company-themed .solar-calendar-days button[aria-pressed=false]:not(:hover) { color: var(--ink); background: #e8f0f3; }
.company-themed .solar-calendar-days button:is(:hover, [aria-pressed=true]) { color: #fff; background: #155761; }
.company-themed .button:hover { background: color-mix(in srgb, var(--brand) 86%, var(--brand-ink)); }
.company-themed .floating-menu, .company-themed .choice-results {
  background: #f9fcffed;
  border-color: #ffffffeb;
  backdrop-filter: blur(18px);
}
.table-icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; width: 2.65rem; height: 2.65rem; border: 1px solid var(--line); background: #f4fbfc; color: var(--ink); }
.table-icon-button svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.table-icon-button[aria-controls]:hover, .table-icon-button[aria-expanded=true] { background: var(--glass-tint); color: var(--ink); }
.table-tool-fields input:not([type=checkbox]) { margin-inline: 0; }
.report-filter .solar-date-field { max-width: 10.5rem; }
.company-appearance { min-width: 0; border: 1px solid var(--line); border-radius: .7rem; margin-block: 0 1.1rem; padding: .8rem; }
.company-appearance legend { font-weight: 700; }
.company-appearance input[type=color] { display: block; min-height: 2.75rem; cursor: pointer; }
.appearance-preview { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--line); border-radius: .7rem; background: var(--background); }
.appearance-preview .appearance-effect { position: absolute; inset: 0; z-index: -1; }
.appearance-preview-bar { padding: .65rem .85rem; background: var(--company-header); color: var(--header-ink); font-weight: 700; }
.appearance-preview-content { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem; min-height: 8rem; }
.appearance-preview-card { flex: 1; background: #ffffffbb; backdrop-filter: blur(10px); padding: 1rem; border-radius: .5rem; }
.appearance-preview-action { background: var(--brand); color: var(--brand-ink); padding: .55rem .65rem; border-radius: .5rem; }
@media (prefers-reduced-motion: reduce) { .appearance-effect * { animation-play-state: paused !important; } }
@media (max-width: 740px) { .table-icon-button { width: 2.75rem; height: 2.75rem; } }

#workspace-favorites { margin-block: .65rem; padding: .25rem .25rem .5rem; border-block-end: 1px solid var(--line); }
#workspace-favorites h2 { margin-block-start: .35rem; }
#dashboard-favorites + #workspace-groups { min-width: 0; }
@media (max-width: 740px) { #workspace-favorites { grid-column: 1 / -1; } }

.topbar details a, .topbar details a:hover { text-decoration: none; }

.desktop-sidebar-toggle { display: none; }
@media (min-width: 741px) {
  .desktop-sidebar-toggle { display: inline-grid; place-items: center; padding: 0; width: 2.45rem; height: 2.45rem; background: transparent; border: 1px solid currentColor; }
  .topbar .desktop-sidebar-toggle { color: inherit; }
  .desktop-sidebar-toggle svg { width: 1.15rem; height: 1.15rem; }
  .desktop-sidebar-toggle[aria-expanded=false] svg { transform: scaleX(-1); }
  .workspace[data-sidebar-collapsed] { grid-template-columns: minmax(0, 1fr); }
  .workspace[data-sidebar-collapsed] > .workspace-sidebar { display: none; }
}
