/* ───────── Paper output for any in-app page (Ctrl+P / the "طباعة" buttons) ─────────
   The app is a dark glass UI; on paper it must read as ink on white. _head.html also flips
   html.day on beforeprint so every component's day-mode override applies; the rules below
   are the fallback for browsers/print paths that skip that event, plus the paper layout. */
.printhead{display:none}

@media print{
  @page{size:A4;margin:12mm 12mm 16mm}
  :root,html,html.day{
    --bg:#fff;--card:#fff;--card2:#f5f7fa;--paper:#eef2f7;
    --ink:#0f1b2b;--slate:#5d6b7e;--navy:#132539;--navy2:#1d3553;
    --line:#dfe4eb;--line2:#cfd6e0;
    --amber:#d98a00;--amber-d:#b26a00;--amber-bg:#fff4dc;
    --ok:#138a4b;--ok-bg:#e4f6ec;--warn:#b26a00;--warn-bg:#fff2d9;--bad:#c2311f;--bad-bg:#fdeceb;--info:#1d6fd0;--info-bg:#e7f0fc;--violet:#6b4fd8;
    --shadow:none;--shadow-lg:none;--r:10px;
    color-scheme:light}
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  *,*:before,*:after{animation:none!important;transition:none!important;box-shadow:none!important;text-shadow:none!important;backdrop-filter:none!important}
  html,body{background:#fff!important;color:var(--ink)!important;font-size:12.5px}
  body:before,body:after,.pub:before,.pub:after,.card:before,.ocard:before{display:none!important}

  /* everything that only makes sense on screen */
  .side,.topwrap,.topbar,.noprint,.palette,.nprog,.toast,.msg,.btn,button,.pager,.ib,.search,
  form.inline,.itemform,input[type=file],.drop-zone,select{display:none!important}

  /* entrance animations leave content at opacity 0 — force the end state */
  .page>*,.in,.stagger>*,.bayc .floorv svg.tc,.rev .area,.rev .dot,.slot svg.tc{opacity:1!important;transform:none!important}
  .ring .seg{stroke-dasharray:var(--l) 100!important}
  .rev .line{stroke-dashoffset:0!important;clip-path:none!important}
  svg{filter:none!important}

  /* layout: one full-width column */
  html,body,.shell,.page,.main{height:auto!important;min-height:0!important;overflow:visible!important}
  .shell{display:block!important}
  .page{padding:0!important;margin:0!important;max-width:none!important;width:auto!important}
  .page>*{max-width:none!important}

  /* letterhead */
  .printhead{display:flex!important;align-items:center;justify-content:space-between;gap:16px;padding:0 0 10px;margin:0 0 16px;border-bottom:2.5px solid var(--navy);position:relative}
  .printhead:after{content:"";position:absolute;inset-inline-end:0;bottom:-2.5px;width:22%;height:2.5px;background:#f59e0b}
  .printhead .ph-b{display:flex;align-items:center;gap:12px}
  .printhead img{max-height:44px;max-width:130px;object-fit:contain}
  .printhead .mono{width:40px;height:40px;border-radius:10px;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:900;font-size:1.2rem}
  .printhead b{display:block;font-size:1.15rem;font-weight:900;color:var(--navy);line-height:1.2}
  .printhead small{color:var(--slate);font-size:.8rem}
  .printhead .ph-m{text-align:end;color:var(--slate);font-size:.78rem;line-height:1.5}

  /* headings */
  .pagehead{margin:0 0 14px!important;align-items:flex-end}
  .pagehead h1{font-size:1.55rem!important;color:var(--navy)!important;padding-inline-start:12px!important}
  .pagehead h1:before{width:4px!important;background:#f59e0b!important}
  .pagehead .sub{padding-inline-start:12px!important}
  h1,h2,h3{color:var(--navy)!important;break-after:avoid}
  h2{font-size:1.05rem}
  .hello h1 span,.ring .ctr b,.auth-show h2 em{background:none!important;-webkit-text-fill-color:currentColor;color:var(--ink)!important}

  /* surfaces */
  .card,.ocard,.stat,.aipanel,.box{background:#fff!important;border:1px solid var(--line)!important;border-radius:10px!important;color:var(--ink)!important}
  /* keep small blocks whole; big sections may flow across pages instead of leaving half-empty sheets */
  .stat,.box,.card .card,.card .ocard,.stats>*,.split>.card{break-inside:avoid;page-break-inside:avoid}
  .card{padding:14px 16px!important;margin:0 0 12px!important}
  .split,.grid,.dgrid,.stats,.formgrid{gap:12px!important}
  .muted,.sub,small{color:var(--slate)!important}
  a{color:inherit!important;text-decoration:none!important}
  .total{color:var(--ink)!important;font-weight:900}
  .badge,.pill{border:1px solid currentColor;background:#fff!important}

  /* tables */
  table{border-collapse:collapse!important;width:100%}
  thead{display:table-header-group}
  tr{break-inside:avoid}
  th{background:var(--card2)!important;color:var(--slate)!important;font-size:.72rem!important;padding:7px 8px!important;border-bottom:1.5px solid var(--line2)!important}
  td{padding:7px 8px!important;border-bottom:1px solid var(--line)!important;color:var(--ink)}
  table tr:hover td{background:none!important}

  /* figures */
  .stat{min-height:0!important;padding:10px 14px!important}
  .stat b{font-size:1.7rem!important;color:var(--ink)!important}
  .stat svg.sp{height:22px!important}
  .qrbox{background:#fff!important;border:1px solid var(--line)!important}
  .qrbox svg path{fill:#000}

  /* the windscreen sticker: the card is the whole page */
  .stk{border:1.5px solid var(--ink)!important;border-radius:14px!important;margin:6mm auto 0!important;padding:18px!important;break-inside:avoid}
}
