body {
  background-color: #f5f5f7;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* نظام الأيقونات (Apple SF-Symbols & iPhone App-Icon Squircle Badges) */
:where(.app-icon) {
  width: 1rem;
  height: 1rem;
  vertical-align: -0.125em;
}

.ios-squircle {
  border-radius: 26%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.36),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

.ios-badge-blue {
  background: linear-gradient(180deg, #2997ff 0%, #0071e3 100%);
  color: #ffffff;
}

.ios-badge-green {
  background: linear-gradient(180deg, #34c759 0%, #248a3d 100%);
  color: #ffffff;
}

.ios-badge-indigo {
  background: linear-gradient(180deg, #6e6ce8 0%, #4338ca 100%);
  color: #ffffff;
}

.ios-badge-amber {
  background: linear-gradient(180deg, #ff9f0a 0%, #d97706 100%);
  color: #ffffff;
}

.ios-badge-purple {
  background: linear-gradient(180deg, #bf5af2 0%, #8944ab 100%);
  color: #ffffff;
}

.ios-badge-teal {
  background: linear-gradient(180deg, #32ade6 0%, #0d9488 100%);
  color: #ffffff;
}

.ios-badge-rose {
  background: linear-gradient(180deg, #ff375f 0%, #d70015 100%);
  color: #ffffff;
}

.ios-badge-dark {
  background: linear-gradient(180deg, #3a3a3c 0%, #1d1d1f 100%);
  color: #ffffff;
}

.ios-badge-neutral {
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f7 100%);
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 6px rgba(0, 0, 0, 0.05);
}

/* تكبير الخطوط الصغيرة بشكل مدروس ومريح للقراءة على الهاتف والكمبيوتر دون الإخلال بالتنسيق */
.text-\[8px\],
.text-\[9px\] {
  font-size: 0.7rem; /* ~11.2px on mobile */
  line-height: 1.3;
}

.text-\[10px\] {
  font-size: 0.75rem; /* 12px on mobile */
  line-height: 1.35;
}

.text-\[11px\] {
  font-size: 0.8125rem; /* 13px on mobile */
  line-height: 1.4;
}

@media (min-width: 640px) {
  .text-\[8px\],
  .text-\[9px\] {
    font-size: 0.75rem; /* 12px on desktop */
  }
  .text-\[10px\] {
    font-size: 0.8125rem; /* 13px on desktop */
  }
  .text-\[11px\] {
    font-size: 0.86rem; /* 13.8px on desktop */
  }
}

@media (max-width: 639px) {
  #app {
    max-width: 100%;
  }
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

table th {
  background-color: #f5f5f7;
  color: #1d1d1f;
  font-weight: 800;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
  font-weight: 600;
}

/* تثبيت أصلي (Native GPU Sticky) لأسطر إجمالي الإجازات واليوم والتاريخ في تبويب الإجازات على الهاتف والكمبيوتر */
.leave-matrix-fixed-grid {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.leave-doc-col-width {
  width: 152px;
}

@media (min-width: 640px) {
  .leave-doc-col-width {
    width: 196px;
  }
}

.leave-matrix-sticky-header {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.leave-matrix-body-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.leave-matrix-sticky-header thead tr:first-child th:first-child {
  border-start-start-radius: 15px;
}

.leave-matrix-sticky-header thead tr:first-child th:last-child {
  border-start-end-radius: 15px;
}

.leave-matrix-sticky-header .sticky-doc-col,
.leave-matrix-body-scroll .sticky-doc-col {
  position: sticky;
  inset-inline-start: 0;
}

.leave-matrix-sticky-header .sticky-doc-col {
  z-index: 35;
}

.leave-matrix-body-scroll .sticky-doc-col {
  z-index: 15;
  background-color: #ffffff;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.04);
}

[dir="ltr"] .leave-matrix-body-scroll .sticky-doc-col {
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.04);
}

.leave-matrix-body-scroll tbody tr:hover .sticky-doc-col {
  background-color: #f7f7f9;
}

/* تثبيت رؤوس التواريخ والأيام والعمود الجانبي في جداول الإجازات والخفارات ولوحة رئيس الوحدة على الهاتف والكمبيوتر */
.sticky-table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.leave-matrix-table,
.roster-sticky-table,
.dashboard-sticky-table {
  border-collapse: separate;
  border-spacing: 0;
}

.leave-matrix-table thead tr:first-child th:first-child,
.dashboard-sticky-table thead tr:first-child th:first-child {
  border-start-start-radius: 15px;
}

.leave-matrix-table thead tr:first-child th:last-child,
.dashboard-sticky-table thead tr:first-child th:last-child {
  border-start-end-radius: 15px;
}

.roster-sticky-table thead tr:first-child th:first-child {
  border-start-start-radius: 27px;
}

.roster-sticky-table thead tr:first-child th:last-child {
  border-start-end-radius: 27px;
}

.sticky-table-scroll .sticky-doc-col {
  position: sticky;
  inset-inline-start: 0;
}

.sticky-table-scroll thead .sticky-doc-col {
  z-index: 35;
}

.sticky-table-scroll tbody .sticky-doc-col {
  z-index: 15;
  background-color: #ffffff;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.04);
}

[dir="ltr"] .sticky-table-scroll tbody .sticky-doc-col {
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.04);
}

.sticky-table-scroll tbody tr:hover .sticky-doc-col {
  background-color: #f7f7f9;
}

@media (max-width: 1023px) {
  .sticky-table-scroll thead th {
    position: relative;
    z-index: 25;
    transform: translate3d(0, var(--thead-y, 0px), 0);
    will-change: transform;
  }
  .sticky-table-scroll thead th.sticky-doc-col {
    position: sticky;
    inset-inline-start: 0;
    z-index: 35;
    transform: translate3d(0, var(--thead-y, 0px), 0);
    will-change: transform;
  }
  .sticky-table-scroll thead tr:last-child th,
  .sticky-table-scroll thead th[rowspan="2"] {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  }
}

@media (min-width: 1024px) {
  .sticky-table-scroll {
    overflow: visible;
    max-height: none;
  }
  .leave-matrix-table thead tr:nth-child(1) th {
    position: sticky;
    top: 9rem;
    z-index: 26;
  }
  .leave-matrix-table thead tr:nth-child(2) th {
    position: sticky;
    top: calc(9rem + var(--r1-h, 38px));
    z-index: 25;
  }
  .leave-matrix-table thead tr:nth-child(3) th {
    position: sticky;
    top: calc(9rem + var(--r1-h, 38px) + var(--r2-h, 52px));
    z-index: 24;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  }
  .roster-sticky-table thead tr:nth-child(1) th {
    position: sticky;
    top: 9rem;
    z-index: 26;
  }
  .roster-sticky-table thead tr:nth-child(1) th[rowspan="2"] {
    z-index: 35;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  }
  .roster-sticky-table thead tr:nth-child(2) th {
    position: sticky;
    top: calc(9rem + var(--r1-h, 44px));
    z-index: 25;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  }
  .dashboard-sticky-table thead th {
    position: sticky;
    top: 9rem;
    z-index: 25;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  }
  .sticky-table-scroll thead .sticky-doc-col {
    z-index: 35;
  }
  .sticky-table-scroll tbody .sticky-doc-col {
    box-shadow: none;
  }
}

.print-title {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 5mm 10mm;
  }
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 8pt !important;
    line-height: 1.1 !important;
  }
  header,
  nav,
  button,
  .no-print {
    display: none !important;
  }
  main {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .shadow-apple,
  .shadow-apple-hover {
    box-shadow: none !important;
    border: none !important;
  }
  .overflow-x-auto,
  .sticky-table-scroll,
  .leave-matrix-sticky-header,
  .leave-matrix-body-scroll {
    overflow: visible !important;
    max-height: none !important;
  }
  .leave-matrix-sticky-header,
  .leave-matrix-sticky-header .sticky-doc-col,
  .leave-matrix-body-scroll .sticky-doc-col,
  .sticky-table-scroll thead,
  .sticky-table-scroll thead th,
  .sticky-table-scroll .sticky-doc-col {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
  }
  table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    font-size: 7.8pt !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }
  th,
  td {
    border: 1px solid #000000 !important;
    padding: 2px 2px !important;
    height: 7.8mm !important;
    line-height: 1.15 !important;
    color: #000 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  th {
    background-color: #f1f5f9 !important;
    padding: 3px 2px !important;
    height: 8.5mm !important;
  }
  td div,
  th div,
  td span,
  th span {
    font-size: 7.8pt !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .print-title {
    display: block !important;
    margin: 0 0 4px 0 !important;
    text-align: center !important;
    font-weight: 900 !important;
    font-size: 11pt !important;
  }
  .doctor-summary-calendar,
  .doctor-summary-calendar * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  td .app-icon,
  th .app-icon {
    width: 9px !important;
    height: 9px !important;
    vertical-align: middle !important;
  }
}
