@font-face {
  font-family: Vazir;
  src: url("/fonts/vazir.ttf");
}
@font-face {
  font-family: Vazir;
  src: url("/fonts/vazir-bold.ttf");
  font-weight: 700;
}
* {
  box-sizing: border-box;
}
:root {
  --accent: #5351ee;
  --ink: #18213b;
  --muted: #7c849b;
  --line: #e7eaf2;
  --canvas: #f5f7fc;
  --green: #157955;
  --navy: #192440;
  --lilac: #f0efff;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Vazir, sans-serif;
  font-size: 14px;
  line-height: 1.8;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: var(--accent);
  text-decoration: none;
}
svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 26px;
  line-height: 1.5;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 15px;
}
p {
  color: var(--muted);
}
small {
  font-size: 11px;
  font-weight: 400;
}
button {
  border: 0;
  color: inherit;
  background: none;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 49px;
  padding: 11px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #5351ee13;
}
input[type="checkbox"] {
  width: 19px;
  min-height: 19px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
input[type="color"] {
  padding: 5px;
  width: 70px;
}
textarea {
  resize: vertical;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #aaa7ff;
  outline-offset: 4px;
  border-radius: 8px;
}
.ltr,
.number {
  direction: ltr;
  unicode-bidi: plaintext;
}
.number {
  text-align: left;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  width: 42px;
  height: 42px;
}
.brand b {
  font-size: 23px;
  display: block;
  line-height: 1.4;
}
.brand small {
  display: block;
  color: var(--muted);
}
.btn {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:0;
  min-width:0;
  max-width:100%;
  min-height:46px;
  padding:11px 18px;
  border:1px solid transparent;
  border-radius:12px;
  font-size:13px;
  font-weight:700;
  line-height:1.6;
  text-align:center;
  white-space:normal;
  overflow-wrap:break-word;
  vertical-align:middle;
  touch-action:manipulation;
  transition:background .15s,border-color .15s,box-shadow .15s,transform .15s;
}
/* Margins also work on the POS WebView, which predates flex gap. */
.btn svg,.textbtn svg {width:19px;height:19px;flex-shrink:0;margin:0 6px;}
.btn.primary {
  background:var(--accent);
  color:#fff;
  box-shadow:0 2px 4px #18213b12;
}
.btn.secondary {
  background:var(--lilac);
  color:var(--accent);
  border-color:var(--lilac);
}
.btn.outline {
  border-color:#d7dce8;
  background:#fff;
  color:var(--ink);
}
.btn.danger {
  color:#a42d3e;
  background:#fff1f2;
  border-color:#f3d4d9;
}
.btn.compact {min-height:40px;padding:8px 13px;font-size:12px;}
.btn:focus,.textbtn:focus,.iconbtn:focus {
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.btn:disabled,.textbtn:disabled,.iconbtn:disabled {
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}
.btn[aria-busy="true"] {cursor:progress;}
.btn:not(:disabled):active {transform:translateY(1px);box-shadow:none;}
@media(hover:hover) and (pointer:fine) {
  .btn:not(:disabled):hover {filter:brightness(.97);box-shadow:0 3px 8px #18213b12;}
  .textbtn:not(:disabled):hover,.iconbtn:not(:disabled):hover {background:var(--lilac);}
}
@media(pointer:coarse) {
  .btn.compact {min-height:44px;}
}
@media(prefers-reduced-motion:reduce) {
  .btn {transition:none;}
  .btn:not(:disabled):active {transform:none;}
}
.full {width:100%;}
.textbtn {
  color:var(--accent);
  font-size:13px;
  font-weight:700;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:0;
  min-height:44px;
  min-width:0;
  max-width:100%;
  padding:9px 10px;
  border-radius:10px;
  line-height:1.6;
  text-align:center;
  overflow-wrap:break-word;
  touch-action:manipulation;
}
.iconbtn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  min-width:44px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8f9fc;
  flex-shrink:0;
  touch-action:manipulation;
}
.iconbtn svg {width:20px;height:20px;}
.iconbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--accent);
  background: var(--lilac);
  flex-shrink: 0;
}
.iconbox.mint {
  color: #268568;
  background: #e6f7ef;
}
.iconbox.peach {
  color: #b57b35;
  background: #fff3df;
}
.iconbox.blue {
  color: #4b88c6;
  background: #ecf4ff;
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 6px;
  font-size: 10px;
  border-radius: 7px;
  padding: 3px 9px;
  background: var(--lilac);
  color: var(--accent);
  line-height: 1.9;
}
.badge.good {
  background: #e6f7ef;
  color: #16835d;
}
.badge.warn {
  background: #fff2d7;
  color: #a16f20;
}
.badge.muted {
  background: #f1f3f8;
  color: #7c859b;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 25px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 21px;
}
.section-head p {
  font-size: 12px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.heading p {
  margin-top: 5px;
  font-size: 13px;
}
.heading .date {
  font-size: 12px;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 22px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.field {
  display: block;
  text-align: right;
}
.field > span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.field .helper {
  margin-top: 6px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.form-stack {
  display: grid;
  gap: 20px;
}
.helper {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}
.notice,
.error {
  padding: 13px 16px;
  border-radius: 12px;
  background: #f1f3fc;
  font-size: 12px;
  color: #596687;
  line-height: 2;
}
.notice.warn {
  background: #fff6e6;
  color: #956e2e;
}
.error {
  background: #fff0f1;
  color: #af3f50;
}
.error:empty {
  display: none;
}
.empty {
  text-align: center;
  padding: 45px 18px;
}
.empty .iconbox {
  margin-bottom: 14px;
}
.empty h3 {
  margin-bottom: 5px;
}
.empty p {
  font-size: 12px;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
}
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  padding: 12px 15px;
  background: #f8f9fd;
}
td {
  padding: 17px 15px;
  border-bottom: 1px solid #eff1f7;
}
tr:last-child td {
  border-bottom: 0;
}
td strong {
  display: block;
  font-size: 12px;
}
td small {
  display: block;
  color: var(--muted);
}
.checkrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 23px;
}
.tabs button {
  padding: 12px 17px;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  color: var(--accent);
  border-color: var(--accent);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 17px;
}
.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.4;
}
.metric p {
  font-size: 11px;
  margin-bottom: 7px;
}
.metric small {
  font-size: 10px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}
