.rep-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.rep-title { font-size: 36px; line-height: 48px; font-weight: 700; margin: 0 0 4px; }
.seg { display: inline-flex; background: var(--color-surface-2); border-radius: 9999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { font-family: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--color-text-secondary); padding: 8px 18px; min-height: 40px; border-radius: 9999px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.seg button:hover { color: var(--color-primary); }
.seg button.on { background: #fff; color: var(--color-primary); box-shadow: var(--shadow-low), rgba(17,17,19,.08) 0 4px 12px -6px; }
.custom-range { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 32px; padding: 24px 32px; }
.custom-range .field { margin: 0; flex: 1; min-width: 160px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.kpi { background: #fff; border: 1px solid #eef0f3; border-radius: 24px; padding: 24px; box-shadow: var(--shadow-low); transition: transform .2s ease, box-shadow .2s ease; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-mid); }
.kpi small { display: block; color: var(--color-text-secondary); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.kpi b { display: block; font-size: 40px; line-height: 48px; font-weight: 800; color: var(--color-text); }
.kpi:first-child b { color: var(--color-primary); }
.kpi em { display: block; font-style: normal; font-size: 13px; color: var(--color-text-secondary); margin-top: 4px; min-height: 20px; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; align-items: end; height: 200px; direction: ltr; }
.hours .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.hours .bar { width: 100%; background: #e5defe; border-radius: 6px 6px 2px 2px; min-height: 2px; transition: background .15s ease, height .5s ease; }
.hours .col:hover .bar { background: var(--color-primary); }
.hours .col.peak .bar { background: var(--color-primary); }
.hours .lbl { font-size: 10px; color: var(--color-text-secondary); margin-top: 6px; height: 14px; }
.hours .tip { position: absolute; bottom: calc(100% + 4px); background: var(--color-text-body); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 8px; opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity .15s ease; direction: rtl; }
.hours .col:hover .tip { opacity: 1; }
.hours-wrap { overflow-x: auto; }
.daybars { display: flex; align-items: flex-end; gap: 6px; height: 200px; direction: ltr; overflow-x: auto; padding-bottom: 4px; }
.daybars .col { flex: 1; min-width: 14px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.daybars .bar { width: 100%; max-width: 44px; background: var(--color-primary); border-radius: 8px 8px 3px 3px; min-height: 2px; opacity: .85; transition: opacity .15s ease; }
.daybars .col:hover .bar { opacity: 1; }
.daybars .lbl { font-size: 10px; color: var(--color-text-secondary); margin-top: 6px; white-space: nowrap; }
.daybars .tip { position: absolute; bottom: calc(100% + 4px); background: var(--color-text-body); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 8px; opacity: 0; pointer-events: none; white-space: nowrap; direction: rtl; z-index: 2; }
.daybars .col:hover .tip { opacity: 1; }
.table-wrap { overflow-x: auto; max-height: 460px; overflow-y: auto; border-radius: 16px; border: 1px solid var(--color-border); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { position: sticky; top: 0; background: var(--color-surface-2); text-align: right; font-size: 13px; font-weight: 700; color: var(--color-text-secondary); padding: 12px 16px; }
.tbl td { padding: 14px 16px; border-top: 1px solid var(--color-border); }
.tbl tbody tr:hover { background: #faf8ff; }
.tbl td.num { font-weight: 700; }
.hist-ctl { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.hist-ctl .input { max-width: 220px; }
@media (max-width: 1023px) { .rep-grid { grid-template-columns: 1fr; } }
@media (max-width: 639px) {
  .rep-title { font-size: 28px; line-height: 40px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi { padding: 16px; border-radius: 20px; } .kpi b { font-size: 30px; line-height: 38px; }
  .seg { width: 100%; justify-content: space-between; } .seg button { padding: 8px 10px; flex: 1; }
  .hours { height: 160px; min-width: 520px; }
  .hist-ctl .input { max-width: none; flex: 1 1 100%; order: -1; }
  .hist-ctl .btn { flex: 1; }
  .custom-range { padding: 20px; }
}
@media (max-width: 639px) {
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 10px 8px; white-space: nowrap; }
  .tbl .pill { padding: 2px 10px; font-size: 12px; }
}

/* تجاوب الجوال: منع التمرير الأفقي للصفحة */
.rep-grid > *, .kpis > *, .rep-head > * { min-width: 0; }
.rep-grid .card { overflow: hidden; }
@media (max-width: 639px) {
  .hours { min-width: 0; gap: 2px; height: 150px; }
  .seg { display: grid; grid-template-columns: repeat(5, 1fr); border-radius: 20px; }
  .seg button { padding: 8px 2px; font-size: 13px; min-height: 40px; }
  .rep-head { margin-bottom: 20px; gap: 16px; }
  .rep-head > div:first-child, .seg { width: 100%; }
  .daybars { height: 170px; gap: 4px; }
  .daybars .col { min-width: 18px; }
  .card { padding: 20px 16px; }
  .tbl th, .tbl td { padding: 10px 6px; white-space: normal; text-align: right; }
  .tbl td:first-child { white-space: nowrap; }
  .table-wrap { max-height: 420px; }
  .hist-ctl .btn { padding-inline: 8px; font-size: 14px; }
}
