/* Hammelk Report Design System v27
   Shared, print-safe report viewer inspired by the Auto Gallery report system. */
:root{
  --hmr-ink:#10263f;
  --hmr-muted:#6b7c90;
  --hmr-primary:#245fc7;
  --hmr-primary-dark:#163f82;
  --hmr-accent:#0f766e;
  --hmr-line:#cfd9e6;
  --hmr-line-strong:#9fb0c4;
  --hmr-soft:#f3f7fb;
  --hmr-paper:#fff;
  --hmr-viewer:#eaf0f6;
  --hmr-shadow:0 18px 48px rgba(15,35,62,.16);
  --hmr-radius:14px;
  --hmr-zoom:1;
}

/* viewer + toolbar */
.hmr-viewer{width:100%;margin:0;direction:rtl}
.hmr-toolbar{position:sticky;top:8px;z-index:70;display:flex;align-items:center;gap:8px;flex-wrap:wrap;width:min(100%,297mm);margin:0 auto 12px;padding:9px;border:1px solid #d6e0eb;border-radius:14px;background:rgba(255,255,255,.97);box-shadow:0 8px 24px rgba(15,35,62,.10);backdrop-filter:blur(10px)}
.hmr-toolbar-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.hmr-toolbar-spacer{flex:1}
.hmr-tool{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 12px;border:1px solid #d5dfeb;border-radius:10px;background:#fff;color:var(--hmr-primary-dark);font:inherit;font-weight:850;text-decoration:none;cursor:pointer;white-space:nowrap}
.hmr-tool:hover{border-color:#9fb7d5;background:#f7fbff;color:#0f376f}
.hmr-tool.primary{background:var(--hmr-primary);border-color:var(--hmr-primary);color:#fff;box-shadow:0 6px 16px rgba(36,95,199,.18)}
.hmr-tool.compact{min-width:38px;padding-inline:8px;font-size:18px}
.hmr-zoom-label{min-width:50px;text-align:center;color:var(--hmr-muted);font-size:11px;font-weight:900}
.hmr-stage{display:flex;justify-content:center;align-items:flex-start;width:100%;padding:18px;border:1px solid #dde5ee;border-radius:18px;background:var(--hmr-viewer);overflow:auto}
.hmr-paper{position:relative;box-sizing:border-box;width:210mm;min-height:297mm;margin:0 auto;padding:11mm;background:var(--hmr-paper);color:var(--hmr-ink);box-shadow:var(--hmr-shadow);font-family:var(--app-font-family,Vazirmatn,Tahoma,Arial,sans-serif);font-size:11.5px;line-height:1.65;zoom:var(--hmr-zoom)}
.hmr-paper[data-orientation="landscape"]{width:297mm;min-height:210mm;padding:8.5mm;page:hmr-landscape}
.hmr-paper[data-orientation="portrait"]{page:hmr-portrait}

/* shared report identity */
.hmr-report-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:9px 11px;margin-bottom:9px;border:1.5px solid var(--hmr-primary-dark);border-radius:12px;break-inside:avoid;background:#fff}
.hmr-report-heading{display:flex;align-items:center;gap:10px;min-width:0}
.hmr-report-mark{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;border-radius:11px;background:linear-gradient(145deg,#eef4ff,#e3edf9);border:1px solid #c6d7ec;color:var(--hmr-primary-dark);font-size:19px;font-weight:950}
.hmr-report-brand{margin-bottom:2px;color:var(--hmr-accent);font-size:9px;font-weight:950}
.hmr-report-title{margin:0;color:var(--hmr-primary-dark);font-size:18px;line-height:1.35;font-weight:950}
.hmr-report-subtitle{margin:4px 0 0;color:var(--hmr-muted);font-size:9.5px;line-height:1.7}
.hmr-report-meta{display:grid;gap:4px;min-width:190px}
.hmr-report-meta>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:3px 0;border-bottom:1px dashed #e1e7ef;font-size:9px}
.hmr-report-meta>div:last-child{border-bottom:0}
.hmr-report-meta span{color:var(--hmr-muted)}
.hmr-report-meta b{color:var(--hmr-ink);font-weight:900;text-align:left}

.hmr-report-section{margin-top:10px;break-inside:auto}
.hmr-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:0 0 6px;break-after:avoid}
.hmr-section-head h2{margin:0;color:var(--hmr-primary-dark);font-size:12.5px;font-weight:950}
.hmr-section-head p{margin:2px 0 0;color:var(--hmr-muted);font-size:8.8px}
.hmr-section-head .hmr-count{color:var(--hmr-muted);font-size:8.5px;font-weight:850;white-space:nowrap}

.hmr-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:8px 0 10px;break-inside:avoid}
.hmr-summary>article{padding:7px 8px;border:1px solid var(--hmr-line);border-radius:9px;background:#fff;text-align:center}
.hmr-summary span,.hmr-summary small{display:block;color:var(--hmr-muted);font-size:8.2px}
.hmr-summary strong{display:block;margin:2px 0;color:var(--hmr-primary-dark);font-size:14px;font-weight:950}
.hmr-summary small{font-size:7.5px}

.hmr-table-wrap{width:100%;overflow:visible}
.hmr-table{width:100%;border-collapse:collapse;table-layout:fixed;font-variant-numeric:tabular-nums}
.hmr-table th,.hmr-table td{border:1px solid var(--hmr-line-strong);padding:5px 5px;text-align:right;vertical-align:middle;overflow-wrap:anywhere}
.hmr-table th{background:#eaf0f7;color:#173d6d;font-size:9px;font-weight:950;text-align:center}
.hmr-table td{font-size:9px;background:#fff}
.hmr-table tbody tr:nth-child(even) td{background:#f9fbfd}
.hmr-table .center{text-align:center}
.hmr-table .nowrap{white-space:nowrap;overflow-wrap:normal}
.hmr-table .money{direction:ltr;text-align:center;white-space:nowrap;font-weight:850}
.hmr-table .muted-cell{color:var(--hmr-muted)}
.hmr-table thead{display:table-header-group}
.hmr-table tfoot{display:table-footer-group}
.hmr-table tr{break-inside:avoid;page-break-inside:avoid}
.hmr-empty{padding:18px 12px;text-align:center;color:var(--hmr-muted);border:1px dashed var(--hmr-line);border-radius:10px;background:#fafcff}

.hmr-status{display:inline-flex;align-items:center;justify-content:center;padding:3px 7px;border-radius:999px;background:#eef3f8;color:#486078;font-size:8px;font-weight:900;white-space:nowrap}
.hmr-status.active{background:#e8f7ef;color:#14734a}.hmr-status.used{background:#e8f0ff;color:#2757a5}.hmr-status.changed{background:#fff7df;color:#8a6500}.hmr-status.cancelled{background:#fff0f0;color:#a83434}

/* report-specific reusable blocks */
.hmr-season-paper{display:flex;flex-direction:column}
.hmr-season-paper .hmr-report-head{margin-bottom:7px}
.hmr-season-table col.col-row{width:5%}
.hmr-season-table col.col-date{width:22%}
.hmr-season-table col.col-nights{width:8%}
.hmr-season-table col.col-suite{width:18%}
.hmr-season-table col.col-owner{width:29%}
.hmr-season-table th,.hmr-season-table td{padding:6px 5px;text-align:center;font-size:9.4px;line-height:1.45}
.hmr-season-table th{font-size:9px}
.hmr-season-table td.date-cell{direction:rtl;white-space:nowrap;font-weight:800;color:#233f61}
.hmr-season-table td.owner-cell{font-weight:850;color:#173d6d}
.hmr-season-paper.hmr-density-compact .hmr-season-table th,.hmr-season-paper.hmr-density-compact .hmr-season-table td{padding:4px 4px;font-size:8.5px;line-height:1.3}
.hmr-season-paper.hmr-density-tight .hmr-season-table th,.hmr-season-paper.hmr-density-tight .hmr-season-table td{padding:3px 3px;font-size:7.8px;line-height:1.22}

.hmr-rights-season-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:7px 0 10px;break-inside:avoid}
.hmr-rights-season-grid>article{padding:6px 7px;border:1px solid var(--hmr-line);border-radius:8px;background:#fff}
.hmr-rights-season-grid span,.hmr-rights-season-grid b,.hmr-rights-season-grid small{display:block}
.hmr-rights-season-grid span{color:var(--hmr-primary-dark);font-weight:900;font-size:8.5px}.hmr-rights-season-grid b{margin:2px 0;font-size:8.5px}.hmr-rights-season-grid small{color:var(--hmr-muted);font-size:7.5px}
.hmr-rights-season-grid .used{background:#f4fbf7;border-color:#b9dcc8}.hmr-rights-season-grid .unused{background:#fffaf0;border-color:#ead8a9}

.hmr-lottery-table col.c-run{width:8%}.hmr-lottery-table col.c-period{width:12%}.hmr-lottery-table col.c-winner{width:14%}.hmr-lottery-table col.c-share{width:12%}.hmr-lottery-table col.c-date{width:17%}.hmr-lottery-table col.c-suite{width:10%}.hmr-lottery-table col.c-status{width:10%}.hmr-lottery-table col.c-change{width:17%}
.hmr-accounting-table col.c-date{width:12%}.hmr-accounting-table col.c-account{width:23%}.hmr-accounting-table col.c-type{width:10%}.hmr-accounting-table col.c-amount{width:14%}.hmr-accounting-table col.c-reference{width:14%}.hmr-accounting-table col.c-desc{width:27%}

.hmr-report-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;padding-top:6px;border-top:1px solid #dce4ed;color:var(--hmr-muted);font-size:7.8px;break-inside:avoid}
.hmr-season-paper .hmr-report-footer{margin-top:auto;padding-top:7px}

@page hmr-portrait{size:A4 portrait;margin:0}
@page hmr-landscape{size:A4 landscape;margin:0}

@media screen and (max-width:900px){
  .hmr-toolbar{top:4px;width:calc(100% - 12px);margin-inline:6px}.hmr-toolbar-spacer{display:none}
  .hmr-stage{justify-content:flex-start;padding:10px;border-radius:12px}
  .hmr-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (max-width:620px){
  .hmr-toolbar-group.hmr-toolbar-view{order:3;width:100%}.hmr-report-head{flex-direction:column}.hmr-report-meta{width:100%;min-width:0}
  .hmr-stage{padding:7px}.hmr-paper{zoom:var(--hmr-zoom)}
}

@media print{
  *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  html,body{margin:0!important;padding:0!important;background:#fff!important;width:auto!important;min-height:auto!important;overflow:visible!important}
  .sidebar,.sidebar-backdrop,.topbar,.site-announcement-bar,.mobile-dock,.toast-stack,.hmr-toolbar,.report-filter-bar,.report-tabs,.page-heading,.heading-actions,.accounting-chart-grid-v26,.lottery-run-summary-v26,.no-print{display:none!important}
  .app-shell,.workspace,.page-content,.hmr-viewer,.hmr-stage{display:block!important;width:auto!important;min-width:0!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;overflow:visible!important}
  .workspace{margin-right:0!important}
  .hmr-paper{zoom:1!important;transform:none!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;width:210mm!important;min-height:297mm!important;padding:10mm!important;font-size:10.5pt!important;line-height:1.5!important}
  .hmr-paper[data-orientation="landscape"]{width:297mm!important;min-height:210mm!important;padding:7.5mm!important}
  .hmr-report-head{padding:3.2mm 3.5mm!important;margin-bottom:2.5mm!important;border-radius:3mm!important}
  .hmr-report-title{font-size:13.2pt!important}.hmr-report-subtitle{font-size:7.5pt!important}.hmr-report-brand{font-size:7pt!important}.hmr-report-mark{width:10mm!important;height:10mm!important;flex-basis:10mm!important;font-size:12pt!important}
  .hmr-report-meta{min-width:48mm!important}.hmr-report-meta>div{font-size:6.8pt!important;padding:.6mm 0!important}
  .hmr-summary{gap:1.7mm!important;margin:2mm 0 2.5mm!important}.hmr-summary>article{padding:1.5mm!important;border-radius:2mm!important}.hmr-summary span{font-size:6.5pt!important}.hmr-summary strong{font-size:10pt!important}.hmr-summary small{font-size:6pt!important}
  .hmr-section-head{margin-bottom:1.7mm!important}.hmr-section-head h2{font-size:9pt!important}.hmr-section-head p,.hmr-section-head .hmr-count{font-size:6.6pt!important}
  .hmr-table th,.hmr-table td{padding:1.6mm 1.2mm!important;font-size:7.4pt!important;line-height:1.28!important}.hmr-table th{font-size:7pt!important}
  .hmr-season-table th,.hmr-season-table td{padding:2.15mm 1.3mm!important;font-size:8.2pt!important;line-height:1.3!important}.hmr-season-table th{font-size:7.6pt!important}
  .hmr-season-paper.hmr-density-compact .hmr-season-table th,.hmr-season-paper.hmr-density-compact .hmr-season-table td{padding:1.55mm 1.1mm!important;font-size:7.3pt!important}
  .hmr-season-paper.hmr-density-tight .hmr-season-table th,.hmr-season-paper.hmr-density-tight .hmr-season-table td{padding:1.05mm .9mm!important;font-size:6.6pt!important}
  .hmr-rights-season-grid{gap:1.5mm!important;margin:1.7mm 0 2.2mm!important}.hmr-rights-season-grid>article{padding:1.4mm!important;border-radius:2mm!important}.hmr-rights-season-grid span,.hmr-rights-season-grid b{font-size:6.7pt!important}.hmr-rights-season-grid small{font-size:6pt!important}
  .hmr-report-footer{margin-top:2.5mm!important;padding-top:1.7mm!important;font-size:6.2pt!important}
  .hmr-status{padding:.7mm 1.4mm!important;font-size:6.2pt!important}
  a{color:inherit!important;text-decoration:none!important}
}
