/* Print station — screen layout, the printed sheet, and the print rules (only the sheet prints). */

/* ---------------- station (screen) */
.ps-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.ps-cat { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 12px; }
.ps-cat .search-in { min-width: 0; width: 100%; margin-bottom: 8px; }
.ps-group p { font: 600 10px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin: 12px 4px 4px; }
.ps-doc-link { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; }
.ps-doc-link:hover { background: var(--panel2); } .ps-doc-link.on { background: var(--green); color: var(--oat); }
:root[data-theme="dark"] .ps-doc-link.on { background: var(--clay); color: var(--green); }
.ps-doc-link .ico { width: 17px; height: 17px; flex: none; }
.ps-home { display: flex; flex-direction: column; gap: 14px; }
.ps-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ps-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px 18px 8px 8px; background: var(--panel2); text-decoration: none; }
.ps-tile:hover { border-color: var(--clay); } .ps-tile .ico { color: var(--tack); } .ps-tile b { font-size: 15px; } .ps-tile small { color: var(--mute); font-size: 12.5px; line-height: 1.35; }
.ps-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ps-doc-head > div:first-child { display: flex; gap: 10px; align-items: center; min-width: 0; } .ps-doc-head h2 { font-size: 22px; } .ps-doc-head small { color: var(--mute); }
.ps-doc-head > div:first-child > .ico { width: 28px; height: 28px; color: var(--tack); flex: none; }
.ps-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.ps-opts { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.ps-opts h3 { margin: 0; }
.ps-multi { border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.ps-multi-bar { display: flex; gap: 4px; align-items: center; padding: 6px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.ps-multi-bar input { padding: 5px 8px; font-size: 13px; } .ps-multi-bar small { font: 500 11px var(--f-mono); color: var(--mute); white-space: nowrap; }
.ps-multi-list { max-height: 220px; overflow-y: auto; padding: 4px 8px; }
.ps-multi-list label { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; cursor: pointer; } .ps-multi-list label[hidden] { display: none; }
.ps-setup { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.ps-setup summary { cursor: pointer; font-weight: 700; display: flex; gap: 6px; align-items: center; } .ps-setup[open] { display: flex; }
.ps-setup .fld { margin-top: 8px; }
.ps-preview-wrap { padding: 0; overflow: hidden; }
.ps-preview-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); font: 500 11px var(--f-mono); color: var(--mute); }
.ps-preview { background: repeating-linear-gradient(45deg, var(--panel2) 0 10px, var(--bg) 10px 20px); padding: 12px; overflow: hidden; min-height: 320px; position: relative; }
.ps-empty-prev { display: grid; place-items: center; gap: 8px; padding: 60px 20px; color: var(--mute); text-align: center; } .ps-empty-prev .ico { width: 40px; height: 40px; }

/* ---------------- the sheet (same on screen preview and on paper) */
.ps-sheet { color: #12201A; font: 500 12px/1.4 'Rajdhani', system-ui, sans-serif; --pc: var(--ps-c, #E3915E); --pi: var(--ps-ink, #12201A); }
.ps-sheet[lang="ar"] { font-family: 'Noto Kufi Arabic', 'Rajdhani', sans-serif; font-size: 11px; }
.ps-sheet[lang="ar"] * { letter-spacing: 0 !important; }
.ps-preview .ps-sheet.is-flow { width: var(--pw); min-height: var(--ph); background: #fff; padding: var(--pm); box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); box-sizing: border-box;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--pbreak, 1000px) - 1px), rgba(227,145,94,.55) calc(var(--pbreak, 1000px) - 1px), rgba(227,145,94,.55) var(--pbreak, 1000px)); background-position: 0 var(--pm); background-origin: border-box; }
.ps-preview .ps-sheet.is-grid { display: flex; flex-direction: column; gap: 16px; width: var(--pw); }
.ps-preview .ps-page { background: #fff; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); }
.ps-page { box-sizing: border-box; overflow: hidden; break-after: page; page-break-after: always; }
.ps-page:last-child { break-after: auto; page-break-after: auto; }
.ps-grid { display: grid; align-content: start; }
.ps-cell { box-sizing: border-box; overflow: hidden; }
.ps-preview .ps-cell { outline: 1px dashed #d8d3c6; outline-offset: -1px; }
.ps-break { break-after: page; page-break-after: always; } .ps-break:last-child { break-after: auto; page-break-after: auto; }
.ps-preview .ps-break + .ps-break { border-top: 2px dashed rgba(227,145,94,.6); padding-top: 6mm; margin-top: 6mm; }

.ps-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2.5px solid var(--pi); padding-bottom: 8px; margin-bottom: 10px; }
.ps-head.compact { padding-bottom: 4px; margin-bottom: 6px; }
.ps-brand { display: flex; gap: 10px; align-items: center; min-width: 0; } .ps-brand b { font: 700 16px 'Rajdhani', sans-serif; letter-spacing: .04em; display: block; }
.ps-brand small { display: block; font-size: 10px; color: #3E4A42; } .ps-logo { max-width: 160px; object-fit: contain; }
.ps-title { text-align: end; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ps-title h1 { font: 700 21px 'Rajdhani', sans-serif; letter-spacing: .05em; margin: 0; text-transform: uppercase; color: var(--pi); }
.ps-sheet[lang="ar"] .ps-title h1 { font-family: 'Noto Kufi Arabic', sans-serif; text-transform: none; font-size: 17px; }
.ps-title span { font-size: 11px; color: #3E4A42; } .ps-title svg { margin-top: 2px; }
.ps-mono, .ps-sheet .r, .ps-sheet td.r { font-family: 'IBM Plex Mono', monospace; }
.ps-sec { margin: 8px 0; break-inside: avoid; } .ps-sec h2 { font: 700 11px 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--pc); border-bottom: 1px solid #E5E2D8; padding-bottom: 2px; margin: 0 0 5px; }
.ps-sheet[lang="ar"] .ps-sec h2 { font-family: 'Noto Kufi Arabic', sans-serif; text-transform: none; font-size: 11px; }
.ps-h3 { font-size: 14px; margin: 6px 0; }
.ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ps-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(42mm, 1fr)); gap: 3px 10px; margin: 0; }
.ps-kv div { break-inside: avoid; } .ps-kv dt { font: 600 8.5px 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .08em; color: #6E766C; } .ps-kv dd { margin: 0; font-size: 12px; }
.ps-sheet[lang="ar"] .ps-kv dt { font-family: 'Noto Kufi Arabic', sans-serif; text-transform: none; font-size: 9px; }
.ps-tbl { width: 100%; border-collapse: collapse; font-size: 11px; margin: 4px 0; }
.ps-tbl thead { display: table-header-group; } .ps-tbl tr { break-inside: avoid; page-break-inside: avoid; }
.ps-tbl th { text-align: start; font: 600 8.5px 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--pi); padding: 4px 5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-sheet[lang="ar"] .ps-tbl th { font-family: 'Noto Kufi Arabic', sans-serif; text-transform: none; font-size: 9px; }
.ps-tbl td { padding: 4px 5px; border-bottom: 1px solid #E5E2D8; vertical-align: top; }
.ps-tbl tbody tr:nth-child(even) td { background: #F7F6F1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-tbl th.r, .ps-tbl td.r { text-align: end; } .ps-tbl th.c, .ps-tbl td.c { text-align: center; }
.ps-tbl small { color: #6E766C; font-size: 9.5px; }
.ps-tbl.ps-big { font-size: 12.5px; } .ps-tbl.ps-big td { padding: 6px; }
.ps-tbl.ps-tall td { height: 9mm; }
.ps-tbl.ps-mar td { font-size: 10px; } .ps-tbl.ps-mar td .ps-box { width: 4mm; height: 4mm; }
.ps-init { display: inline-block; width: 7mm; border-bottom: 1px solid #aaa; margin-inline-start: 2px; height: 3mm; }
.ps-box { display: inline-grid; place-items: center; width: 3.6mm; height: 3.6mm; border: 1.2px solid #12201A; border-radius: 1mm; font-size: 9px; line-height: 1; vertical-align: middle; }
.ps-na { color: #B5B0A2; } .ps-bad { color: #A8341F; }
.ps-alert { border: 1.5px solid #E5B83B; background: #FFF3D1; border-radius: 2mm; padding: 4px 8px; margin: 6px 0; font-size: 11.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-alert b { font: 700 9px 'IBM Plex Mono', monospace; letter-spacing: .12em; color: #6B5200; margin-inline-end: 4px; }
.ps-empty { color: #6E766C; font-style: italic; }
.ps-pre { white-space: pre-wrap; margin: 2px 0; min-height: 4mm; }
.ps-small { font-size: 9.5px; color: #3E4A42; } .ps-lead { font-size: 13px; }
.ps-ul { margin: 2px 0; padding-inline-start: 16px; }
.ps-lines i { display: block; border-bottom: 1px solid #C9C4B6; height: 7mm; font-style: normal; padding-top: 2mm; }
.ps-line { display: flex; flex-direction: column; flex: 1; min-width: 40mm; } .ps-line span { font: 600 8.5px 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .08em; color: #6E766C; }
.ps-line i { display: block; border-bottom: 1px solid #12201A; min-height: 7mm; font-style: normal; padding-top: 1.5mm; font-size: 12px; }
.ps-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; } .ps-fields.two { margin-top: 10px; }
.ps-check { columns: 2; column-gap: 12px; } .ps-check p { margin: 2px 0; break-inside: avoid; }
.ps-tot { display: flex; justify-content: flex-end; margin: 6px 0; break-inside: avoid; }
.ps-tot .ps-kv { display: flex; flex-direction: column; gap: 1px; min-width: 75mm; border-top: 2px solid var(--pi); padding-top: 4px; }
.ps-tot .ps-kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 10mm; }
.ps-tot .ps-kv dd { font-family: 'IBM Plex Mono', monospace; text-align: end; }
.ps-amount { font: 700 28px 'IBM Plex Mono', monospace; margin: 6px 0 10px; color: var(--pi); }
.ps-tag { font: 700 10px 'IBM Plex Mono', monospace; border: 1.5px solid #E5B83B; color: #6B5200; padding: 1px 6px; border-radius: 4px; }
.ps-stamp { align-self: center; margin-inline-end: auto; margin-inline-start: 18mm; transform: rotate(-14deg); font: 700 34px 'Rajdhani', sans-serif; letter-spacing: .2em; color: #2E7D4F; border: 3px solid #2E7D4F; padding: 2px 14px; border-radius: 8px; opacity: .75; }
.ps-stamp.bad { color: #A8341F; border-color: #A8341F; }
.ps-flow { position: relative; }
.ps-foot { margin-top: 12px; break-inside: avoid; }
.ps-sign { display: flex; gap: 20mm; margin: 10px 0 9mm; } .ps-sign div { width: 55mm; border-bottom: 1px solid #12201A; min-height: 16mm; position: relative; display: flex; align-items: flex-end; }
.ps-sign img { max-height: 15mm; max-width: 50mm; object-fit: contain; } .ps-sign span { position: absolute; bottom: -4mm; font: 600 8px 'IBM Plex Mono', monospace; color: #6E766C; text-transform: uppercase; }
.ps-foot-line { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #E5E2D8; padding-top: 4px; font-size: 8.5px; color: #6E766C; }
.ps-legend { display: flex; gap: 10px; font-size: 10px; } .ps-legend span { display: inline-flex; align-items: center; gap: 4px; } .ps-legend span::before { content: ''; width: 9px; height: 9px; border: 1px solid #12201A; border-radius: 3px 3px 1px 1px; }
.ps-legend .s-turned_out::before { background: #B7D3B0; } .ps-legend .s-vet_watch::before { background: #FFF3D1; border-color: #E5B83B; } .ps-legend .empty::before { border-style: dashed; }
.ps-mini { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px; } .ps-mini td { border-bottom: 1px solid #E5E2D8; padding: 2px 4px; }
.ps-spark { width: 40mm; height: 7mm; fill: var(--pc); }
.ps-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; } .ps-week > div { border: 1px solid #E5E2D8; border-radius: 4px; padding: 4px; min-height: 40mm; }
.ps-week h3 { font-size: 12px; margin: 0 0 4px; border-bottom: 2px solid var(--pc); } .ps-week p { margin: 0 0 4px; font-size: 10px; line-height: 1.25; }

/* stable map */
.ps-map { position: relative; width: 100%; border: 1.5px solid #12201A; border-radius: 4px; background: #FAF8F3; margin: 6px 0; }
.ps-mc { position: absolute; box-sizing: border-box; padding: 2px 3px; font-size: 8px; overflow: hidden; border: 1px solid #C9C4B6; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-mc.k-box { border: 1.3px solid #12201A; border-radius: 3mm 3mm 1mm 1mm; background: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.ps-mc.k-box small { font: 500 7px 'IBM Plex Mono', monospace; color: #6E766C; } .ps-mc.k-box b { font: 700 9px 'Rajdhani', sans-serif; line-height: 1; }
.ps-mc.k-box:not(:has(b:not(:empty))) { border-style: dashed; }
.ps-mc.s-turned_out { background: #DCEBD8; } .ps-mc.s-vet_watch, .ps-mc.s-box_rest, .ps-mc.s-rehab { background: #FFF3D1; border-color: #E5B83B; } .ps-mc.s-isolation { background: #F8DED6; }
.ps-mc.k-aisle, .ps-mc.k-courtyard { background: #EDE4CF; border: none; display: grid; place-items: center; color: #7A6A45; font-weight: 700; }
.ps-mc.k-wash { background: #D6E6EE; } .ps-mc.k-tack, .ps-mc.k-feed, .ps-mc.k-office { background: #E7E3F0; display: grid; place-items: center; font-weight: 700; }
.ps-mc.k-door { background: #E3915E; border: none; } .ps-mc.k-wall { background: #8E8A7E; border: none; }

/* door cards */
.ps-door { height: 100%; box-sizing: border-box; padding: 8mm 10mm; display: grid; grid-template-columns: 58mm 1fr; gap: 8mm; border-bottom: 1px dashed #C9C4B6; }
.ps-door-arch { background: var(--pi); color: var(--pc); border-radius: 26mm 26mm 4mm 4mm; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 12mm 4mm 5mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-door-arch > span { font: 700 34px 'IBM Plex Mono', monospace; } .ps-door-arch svg { border-radius: 2mm; background: #fff; padding: 1.5mm; }
.ps-door-body { display: flex; flex-direction: column; gap: 2mm; min-width: 0; } .ps-door-body h2 { font: 700 40px 'Rajdhani', sans-serif; margin: 0; line-height: 1; letter-spacing: .02em; color: var(--pi); }
.ps-sheet[lang="ar"] .ps-door-body h2 { font-family: 'Noto Kufi Arabic', 'Rajdhani', sans-serif; font-size: 30px; }
.ps-door-body p { margin: 0; font-size: 12px; } .ps-door-foot { margin-top: auto; font: 500 8px 'IBM Plex Mono', monospace; color: #6E766C; }

/* labels */
.ps-label { height: 100%; box-sizing: border-box; padding: 2mm 2.5mm; display: flex; gap: 2mm; align-items: center; }
.ps-label svg { flex: none; } .ps-label > div { min-width: 0; display: flex; flex-direction: column; }
.ps-label b { font: 700 13px 'Rajdhani', sans-serif; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ps-label small { font-size: 8.5px; color: #3E4A42; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ID / member / package cards */
.ps-idcard { height: 100%; box-sizing: border-box; border: 1px solid #12201A; border-radius: 3mm; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.ps-idcard-top { display: flex; justify-content: space-between; align-items: center; background: var(--pi); color: #F3EFE6; padding: 1.5mm 3mm; font-size: 9px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-idcard-top span { font: 700 8px 'IBM Plex Mono', monospace; letter-spacing: .14em; color: var(--pc); }
.ps-idcard-body { flex: 1; display: flex; gap: 2.5mm; padding: 2.5mm 3mm; align-items: center; min-width: 0; } .ps-idcard-body > div:nth-child(2) { flex: 1; min-width: 0; }
.ps-idcard.member .ps-idcard-body > div:first-child { flex: 1; }
.ps-idcard h3 { font: 700 15px 'Rajdhani', sans-serif; margin: 0; line-height: 1.05; } .ps-idcard small { font-size: 8.5px; color: #3E4A42; }
.ps-idcard dl { display: grid; grid-template-columns: auto 1fr; gap: 0 2mm; margin: 1.5mm 0 0; font-size: 8px; } .ps-idcard dt { color: #6E766C; font: 600 6.5px 'IBM Plex Mono', monospace; text-transform: uppercase; align-self: center; } .ps-idcard dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-idcard-photo { width: 18mm; height: 22mm; border-radius: 6mm 6mm 1.5mm 1.5mm; background: #EDE4CF; overflow: hidden; display: grid; place-items: center; flex: none; } .ps-idcard-photo img { width: 100%; height: 100%; object-fit: cover; } .ps-idcard-photo span { font: 700 22px 'Rajdhani', sans-serif; color: #7A6A45; }
.ps-pack { padding: 2mm 3mm; display: flex; flex-direction: column; gap: 1.5mm; } .ps-punch { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1mm; }
.ps-punch span { border: 1px solid #12201A; border-radius: 2mm 2mm 0.5mm 0.5mm; height: 5mm; display: grid; place-items: center; font: 600 7px 'IBM Plex Mono', monospace; }
.ps-punch span.used { background: var(--pc); -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* responsive station */
@media (max-width: 1100px) { .ps-body { grid-template-columns: 1fr; } .ps-opts { position: static; max-height: none; } }
@media (max-width: 760px) { .ps-layout { grid-template-columns: 1fr; } .ps-cat { position: static; max-height: 260px; } .ps-actions { width: 100%; } .ps-actions .btn { flex: 1; justify-content: center; } .ps-cols, .ps-fields { grid-template-columns: 1fr; } }

/* ---------------- printing: only the sheet */
#ps-print-root { display: none; }
@media print {
  html.ps-printing body > *:not(#ps-print-root) { display: none !important; }
  html.ps-printing, html.ps-printing body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  html.ps-printing #ps-print-root { display: block !important; width: auto !important; min-height: 0 !important; padding: 0 !important; box-shadow: none !important; background: #fff !important; transform: none !important; }
  html.ps-printing #ps-print-root.is-grid { display: block !important; }
  html.ps-printing #ps-print-root .ps-page { box-shadow: none; margin: 0; }
  html.ps-printing #ps-print-root .ps-cell { outline: none; }
  html.ps-printing #ps-print-root .ps-break + .ps-break { border-top: none; padding-top: 0; margin-top: 0; }
}
