/* Design tokens (1.3.0): the existing palette, named; secondary text meets WCAG AA (4.5:1) on every surface. */
:root {
  --ink: #173b37;
  --ink-muted: #637168;
  --brand: #174e45;
  --brand-dark: #113c38;
  --sand: #d9c28c;
  --canvas: #f4f5f0;
  --line: #e4e8e0;
  --focus: #1f6f61;
  /* System Arabic faces on every platform (Windows, macOS/iOS, Android, Linux); no web font download. */
  --font: 'Segoe UI', 'SF Arabic', 'Geeza Pro', 'Noto Sans Arabic', 'Noto Naskh Arabic', Tahoma, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
/* Figures line up in columns of amounts and dates. */
td,
th,
.amount,
.stat .value,
.badge-count {
  font-variant-numeric: tabular-nums;
}
/* Keyboard focus is always visible; a mouse click does not draw the ring. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.sidebar :focus-visible {
  outline-color: var(--sand);
}
.skip-link {
  position: absolute;
  top: -60px;
  right: 12px;
  z-index: 50;
  background: var(--brand-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}
.main:focus {
  outline: none;
}
/* Requests in flight: a thin bar at the top instead of a frozen screen. */
html.is-loading body::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  z-index: 60;
  background: linear-gradient(90deg, transparent, var(--sand), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: rj-loading 1.1s linear infinite;
}
html.is-loading .main {
  cursor: progress;
}
@keyframes rj-loading {
  from {
    background-position: -40% 0;
  }
  to {
    background-position: 140% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: #146559;
}
button.primary,
.primary {
  background: #174e45;
  color: white;
}
.secondary {
  background: #e8ede7;
  color: #235348;
}
.danger {
  background: #fbe5df;
  color: #913d31;
}
.gold {
  background: #d7bd83;
  color: #173b37;
}
.button {
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
}
.small {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.initial {
  padding: 30px;
}
.layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #113c38;
  color: #d9e6df;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 17px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: white;
  font-size: 23px;
  letter-spacing: 0.2px;
}
.brand-icon {
  width: 39px;
  height: 39px;
  background: #d9c28c;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #113c38;
  font-size: 25px;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  color: #adc6bd;
  margin-top: 4px;
  letter-spacing: 0;
}
.nav-caption {
  font-size: 10px;
  color: #97b9ae;
  letter-spacing: 1px;
  margin: 28px 13px 10px;
}
.nav {
  overflow: auto;
  flex: 1;
}
.nav button {
  background: transparent;
  color: #c6dbd2;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: right;
  padding: 9px 13px;
  margin: 1px 0;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.3;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}
.sidebar-close {
  display: none;
  background: #214e44;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
}
.sidebar-backdrop {
  display: none;
}
.nav {
  scrollbar-width: thin;
  scrollbar-color: #376056 transparent;
}
@media (max-height: 820px) and (min-width: 701px) {
  .nav button {
    padding: 7px 12px;
  }
  .sidebar {
    padding-top: 18px;
  }
  .sidebar-head {
    margin-bottom: 10px;
  }
}
.nav button.active {
  color: white;
  background: #2a584d;
}
.nav button:hover {
  background: #214e44;
}
.nav .icon {
  font-size: 18px;
  line-height: 1;
  width: 23px;
  text-align: center;
}
.sidebar-foot {
  font-size: 11px;
  color: #a5c2b7;
  border-top: 1px solid #376056;
  padding: 15px 9px 0;
  line-height: 1.9;
}
.content {
  min-width: 0;
}
.topbar {
  height: 83px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e4e8e0;
  padding: 0 35px;
  gap: 15px;
}
.top-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
.company-switch {
  border: 1px solid #dbe4dc;
  border-radius: 9px;
  background: #fafbf7;
  padding: 9px 11px;
  color: #255148;
  max-width: 300px;
}
.user-name {
  font-weight: 600;
  font-size: 12px;
}
.avatar {
  background: #e9efe4;
  color: #335b46;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.crumb {
  font-size: 11px;
  color: #64726a;
}
.demo-ribbon {
  padding: 8px 35px;
  background: #f5edda;
  color: #796331;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.demo-ribbon button {
  background: transparent;
  color: #665126;
  text-decoration: underline;
}
.main {
  padding: 29px 35px 40px;
  max-width: 1700px;
  margin: auto;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 10px;
  color: #5a7463;
  letter-spacing: 1px;
  font-weight: 700;
}
.page-head h1 {
  font-size: 26px;
  margin: 7px 0 8px;
  font-weight: 750;
}
.muted {
  color: #637168;
  font-size: 12px;
  line-height: 1.8;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 24px;
}
.stat {
  background: white;
  border: 1px solid #e4e9df;
  border-radius: 14px;
  padding: 20px;
  min-height: 137px;
  position: relative;
}
.stat .label {
  font-size: 12px;
  color: #647169;
}
.stat .value {
  font-size: 28px;
  font-weight: 750;
  margin-top: 15px;
  letter-spacing: -1px;
}
.stat .value small {
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 400;
  margin-right: 4px;
  color: #637266;
}
.stat .sub {
  font-size: 10px;
  color: #5e7364;
  margin-top: 10px;
}
.stat .stat-icon {
  position: absolute;
  left: 18px;
  top: 18px;
  background: #eef3e9;
  border-radius: 9px;
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  color: #42664d;
}
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}
.panel {
  background: #fff;
  border: 1px solid #e3e8df;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}
.panel-head {
  padding: 21px 23px;
  border-bottom: 1px solid #edf0e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head h2 {
  font-size: 15px;
  margin: 0 0 5px;
}
.panel-body {
  padding: 20px 23px;
}
.chart {
  height: 210px;
  width: 100%;
  display: block;
}
.chart text {
  fill: #8a978b;
  font: 11px Tahoma;
}
.chart line {
  stroke: #edf0e9;
  stroke-dasharray: 4;
}
.chart .bar {
  fill: #315f4c;
}
.chart .bar-muted {
  fill: #dce4d1;
}
.chart-legend {
  display: flex;
  gap: 18px;
  color: #62735f;
  font-size: 11px;
  padding-top: 8px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #315f4c;
  margin-left: 6px;
}
.dot.pale {
  background: #dce4d1;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #edf0e9;
  gap: 12px;
}
.list-row:last-child {
  border: 0;
}
.list-row strong {
  display: block;
  font-size: 12px;
}
.list-row small {
  font-size: 10px;
  color: #667164;
  display: block;
  margin-top: 5px;
}
.tag {
  display: inline-block;
  font-size: 10px;
  line-height: 1.4;
  padding: 5px 9px;
  border-radius: 7px;
  white-space: nowrap;
  background: #eef2e8;
  color: #54734d;
}
.tag.red {
  background: #f9e7e0;
  color: #995646;
}
.tag.amber {
  background: #f5edd9;
  color: #7b673a;
}
.tag.blue {
  background: #e6eff0;
  color: #3f7175;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
}
th {
  background: #fafbf7;
  color: #697564;
  font-size: 10px;
  font-weight: 500;
  padding: 13px 20px;
  border-bottom: 1px solid #e9ede3;
}
td {
  padding: 16px 20px;
  border-bottom: 1px solid #edf0e8;
  vertical-align: middle;
}
tbody tr:last-child td {
  border: 0;
}
tbody tr:hover {
  background: #fcfdf9;
}
.cell-sub {
  display: block;
  color: #657164;
  font-size: 10px;
  margin-top: 5px;
}
.amount {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
  font-weight: 650;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}
.search {
  background: white;
  border: 1px solid #dfe6da;
  padding: 11px 15px;
  border-radius: 10px;
  width: 300px;
  max-width: 100%;
}
.empty {
  padding: 44px;
  text-align: center;
  color: #647260;
  line-height: 2;
}
.notice {
  padding: 15px 18px;
  border-radius: 10px;
  background: #edf2e8;
  color: #577047;
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 20px;
}
.notice.amber {
  background: #f5eddc;
  color: #7c663d;
}
.notice.red {
  background: #fae8e3;
  color: #9d5144;
}
.occupancy {
  height: 7px;
  width: 90px;
  border: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #e9efdf;
}
progress::-webkit-progress-bar {
  background: #e9efdf;
}
progress::-webkit-progress-value {
  background: #66875c;
}
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f6f6ef;
}
.auth-art {
  background: #113c38;
  color: white;
  padding: 65px 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-art h1 {
  font-size: 43px;
  line-height: 1.55;
  margin: 55px 0 15px;
  max-width: 460px;
}
.auth-art p {
  color: #b8d0c3;
  line-height: 2;
  max-width: 400px;
  font-size: 15px;
}
.auth-art .building {
  font-size: 150px;
  color: #ddc791;
  line-height: 1.2;
  opacity: 0.85;
}
.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px;
}
.auth-card {
  width: 100%;
  max-width: 390px;
}
.auth-card h2 {
  font-size: 27px;
  margin: 7px 0 12px;
}
.auth-card .subtext {
  font-size: 13px;
  color: #627364;
  margin-bottom: 27px;
  line-height: 1.9;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #4c6859;
  margin-bottom: 17px;
}
input,
select,
textarea {
  border: 1px solid #dbe4d5;
  background: #fff;
  border-radius: 9px;
  padding: 11px 12px;
  min-width: 0;
  color: #244c3c;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #507558;
}
textarea {
  min-height: 85px;
  resize: vertical;
}
input[type='checkbox'] {
  accent-color: #245745;
  width: 16px;
  height: 16px;
}
.full {
  width: 100%;
}
.auth-card .demo-options {
  border-top: 1px solid #dce5d3;
  padding-top: 20px;
  margin-top: 25px;
}
.demo-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.demo-buttons button {
  padding: 10px;
  background: #e9eee1;
  border-radius: 8px;
  color: #44653f;
  font-size: 12px;
}
.demo-buttons .wide {
  grid-column: 1/-1;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 22px;
  max-width: 450px;
  background: #163f33;
  color: white;
  box-shadow: 0 8px 35px #0002;
  padding: 15px 22px;
  border-radius: 11px;
  z-index: 100;
  display: none;
  line-height: 1.8;
}
#toast.visible {
  display: block;
  cursor: pointer;
}
#toast.error {
  background: #8d493a;
}
dialog {
  border: 1px solid #d9e4d0;
  border-radius: 17px;
  padding: 0;
  width: 650px;
  max-width: 94vw;
  max-height: 91vh;
  box-shadow: 0 25px 80px #082e3633;
  color: #244837;
}
dialog::backdrop {
  background: #0e302a80;
  backdrop-filter: blur(2px);
}
.modal-head {
  padding: 23px 26px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e5eadf;
  align-items: center;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
}
.close {
  background: #edf1e8;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: #5e6f5b;
  font-size: 22px;
}
.modal-body {
  padding: 25px 26px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.form-grid .span {
  grid-column: 1/-1;
}
.modal-foot {
  border-top: 1px solid #e4eadc;
  padding: 18px 26px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 1px solid #dce4d6;
  border-radius: 9px;
  padding: 15px;
  max-height: 200px;
  overflow: auto;
  margin: 8px 0 20px;
}
.checklist label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
}
.secret {
  background: #f1f5eb;
  border: 1px dashed #a7b99a;
  border-radius: 9px;
  padding: 15px;
  word-break: break-all;
  font-size: 13px;
  line-height: 2;
  direction: ltr;
  text-align: left;
}
.section-subtitle {
  font-size: 13px;
  margin: 20px 0 12px;
}
.setting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.metric-line {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #e8eee1;
}
.mobile-brand {
  display: none;
}
.footer-note {
  text-align: center;
  color: #66715d;
  font-size: 10px;
  margin-top: 28px;
}
.badge-count {
  font-size: 10px;
  background: #ebd9ae;
  color: #6d5930;
  padding: 3px 6px;
  border-radius: 5px;
}
.menu-toggle {
  display: none;
  background: transparent;
  font-size: 22px;
  color: #285440;
}
.nowrap {
  white-space: nowrap;
}
.rtl {
  direction: rtl;
}
.ltr {
  direction: ltr;
  text-align: left;
}
.auth-error {
  color: #a34c3b;
  font-size: 12px;
  line-height: 1.9;
  min-height: 22px;
}
.file-note {
  font-size: 11px;
  color: #65725c;
  line-height: 1.8;
}
.actions-cell {
  display: flex;
  gap: 5px;
}
button.link {
  background: none;
  color: #3d6b50;
  text-decoration: underline;
  padding: 4px;
}
.status-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}
.name-strong {
  font-weight: 650;
}
.help {
  font-size: 11px;
  color: #66725d;
  line-height: 1.9;
}
.auth-brand-small {
  display: none;
}
.divider {
  height: 1px;
  background: #e3eadb;
  margin: 23px 0;
}
pre.json {
  font-size: 11px;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  background: #f5f7ef;
  padding: 15px;
  border-radius: 10px;
  max-height: 300px;
  overflow: auto;
}
@media (min-width: 1500px) {
  .main {
    padding: 35px 45px;
  }
  .topbar {
    padding: 0 45px;
  }
  .stat {
    padding: 25px;
  }
  .stat .value {
    font-size: 33px;
  }
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .sidebar {
    padding: 23px 12px;
  }
  .main {
    padding: 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-main {
    grid-template-columns: 1fr;
  }
  .brand {
    font-size: 20px;
  }
  .auth-art {
    padding: 50px 10%;
  }
  .auth-art h1 {
    font-size: 32px;
  }
}
@media (max-width: 700px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: fixed;
    right: 0;
    z-index: 20;
    width: 230px;
    transform: translateX(100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: -12px 0 40px #0004;
  }
  .sidebar-close {
    display: grid;
    place-items: center;
  }
  .sidebar-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: #0b1f1c80;
  }
  body.menu-open {
    overflow: hidden;
  }
  .menu-toggle {
    display: block;
  }
  .topbar {
    padding: 0 15px;
    height: 72px;
  }
  .top-left {
    gap: 8px;
  }
  .company-switch {
    max-width: 180px;
    font-size: 11px;
  }
  .user-name,
  .topbar .crumb {
    display: none;
  }
  .main {
    padding: 22px 15px;
  }
  .demo-ribbon {
    padding: 8px 15px;
    font-size: 10px;
  }
  .page-head {
    display: block;
  }
  .page-head .actions {
    margin-top: 17px;
  }
  .page-head h1 {
    font-size: 23px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
    min-height: 125px;
  }
  .stat .value {
    font-size: 23px;
  }
  .stat .stat-icon {
    left: 12px;
    top: 12px;
    width: 27px;
    height: 27px;
  }
  .stat .label {
    font-size: 11px;
    max-width: 85px;
  }
  .grid-main {
    gap: 0;
  }
  .panel-head,
  .panel-body {
    padding: 17px;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .search {
    width: 100%;
  }
  .auth-screen {
    display: block;
  }
  .auth-art {
    display: none;
  }
  .auth-form {
    min-height: 100vh;
    padding: 25px;
  }
  .auth-brand-small {
    display: block;
    margin-bottom: 45px;
  }
  .auth-brand-small .brand {
    color: #224e3b;
  }
  .form-grid,
  .setting-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span {
    grid-column: 1;
  }
  .checklist {
    grid-template-columns: 1fr;
  }
  .modal-head,
  .modal-body {
    padding: 20px;
  }
  .modal-foot {
    padding: 16px 20px;
  }
  .actions {
    gap: 7px;
  }
  .button {
    padding: 10px 13px;
  }
  .button.small {
    padding: 7px 9px;
  }
  .auth-card h2 {
    font-size: 25px;
  }
}

/* ---- 1.1.0: lists, filters, detail pages, documents ---- */
.tag.grey {
  background: #eef0ec;
  color: #656d67;
}
.date,
.amount {
  white-space: nowrap;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 23px;
  border-bottom: 1px solid #edf0e8;
  background: #fbfcf8;
}
.filters select,
.filters input[type='date'] {
  padding: 8px 10px;
  font-size: 12px;
  max-width: 220px;
}
.filters .search {
  width: 260px;
  padding: 8px 12px;
}
.filter-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #617367;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 23px;
  border-top: 1px solid #edf0e8;
}
tfoot td {
  background: #f7f9f3;
  font-weight: 650;
  border-top: 1px solid #e3e8df;
  padding: 13px 20px;
}
button.link {
  font-weight: 600;
  text-align: right;
}
.button.link {
  background: none;
  color: #3d6b50;
  text-decoration: underline;
  padding: 4px 6px;
}
.button.whatsapp {
  background: #e3f3e6;
  color: #1f6b3a;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 20px;
}
.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  margin: 0;
}
.kv div {
  border-bottom: 1px solid #eef1ea;
  padding-bottom: 10px;
}
.kv dt {
  font-size: 11px;
  color: #647267;
  margin-bottom: 5px;
}
.kv dd {
  margin: 0;
  font-weight: 600;
  line-height: 1.6;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid #e1e7dc;
}
.tabs button {
  background: none;
  padding: 11px 15px;
  color: #617368;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active {
  color: #173b37;
  border-bottom-color: #174e45;
  font-weight: 700;
}
.form-note {
  background: #f3f6ee;
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 12px;
  color: #56704f;
  line-height: 1.8;
  margin-bottom: 16px;
}
.dynamic-box {
  margin-bottom: 18px;
}
.dynamic-box table td,
.dynamic-box table th {
  padding: 9px 12px;
}
.select-filter {
  padding: 7px 10px;
  font-size: 11px;
  background: #f8faf5;
}
.error-text {
  color: #a34c3b;
}
.invite-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
details.forgot {
  margin-top: 14px;
  font-size: 12px;
  color: #5d7566;
  line-height: 1.9;
}
details.forgot summary {
  cursor: pointer;
  color: #2f6150;
}
dialog.wide {
  width: 960px;
}
pre.result {
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.9;
  background: #f5f7ef;
  padding: 15px;
  border-radius: 10px;
  max-height: 360px;
  overflow: auto;
}
.summary-table td {
  padding: 11px 14px;
}
.summary-table tr.strong td,
.doc-table tr.strong td {
  font-weight: 800;
  border-top: 2px solid #c9d4c1;
}
#print-root {
  display: none;
}
/* Printed documents (also used for the on-screen preview). */
.doc-preview {
  background: #e9ece6;
  max-height: 70vh;
  overflow: auto;
}
.doc {
  background: #fff;
  color: #1d2b27;
  max-width: 780px;
  margin: 0 auto;
  padding: 34px 38px;
  font-size: 13px;
  line-height: 1.7;
  position: relative;
}
.doc.wide {
  max-width: 1100px;
}
.doc-head {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.9fr;
  gap: 16px;
  align-items: start;
  border-bottom: 3px double #174e45;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.doc-company strong {
  display: block;
  font-size: 16px;
  color: #113c38;
}
.doc-company small {
  display: block;
  color: #5b6b63;
  font-size: 10.5px;
  margin-top: 5px;
  line-height: 1.7;
}
.doc-title {
  text-align: center;
}
.doc-title h1 {
  margin: 0;
  font-size: 21px;
  color: #113c38;
}
.doc-title span {
  font-size: 11px;
  color: #63726a;
  letter-spacing: 0.4px;
}
.doc-meta div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #e3e8df;
  padding: 4px 0;
  font-size: 12px;
}
.doc-meta span {
  color: #63726a;
}
.doc-amount {
  border: 1.5px solid #174e45;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.doc-amount div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.doc-amount strong {
  font-size: 20px;
}
.doc-amount p {
  margin: 6px 0 0;
  font-weight: 600;
  color: #36493f;
}
.doc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  margin: 0 0 16px;
}
.doc-fields div {
  display: flex;
  gap: 10px;
  border-bottom: 1px dotted #b9c4b4;
  padding: 6px 0;
}
.doc-fields dt {
  color: #5b6b63;
  min-width: 90px;
}
.doc-fields dd {
  margin: 0;
  font-weight: 600;
}
.doc-section h2 {
  font-size: 14px;
  margin: 18px 0 8px;
  color: #113c38;
}
.doc-section h2 small {
  font-weight: 400;
  color: #5b6b63;
  font-size: 11px;
  margin-right: 8px;
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: normal;
}
.doc-table th {
  background: #eef2ea;
  color: #2d4a3f;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 9px;
  border: 1px solid #d5ddd0;
}
.doc-table td {
  padding: 6px 9px;
  border: 1px solid #e0e6dc;
}
.doc-table tfoot td {
  background: #f6f8f3;
  font-weight: 800;
}
.doc-table tr.neg td {
  color: #8d3d2f;
}
.doc-totals {
  margin-top: 16px;
  max-width: 420px;
  margin-right: auto;
}
.doc-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.doc-summary div {
  border: 1px solid #d5ddd0;
  border-radius: 6px;
  padding: 8px 10px;
}
.doc-summary span {
  display: block;
  font-size: 10.5px;
  color: #5b6b63;
}
.doc-summary small {
  color: #63726a;
}
.doc-note {
  font-size: 11.5px;
  color: #4b5d54;
  margin: 12px 0;
}
.doc-letter p {
  margin: 0 0 12px;
  line-height: 2.1;
}
.doc-stamp {
  border: 2px solid #a34c3b;
  color: #a34c3b;
  font-weight: 800;
  text-align: center;
  padding: 6px;
  margin-bottom: 14px;
  border-radius: 6px;
}
.doc-sign {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 42px;
}
.doc-sign div {
  flex: 1;
  border-top: 1px solid #7d8b83;
  padding-top: 6px;
  text-align: center;
  font-size: 11.5px;
  color: #4b5d54;
}
@media (max-width: 900px) {
  .detail-grid,
  .kv,
  .doc-fields,
  .doc-head {
    grid-template-columns: 1fr;
  }
  .doc-summary {
    grid-template-columns: 1fr 1fr;
  }
  .filters {
    padding: 12px 15px;
  }
  .filters .search,
  .filters select {
    width: 100%;
    max-width: none;
  }
  .pager {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 15px;
  }
  .doc {
    padding: 20px 16px;
  }
}
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }
  body.printing > *:not(#print-root) {
    display: none !important;
  }
  body.printing #print-root {
    display: block;
  }
  body.printing {
    background: #fff;
  }
  .doc {
    max-width: none;
    padding: 0;
    font-size: 12px;
  }
  .doc-head {
    grid-template-columns: 1.3fr 1fr 0.9fr !important;
  }
  .doc-fields {
    grid-template-columns: 1fr 1fr !important;
  }
  .doc-table tr {
    break-inside: avoid;
  }
  .doc-sign {
    break-inside: avoid;
  }
}

.secret.code {
  font-size: 22px;
  letter-spacing: 3px;
  text-align: center;
  font-weight: 800;
}
