/* Hesab — accounting & inventory additions on top of site.css + admin.css */
.side-brand { display: block; padding: 8px 10px 18px; color: #fff; text-decoration: none; }
.side-brand b { display: block; font-size: 17px; }
.side-brand span { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }
.fy-pick .select { min-width: 140px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
td.num, th.num, .num-in { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num { text-align: left; direction: ltr; }
.num-in { text-align: left; }
.text-red { color: var(--danger); }
.text-green { color: var(--success); }
.table tfoot td { background: var(--surface-2); font-weight: 600; }

/* line editors (vouchers, invoices, stock) */
.lines-table td { padding: 6px 8px; vertical-align: top; }
.lines-table .input, .lines-table .select { min-height: 38px; padding: 6px 10px; }
.lines-table .ln-no { color: var(--muted); width: 28px; padding-top: 14px; }
.lines-table tr[data-line]:focus-within { background: var(--brand-soft); }
.inv-totals .summary-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.inv-totals .summary-row.total { font-size: 18px; border-bottom: 2px solid var(--ink); }
.pay-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; }
@media (max-width: 720px) { .pay-row { grid-template-columns: 1fr 1fr; } }

/* autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 300px; overflow: auto; padding: 4px; min-width: 260px; }
.ac-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: right; background: none; border: 0; padding: 9px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.ac-list button small { color: var(--muted); white-space: nowrap; }
.ac-list button.on, .ac-list button:hover { background: var(--brand-soft); }
.ac-list .ac-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.ac.picked [data-ac-text] { border-color: var(--success); }

/* chart of accounts */
.acc-tree details { border-inline-start: 2px solid var(--line); margin-inline-start: 14px; }
.acc-tree > details { margin-inline-start: 0; border: 0; }
.acc-tree summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.acc-tree summary::-webkit-details-marker { display: none; }
.acc-tree summary:hover { background: var(--surface-2); }
.acc-tree .lvl-1 > summary { font-weight: 800; font-size: 15px; }
.acc-tree .lvl-2 > summary { font-weight: 700; }
.acc-tree .lvl-3 > summary { cursor: default; }
.acc-code { font-variant-numeric: tabular-nums; min-width: 46px; color: var(--muted); }
.acc-actions { margin-inline-start: auto; display: flex; gap: 6px; opacity: .55; }
.acc-tree summary:hover .acc-actions { opacity: 1; }

.wh-row, .api-row { display: grid; grid-template-columns: 40px 1.2fr 1fr 1.2fr 70px 120px 60px 150px; gap: 10px; align-items: center; padding: 8px 14px; min-width: 900px; }
.api-row { grid-template-columns: 1.3fr 80px 1fr 1fr 120px 60px 120px; }
.token { display: inline-block; padding: 4px 8px; background: #fff; border-radius: 6px; user-select: all; word-break: break-all; }
.api-doc pre { background: var(--ink); color: #e2e8f0; padding: 14px; border-radius: 12px; overflow: auto; font-size: 12.5px; line-height: 1.8; }

/* statements */
.statement .grp-head th { background: var(--surface-2); text-align: right; }
.statement .grp-total td { border-top: 1px solid var(--line); }
.statement .grp-key td { background: var(--brand-soft); font-weight: 700; }
.statement .grp-key.big td { font-size: 17px; }
.table tr.grp-start td { border-top: 2px solid var(--line); }
.trial thead th { text-align: center; }

/* point of sale */
.pos-body { background: var(--bg); }
.pos { display: flex; flex-direction: column; min-height: 100vh; }
.pos-top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--ink); color: #fff; }
.pos-top .muted { color: #94a3b8; margin-inline-start: auto; }
.pos-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px; flex: 1; }
.pos-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pos-scan .input { font-size: 17px; }
.pos-favs { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-fav { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; cursor: pointer; font: inherit; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.pos-fav small { color: var(--muted); }
.pos-fav:hover { border-color: var(--brand); }
.pos-cart { flex: 1; }
.pos-cart .qty-box { display: flex; align-items: center; gap: 4px; }
.pos-cart .qty-box input { width: 64px; text-align: center; }
.pos-right { align-self: start; position: sticky; top: 16px; }
.pos-right .summary-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pos-total { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 14px; }
.pos-total b { font-size: 26px; color: var(--brand); }
.pos-pay { display: flex; flex-direction: column; gap: 8px; }
.pos-pay-row { display: grid; grid-template-columns: 1fr 150px; gap: 8px; align-items: center; font-size: 13.5px; }
@media (max-width: 960px) { .pos-main { grid-template-columns: 1fr; } .pos-right { position: static; } }

@media print {
  .admin-side, .admin-top, .no-print, .filters, .pagination, .form-actions, .toast-stack, .flash-stack { display: none !important; }
  .admin-main { margin: 0 !important; }
  .admin-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc; }
  body { background: #fff; }
  a.link { color: inherit; text-decoration: none; }
}
.side-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.alarm-bar { display: flex; margin-bottom: 12px; text-decoration: none; color: inherit; }
.alarm-bar:hover { filter: brightness(.97); }
.sign-wrap { max-width: 960px; }
.sign-pad { width: 100%; height: auto; aspect-ratio: 900 / 320; border: 2px dashed var(--line); border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; }
.sign-items { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.receiver-box { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.signature-img { max-height: 90px; max-width: 260px; }
.idcard-img { max-height: 90px; border-radius: 8px; border: 1px solid var(--line); }
/* Jalali date picker */
.jdp { position: absolute; z-index: 200; width: 260px; background: var(--surface, #fff); border: 1px solid var(--line, #e4e7ef); border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(15,23,42,.35); padding: 10px; direction: rtl; font-family: inherit; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-head button { border: 0; background: var(--surface-2, #f8f9fc); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.jdp-dn { font-size: 12px; color: var(--muted, #64748b); padding: 4px 0; }
.jdp-d { border: 0; background: none; padding: 6px 0; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; color: inherit; }
.jdp-d:hover { background: var(--brand-soft, #fef3c7); }
.jdp-d.fri { color: #dc2626; }
.jdp-d.today { box-shadow: inset 0 0 0 1px var(--brand, #f5a524); }
.jdp-d.on { background: var(--ink, #0b1220); color: #fff; }
.jdp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.jdp-foot button { border: 0; background: none; color: var(--info, #2563eb); cursor: pointer; font: inherit; font-size: 13px; }
.sub-row { display: grid; grid-template-columns: 60px 1.4fr 1fr 110px 60px 60px 220px; gap: 10px; align-items: center; padding: 8px 14px; min-width: 860px; }
table.rows-link tbody tr[data-href] { cursor: pointer; }
table.rows-link tbody tr[data-href]:hover td { background: var(--brand-soft); }
.ac-list .ac-new { display: block; width: 100%; text-align: right; border: 0; border-top: 1px dashed var(--line); background: none; padding: 10px; color: var(--info); cursor: pointer; font: inherit; }
.ac-list .ac-new:hover { background: var(--brand-soft); }