.modal-backdrop {
  position: fixed;
  /* Android POS WebView 74 does not support the inset shorthand. */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #111c3e66;
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  width: 560px;
  max-width: 100%;
  padding: 25px;
  box-shadow: 0 30px 100px #14213c33;
}
.result-list {
  margin: 10px 0;
}
.result-list > div {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.result-list dt {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.result-list dd {
  margin: 0;
  text-align: left;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.result-list .result-list {
  margin: 0;
}
.result-list .result-list > div {
  padding: 5px 0;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 22px;
  font-size: 12px;
}
.back svg {
  transform: rotate(180deg);
  width: 17px;
}
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translate(-50%, 15px);
  z-index: 200;
  background: #17213a;
  color: #fff;
  border-radius: 12px;
  padding: 13px 22px;
  max-width: 90vw;
  font-size: 12px;
  box-shadow: 0 10px 30px #17213a30;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}
.auth-story {
  background: #192440;
  color: #fff;
  padding: 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-story:after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  bottom: -240px;
  left: -170px;
  border: 1px solid #ffffff14;
  border-radius: 50%;
  box-shadow:
    0 0 0 65px #ffffff04,
    0 0 0 130px #ffffff04,
    0 0 0 195px #ffffff03;
}
.auth-story .brand small {
  color: #a2aec8;
}
.auth-story h1 {
  font-size: 43px;
  max-width: 450px;
  line-height: 1.7;
}
.auth-story p {
  color: #abb6cd;
  max-width: 400px;
  margin-top: 18px;
  font-size: 14px;
}
.auth-story footer {
  color: #8c9cb9;
  font-size: 11px;
}
.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-form > div {
  width: 360px;
  max-width: 100%;
}
.auth-form .brand {
  margin-bottom: 45px;
}
.auth-form h1 {
  font-size: 25px;
  margin-bottom: 9px;
}
.auth-form form {
  margin-top: 28px;
}
.auth-foot {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  margin-top: 25px;
}
.muted {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .heading {
    align-items: start;
  }
  .heading h1 {
    font-size: 23px;
  }
  .heading .date {
    display: none;
  }
  .panel {
    padding: 20px;
    border-radius: 16px;
  }
  .metric-grid {
    gap: 9px;
  }
  .metric {
    padding: 14px 11px;
    display: block;
  }
  .metric .iconbox {
    width: 33px;
    height: 33px;
    margin-bottom: 10px;
  }
  .metric .iconbox svg {
    width: 18px;
    height: 18px;
  }
  .metric strong {
    font-size: 20px;
  }
  .metric small {
    font-size: 9px;
  }
  .auth-shell {
    display: block;
  }
  .auth-story {
    display: none;
  }
  .auth-form {
    padding: 35px 25px;
    min-height: 100vh;
  }
  .modal-backdrop {
    padding: 12px;
  }
  .modal {
    padding: 20px;
  }
  .section-head {
    gap: 10px;
  }
  .section-head h2 {
    font-size: 16px;
  }
  .result-list > div {
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.message-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;width:100%;text-align:right;padding:18px 4px;border-bottom:1px solid var(--line)}
.message-row strong{flex:1;min-width:150px}.message-row p,.message-row small{flex-basis:100%;color:var(--muted);overflow-wrap:anywhere}.message-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:2.1;margin:20px 0}.recipient-picker{border:1px solid var(--line);padding:16px;border-radius:14px}.recipient-picker input[type=text],#recipient-search{min-width:0;width:100%}.recipient-list,#recipient-options{max-height:300px;overflow:auto}.recipient-list p{padding:7px 0}.recipient-picker .checkrow{padding:10px 0}textarea{font:inherit;padding:12px;border:1px solid var(--line);border-radius:10px;resize:vertical;width:100%;background:#fff;color:var(--ink)}
[hidden]{display:none!important}
