:root { font-family: Tahoma, "Segoe UI", sans-serif; color: #153a34; background: #f3f6f3; line-height: 1.55; }
* { box-sizing: border-box; }
body { margin: 0; }
header, nav { background: #123c35; color: white; padding: .8rem max(1rem,calc((100vw - 1200px)/2)); display: flex; align-items: center; gap: .65rem; }
header { justify-content: space-between; border-bottom: 1px solid #426760; }
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; font-size: 1.2rem; font-weight: bold; }
.mark { display: block; border-radius: .65rem; }
.header-actions { display: flex; align-items: center; gap: .7rem; }
nav { flex-wrap: wrap; }
nav button { color: white; background: transparent; border-color: transparent; }
nav button[aria-current="page"] { background: #326256; }
main { max-width: 1232px; margin: auto; padding: 1rem; }
h1 { margin: .6rem 0 1rem; }
h2, h3 { margin: 0 0 .8rem; }
button, select, input { font: inherit; padding: .45rem .7rem; min-height: 42px; border: 1px solid #a5b9b0; border-radius: .5rem; color: #153a34; background: white; }
button { cursor: pointer; }
button:hover { border-color: #28745f; }
button.primary { background: #19604e; color: white; border-color: #19604e; }
button:disabled { opacity: .5; cursor: default; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 1rem; align-items: start; }
.card, #message { background: white; border: 1px solid #d9e4dd; padding: 1rem; border-radius: .9rem; margin-bottom: .8rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .55rem 0; }
.between { justify-content: space-between; }
.field { display: grid; gap: .25rem; margin: .55rem 0; }
.small { color: #48635c; font-size: .9rem; }
.badge { display: inline-block; border-radius: 1rem; background: #e4eee8; padding: .15rem .6rem; }
#message { border-color: #b98b53; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .35rem; text-align: start; border-bottom: 1px solid #ddd; }
#print { display: none; }
@media print {
  @page { margin: 3mm; }
  body { color: black; background: white; }
  header, nav, main { display: none; }
  #print { display: block; width: 72mm; max-width: 100%; margin: auto; font-size: 11pt; }
}

@media print {
  #print.report-print { width: 180mm; }
  #print .card { border: none; padding: 0; }
}

@font-face { font-family: Vazirmatn; src: url('./Vazirmatn-Regular.ttf') format('truetype'); font-display: swap; }
:root { font-family: Vazirmatn, Tahoma, sans-serif; background: #f3f6f4; }
header { padding-block: 1rem; }
#connection { font-size: .9rem; color: #d1eee3; }
nav { position: sticky; top: 0; z-index: 2; box-shadow: 0 4px 12px #16372f18; }
nav button { border-radius: .65rem; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8da881; outline-offset: 2px; }
.card { min-width: 0; overflow-wrap: anywhere; box-shadow: 0 3px 12px #16372f09; }
.card .row.between + .row.between { border-top: 1px solid #e8eeea; padding-top: .55rem; }
.field input, .field select { width: 100%; min-width: 0; }
@media (max-width: 700px) {
  nav { position: static; }
  nav button { flex: 1 0 auto; min-height: 44px; }
  header { flex-wrap: wrap; }
}

@media screen {
  :root {
    color-scheme: light;
    --ink: #17392f;
    --forest: #123c32;
    --green: #126349;
    --paper: #fff;
    --line: #dce8e2;
    color: var(--ink);
    background: linear-gradient(140deg,#e8f1eb,#f6f8f7 65%) fixed;
  }
  header { background: var(--forest); border-color: #ffffff25; padding-inline: clamp(1rem,4vw,3rem); }
  .brand { font-size: clamp(1.125rem,2vw,1.45rem); }
  .mark { width: 44px; height: 44px; padding: 3px; background: #fff; }
  #connection { border: 1px solid #ffffff40; border-radius: 2rem; padding: .2rem .75rem; }
  nav { background: var(--forest); }
  nav button { font-weight: 650; text-align: start; }
  nav button:hover { background: #ffffff13; }
  nav button[aria-current=page] { background: #d6ead9; color: #17392f; }
  nav button[data-action=demo-reset] { color: #f5d5a4; }
  main { width: 100%; max-width: 1460px; padding: clamp(1rem,3vw,2.5rem); min-width: 0; }
  h1 { font-size: clamp(1.55rem,3vw,2.25rem); line-height: 1.35; margin: 0 0 1.3rem; }
  h2 { font-size: 1.18rem; }
  h3 { font-size: 1.05rem; }
  .grid { gap: 1.15rem; }
  .card, #message {
    padding: clamp(1rem,2.4vw,1.5rem);
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: var(--paper);
    box-shadow: 0 5px 20px #183a2d0b;
  }
  .card > h2:first-child { padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
  .card .card { background: #f7faf8; box-shadow: none; }
  button, select, input { border-radius: .65rem; border-color: #b9cec3; min-height: 44px; }
  button { font-weight: 650; }
  button:hover { background: #eaf4ed; }
  button.primary { background: var(--green); border-color: var(--green); }
  button.primary:hover { background: #0e503b; }
  form button { margin-block-start: .35rem; }
  .field { font-weight: 650; margin-block: .75rem; }
  .field input, .field select { font-weight: 400; background: #f8fbf9; }
  .table-picker { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,7.75rem),1fr)); gap: .5rem; }
  .table-picker button { min-height: 49px; }
  .stock-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; margin-bottom: .5rem; }
  .stock-stats .card { border-block-start: 3px solid #46856d; }
  .stock-stats .card:nth-child(2) { border-block-start-color: #ad6c25; }
  .stock-stats strong { display: block; font-size: 1.75rem; }
  table { background: var(--paper); }
  th { background: #eaf2ed; }
  th, td { padding: .6rem .5rem; }
  tfoot { font-weight: 700; }

  @media (min-width: 1000px) {
    body { display: grid; grid-template-columns: 13rem minmax(0,1fr); grid-template-rows: auto 1fr; min-height: 100dvh; }
    header { grid-column: 1 / -1; }
    nav {
      position: sticky;
      top: 0;
      align-self: start;
      height: 100dvh;
      overflow: auto;
      padding: 1.15rem .85rem;
      flex-direction: column;
      align-items: stretch;
      flex-wrap: nowrap;
    }
    nav button { flex: 0 0 auto; padding-inline: .85rem; }
    nav button[data-action=demo-reset] { margin-top: .65rem; border-top: 1px solid #ffffff30; }
    [data-page=order] > .grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  }
  @media (max-width: 999px) {
    nav { padding-inline: 1rem; }
    nav button { text-align: center; }
  }
  @media (max-width: 490px) {
    .stock-stats { gap: .4rem; }
    .stock-stats .card { padding: .7rem .45rem; font-size: .9rem; }
    .stock-stats strong { font-size: 1.35rem; }
    table { overflow-wrap: anywhere; }
  }
}
