/* خط Noto Kufi Arabic محلي (رخصة OFL في kufi-OFL.txt)، بدون أي طلب لخوادم خارجية */
@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('kufi-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('kufi-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('kufi-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
:root {
  --rose: #b84c72;
  --roseD: #96395a;
  --wine: #6e2a43;
  --pink: #e9a0b7;
  --blush: #f6d5df;
  --mist: #fbebf0;
  --veil: #fdf6f8;
  --ink: #1d1d1f;
  --mute: #6e6e73;
  --line: #efe6ea;
  --bg: #f9f4f6;
  --card: #fff;
  --ok: #1e7a4c;
  --okb: #e2f4ea;
  --warn: #8a5300;
  --warnb: #fff1da;
  --bad: #c3293b;
  --badb: #fdeaec;
  --info: #96395a;
  --infob: #fbebf0;
  --sh: 0 1px 2px #6e2a4308, 0 8px 28px #6e2a430d;
  --sh2: 0 18px 50px #6e2a4326;
  --f: 'Noto Kufi Arabic', system-ui, 'Segoe UI', sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  font: 400 15px/1.6 var(--f);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 88% -8%, #f9d6e1 0, #f9d6e100 62%),
    radial-gradient(900px 560px at 8% 4%, #fbe6ed 0, #fbe6ed00 60%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1 {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 14px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2.5px solid var(--roseD);
  outline-offset: 2px;
}
.shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}
aside {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  margin: 14px;
  padding: 18px 12px;
  border-radius: 28px;
  background: #fffcfdb8;
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid #ffffffcc;
  box-shadow: var(--sh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #d9c4cd transparent;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px 16px;
  font-weight: 700;
  font-size: 1.3rem;
}
.brand img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
aside a {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 14px;
  min-height: 44px;
  transition:
    background 0.18s,
    transform 0.18s;
}
aside a:hover {
  background: #f6d5df66;
}
aside a:active {
  transform: scale(0.98);
}
aside a[aria-current] {
  background: linear-gradient(180deg, #b84c72, #96395a);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 22px #b84c7247;
}
aside a svg {
  width: 21px;
  height: 21px;
  flex: none;
  stroke: var(--rose);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
aside a[aria-current] svg {
  stroke: #fff;
}
aside a span:nth-child(2) {
  flex: 1;
}
.n {
  background: var(--rose);
  color: #fff;
  border-radius: 99px;
  min-width: 23px;
  text-align: center;
  padding: 0 7px;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 23px;
}
a[aria-current] .n {
  background: #fff;
  color: var(--roseD);
}
.n.u {
  background: var(--bad);
  color: #fff;
}
aside .me {
  margin-top: auto;
  padding: 16px 10px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
aside .me span {
  flex: 1;
  line-height: 1.4;
}
aside .me br:last-of-type {
  display: none;
}
main {
  padding: 34px 38px 70px 30px;
  min-width: 0;
  max-width: 1380px;
  animation: in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.head h1 {
  margin-inline-end: auto;
}
.panel {
  background: var(--card);
  border-radius: 28px;
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--sh);
}
.panel.flush {
  padding: 6px 0;
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th,
td {
  padding: 15px 22px;
  text-align: start;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
thead th {
  font-weight: 500;
  color: var(--mute);
  font-size: 0.88rem;
  white-space: nowrap;
}
tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}
tbody tr.click {
  cursor: pointer;
  transition: background 0.16s;
}
tbody tr.click:hover {
  background: var(--veil);
}
.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}
.tag {
  display: inline-block;
  padding: 3px 13px;
  border-radius: 99px;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  background: #f1ecee;
}
.ok {
  background: var(--okb);
  color: var(--ok);
}
.warn {
  background: var(--warnb);
  color: var(--warn);
}
.bad {
  background: var(--badb);
  color: var(--bad);
}
.info {
  background: var(--infob);
  color: var(--info);
}
.btn {
  background: linear-gradient(180deg, #b84c72, #96395a);
  color: #fff;
  border: 0;
  border-radius: 99px;
  min-height: 46px;
  padding: 0 24px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px #b84c723d;
  transition:
    transform 0.16s,
    filter 0.16s;
}
.btn:hover {
  filter: brightness(1.06);
}
.btn:active {
  transform: scale(0.97);
}
.btn.sec {
  background: var(--mist);
  color: var(--roseD);
  box-shadow: none;
}
.btn.sec:hover {
  background: var(--blush);
  filter: none;
}
.btn.red {
  background: var(--bad);
  box-shadow: 0 8px 22px #c3293b33;
}
.btn.sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.92rem;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
aside .btn {
  background: var(--mist);
  color: var(--roseD);
  box-shadow: none;
}
label {
  display: block;
  font-weight: 500;
  margin-bottom: 16px;
}
label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--mute);
  font-size: 0.92rem;
}
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1.5px solid #a99aa1;
  border-radius: 16px;
  background: #fff;
  transition:
    border-color 0.16s,
    box-shadow 0.16s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px #b84c7224 !important;
  outline: 0;
}
textarea {
  min-height: 100px;
}
input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  min-height: 32px;
  height: 32px;
  border-radius: 99px;
  margin: 0;
  padding: 0;
  border: 0;
  background: #8f8389;
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.22s;
}
input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px #0003;
  transition: inset-inline-start 0.22s cubic-bezier(0.3, 1.4, 0.6, 1);
}
input[type='checkbox']:checked {
  background: var(--rose);
}
input[type='checkbox']:checked::after {
  inset-inline-start: 23px;
}
label.chk {
  display: flex;
  gap: 14px;
  align-items: center;
}
label.chk span {
  margin: 0;
  order: 2;
  color: var(--ink);
  font-size: 1rem;
}
.head input,
.head select {
  width: auto;
  min-width: 180px;
  border-radius: 99px;
  border-color: transparent;
  box-shadow: var(--sh);
}
.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}
.banner {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: 34px;
  min-height: 230px;
  background: linear-gradient(130deg, #fde6ed, #f4bccd 55%, #e38fab);
  box-shadow: var(--sh2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.banner h1 {
  font-size: 2.3rem;
  max-width: 60%;
}
.banner p {
  margin: 0;
  color: var(--wine);
  font-size: 1.05rem;
  max-width: 56%;
}
.banner img {
  position: absolute;
  inset-inline-end: -14px;
  bottom: -40px;
  width: 290px;
  animation: fl 5s ease-in-out infinite alternate;
}
.banner img + img {
  width: 120px;
  inset-inline-end: 250px;
  bottom: auto;
  top: 14px;
  animation-delay: -2s;
}
@keyframes fl {
  from {
    transform: translateY(6px) rotate(-1.5deg);
  }
  to {
    transform: translateY(-8px) rotate(2deg);
  }
}
.money {
  border-radius: 34px;
  padding: 34px;
  color: #fff;
  background: linear-gradient(140deg, #b84c72, #96395a 50%, #6e2a43);
  box-shadow: 0 18px 50px #b84c7255;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.money b {
  font-size: 2.9rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.money span {
  color: #fff;
}
.money img {
  position: absolute;
  width: 150px;
  inset-inline-end: -10px;
  top: -16px;
  animation: fl 6s ease-in-out infinite alternate;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.kpis.six {
  grid-template-columns: repeat(3, 1fr);
}
.kpis div {
  background: #fff;
  border-radius: 28px;
  padding: 22px 24px;
  box-shadow: var(--sh);
}
.kpis b {
  display: block;
  font-size: 2.1rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.kpis span {
  color: var(--mute);
}
.two {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
  align-items: start;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.todo a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s;
}
.todo a:hover {
  transform: translateX(-4px);
}
.todo a:last-child {
  border: 0;
}
.todo a img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.todo a span {
  flex: 1;
}
.todo a b {
  min-width: 34px;
  height: 34px;
  border-radius: 99px;
  background: #f3edf0;
  display: grid;
  place-items: center;
  padding: 0 10px;
}
.todo a.on b {
  background: var(--rose);
  color: #fff;
}
dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 11px 24px;
  margin: 0;
}
dt {
  color: var(--mute);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}
dialog {
  border: 0;
  border-radius: 34px;
  padding: 32px;
  width: min(680px, 94vw);
  max-height: 90vh;
  color: inherit;
  background: #fffdfef2;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  box-shadow: 0 30px 90px #6e2a4359;
}
dialog[open] {
  animation: pop 0.32s cubic-bezier(0.2, 1.2, 0.3, 1);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
}
dialog::backdrop {
  background: #3a1a2859;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
dialog h2 {
  font-size: 1.4rem;
}
.acts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
#toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translate(-50%, -20px);
  background: #1d1d1fe6;
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 13px 26px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.22s,
    transform 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
  z-index: 50;
  max-width: 86vw;
  font-weight: 500;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.err {
  background: #c3293bf2;
}
.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(150deg, #fde6ed, #f4bccd 60%, #e796b0);
}
.login form {
  background: #fffcfdcc;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid #fff;
  border-radius: 38px;
  padding: 36px;
  width: min(430px, 100%);
  box-shadow: 0 30px 90px #6e2a4333;
  text-align: center;
}
.login label {
  text-align: start;
}
.login .mk img {
  width: 150px;
  animation: fl 5s ease-in-out infinite alternate;
}
.empty {
  padding: 50px;
  text-align: center;
  color: var(--mute);
  font-size: 1.05rem;
}
.ids {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}
.ids img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: var(--veil);
  border-radius: 22px;
}
.tl {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl li {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.tl time {
  color: var(--mute);
  font-size: 0.88rem;
  white-space: nowrap;
}
svg.bars {
  width: 100%;
  height: 230px;
  display: block;
  overflow: visible;
}
svg.bars text {
  font-size: 12px;
  fill: var(--mute);
  font-family: inherit;
}
svg.bars g.pt circle {
  opacity: 0;
  transition: opacity 0.16s;
}
svg.bars g.pt:hover circle {
  opacity: 1;
}
.urgent {
  box-shadow:
    inset 4px 0 0 var(--bad),
    var(--sh);
}
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.thumbs img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 22px;
  background: var(--mist);
  display: block;
  transition: transform 0.2s;
}
.thumbs img:hover {
  transform: scale(1.05);
}
.cal th {
  width: 92px;
  vertical-align: top;
  color: var(--mute);
  font-weight: 500;
}
.cal td {
  padding: 9px 18px;
}
.slot {
  display: inline-block;
  text-align: start;
  background: linear-gradient(135deg, #fdeef3, #f8d7e1);
  border: 0;
  border-radius: 20px;
  padding: 13px 18px;
  margin: 4px;
  cursor: pointer;
  min-width: 250px;
  transition:
    transform 0.16s,
    box-shadow 0.16s;
}
.slot:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh2);
}
.hb {
  display: grid;
  grid-template-columns: 130px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
}
.hb i {
  display: block;
  background: #f5ebef;
  border-radius: 99px;
  height: 16px;
  overflow: hidden;
}
.hb u {
  display: block;
  background: linear-gradient(90deg, #b84c72, #e9a0b7);
  height: 16px;
  border-radius: 99px;
}
.hb small {
  color: var(--mute);
}
.two.even {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  aside {
    position: sticky;
    top: 0;
    height: auto;
    margin: 0;
    border-radius: 0 0 26px 26px;
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    padding: 10px;
    gap: 4px;
    z-index: 4;
  }
  aside a {
    white-space: nowrap;
    gap: 8px;
  }
  .brand {
    padding: 0 6px;
  }
  .brand span {
    display: none;
  }
  .brand img {
    width: 38px;
    height: 38px;
  }
  aside .me {
    margin: 0;
    padding: 0 8px;
    white-space: nowrap;
  }
  aside .me span {
    display: none;
  }
  main {
    padding: 22px 16px 60px;
  }
  .two,
  .grid2,
  .two.even {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpis,
  .kpis.six {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .kpis div {
    padding: 16px;
  }
  .kpis b {
    font-size: 1.5rem;
  }
  .banner {
    padding: 24px;
  }
  .banner h1 {
    font-size: 1.7rem;
  }
  .banner img {
    width: 200px;
  }
  .banner img + img {
    display: none;
  }
  .hb {
    grid-template-columns: 90px 1fr auto;
  }
  .hb small {
    display: none;
  }
  .slot {
    min-width: 0;
    width: 100%;
  }
  h1 {
    font-size: 1.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

.integ {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 26px;
  align-items: center;
}
.integ img {
  width: 110px;
}
code {
  background: #f7edf1;
  border-radius: 8px;
  padding: 2px 9px;
  font-size: 0.9em;
}
@media (max-width: 900px) {
  .integ {
    grid-template-columns: 1fr;
  }
  .integ img {
    width: 80px;
  }
}

.login.wide form {
  max-width: 480px;
}
.login p {
  color: var(--mute);
  margin: 0 0 14px;
}
.qr {
  display: flex;
  justify-content: center;
  margin: 6px 0 14px;
}
.qr svg {
  border-radius: 18px;
  width: 220px;
  height: 220px;
}
.codes {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}
.codes li {
  background: #fbf1f4;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 14px;
}
.err {
  color: #b3261e;
  min-height: 1.4em;
  margin: 6px 0;
}
.pager {
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}

/* تحميل الصفحة */
main[aria-busy='true'] {
  opacity: 0.55;
  transition: opacity 0.2s 0.15s;
}
.fail {
  max-width: 460px;
  margin: 18vh auto;
  text-align: center;
  display: grid;
  gap: 16px;
  padding: 0 16px;
}
/* الجداول على الجوال: كل صف بطاقة، واسم العمود جنب قيمته، والأزرار ظاهرة بدون سحب أفقي */
@media (max-width: 600px) {
  .flush table:not(.cal),
  .flush table:not(.cal) tbody,
  .flush table:not(.cal) tr,
  .flush table:not(.cal) td {
    display: block;
  }
  .flush table:not(.cal) thead {
    display: none;
  }
  .flush table:not(.cal) tr {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
  }
  .flush table:not(.cal) tbody tr:last-child {
    border-bottom: 0;
  }
  .flush table:not(.cal) td {
    border: 0;
    padding: 4px 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }
  .flush table:not(.cal) td[data-l]::before {
    content: attr(data-l);
    color: var(--mute);
    font-size: 0.85rem;
  }
  .flush table:not(.cal) td:empty {
    display: none;
  }
  .flush table:not(.cal) td:not([data-l]) {
    justify-content: flex-start;
    padding-top: 10px;
  }
}
@media print {
  aside,
  #toast,
  .head input,
  .head select,
  .pager,
  .btn {
    display: none !important;
  }
  .shell {
    display: block;
  }
  body,
  html {
    background: #fff;
  }
  .card,
  .panel {
    box-shadow: none !important;
    break-inside: avoid;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
