/* بوابة العملاء — فوق app.css */
.p-body { background: #F3F6F6; min-height: 100vh; }
.p-head { background: #fff; border-bottom: 1px solid #D5E0E3; }
.p-head-in, .p-main { max-width: 1240px; margin: 0 auto; padding-inline: 28px; }
.p-head-in { padding-block: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.p-brand { display: flex; align-items: center; gap: 12px; }
.p-brand .logo { width: 40px; height: 40px; font-size: 20px; }
.p-brand b { font: 700 15px Alexandria, sans-serif; display: block; }
.p-brand span.t { font-size: 12px; color: var(--muted); }
.p-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: relative; }
.p-tools label { font-size: 13px; color: var(--muted2); }
.p-tools .inp { width: auto; min-width: 240px; max-width: 360px; }
.p-who { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 12px; border: 1px solid #E3EAEC; background: #fff; cursor: pointer; text-align: start; }
.p-who .av { width: 34px; height: 34px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; flex: none; }
.p-who b { display: block; font-size: 13px; }
.p-who span.s { font-size: 11.5px; color: var(--muted); }
.p-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: flex; flex-direction: column; }
.p-menu button { text-align: start; border: 0; background: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.p-menu button:hover { background: var(--head); }
.p-main { padding-block: 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.p-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.p-title h1 { font-size: 26px; font-weight: 800; margin-top: 2px; }
.p-title .sub { font-size: 13px; color: var(--muted); }
.p-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.p-tabs button { padding: 12px 16px; border: 0; border-bottom: 2px solid transparent; background: none; font-weight: 600; color: var(--muted2); cursor: pointer; white-space: nowrap; min-height: 44px; }
.p-tabs button.on { color: var(--teal); border-bottom-color: var(--teal); }
.p-tabs .cnt { margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-d); font-size: 11px; }
.p-kpi { box-shadow: inset 4px 0 0 var(--teal); }
.p-kpi.o { box-shadow: inset 4px 0 0 var(--orange); }
.p-kpi.g { box-shadow: inset 4px 0 0 #9DB0B5; }
.p-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.p-split > .wide { flex: 999 1 520px; min-width: 0; }
.p-split > .narrow { flex: 1 1 320px; min-width: 0; }
.p-bar { height: 12px; border-radius: 999px; background: #E6EDEF; overflow: hidden; display: flex; }
.p-bar span { display: block; height: 100%; }
.p-bar .paid { background: var(--teal); }
.p-bar .open { background: var(--orange); }
.p-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted2); flex-wrap: wrap; }
.p-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.p-list-item { padding: 12px 18px; border-bottom: 1px solid #EEF3F4; display: flex; justify-content: space-between; gap: 10px; }
.p-list-item:last-child { border-bottom: 0; }
.p-list-item b { display: block; font-size: 13.5px; }
.p-req { width: 100%; text-align: start; border: 0; background: #fff; padding: 14px 18px; border-bottom: 1px solid #EEF3F4; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.p-req:hover { background: #F8FBFB; }
.p-req.unread { box-shadow: inset -3px 0 0 var(--orange); }
.p-req .top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.p-thread { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.p-msg { max-width: 86%; padding: 12px 14px; border-radius: 12px; background: var(--head); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 6px; }
.p-msg.staff { align-self: flex-end; background: var(--teal-soft); border-color: #CFE3E5; }
.p-msg .who { font-size: 12px; color: var(--muted); }
.p-msg .who b { color: var(--ink); }
.p-msg .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.p-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--teal); font-weight: 600; font-size: 12.5px; cursor: pointer; align-self: flex-start; min-height: 36px; }
.p-file svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.p-preview { background: var(--blue-soft); color: var(--blue); font-weight: 600; font-size: 13px; text-align: center; padding: 8px 16px; }
.p-foot { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.p-pm { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.p-pm .av { width: 40px; height: 40px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-weight: 700; flex: none; }
@media (max-width: 720px) {
  .p-head-in, .p-main { padding-inline: 16px; }
  .p-tools { width: 100%; }
  .p-tools .inp { min-width: 0; flex: 1 1 160px; }
  .p-tools label { display: none; }
  .p-title h1 { font-size: 21px; }
  .p-msg { max-width: 100%; }
}
@media print {
  .p-head, .p-tabs, .no-print, .p-foot, .p-preview { display: none !important; }
  .p-body, body { background: #fff; }
  .p-main { padding: 0; }
  .card { border: 0; }
}

/* الإنجاز وأوامر التغيير */
.p-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.p-photos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.p-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #F4F7F8; }
.sig-pad { width: 100%; max-width: 600px; height: 180px; border: 1px dashed var(--muted2); border-radius: 10px; background: #fff; touch-action: none; }
