/* Home and notification presentation — consolidated in v6.110.
   The active cascade is intentionally preserved to keep the published appearance unchanged. */

/* v6.70 — حالات قراءة الإشعارات */
    .notification-item{position:relative}
    .notification-item.read{opacity:.62}
    .notification-read-mark,
    .notification-new-mark{
      flex:0 0 auto;
      padding:4px 8px;
      border-radius:999px;
      font-size:10px;
      font-weight:800;
    }
    .notification-read-mark{
      background:color-mix(in srgb,var(--text) 9%,transparent);
      color:var(--muted);
    }
    .notification-new-mark{
      background:#b4232c;
      color:#fff;
    }
    .notification-target-highlight{
      animation:notificationTargetPulse 2.2s ease;
    }
    @keyframes notificationTargetPulse{
      0%,100%{box-shadow:inherit}
      20%,75%{box-shadow:0 0 0 5px rgba(180,35,44,.28)}
    }

/* v6.71 — الانتقال والوميض للعناصر المرتبطة بالإشعارات */
    .notification-target-highlight{
      position:relative;
      z-index:3;
      animation:notificationTargetSoftPulse 3s ease-in-out;
    }

    @keyframes notificationTargetSoftPulse{
      0%,100%{
        background-color:inherit;
        box-shadow:inherit;
      }
      18%,48%,78%{
        background-color:rgba(23,107,112,.16);
        box-shadow:0 0 0 5px rgba(23,107,112,.13);
      }
      32%,63%{
        background-color:rgba(23,107,112,.06);
        box-shadow:0 0 0 2px rgba(23,107,112,.07);
      }
    }

    #installments-table tr.notification-target-highlight td{
      background-color:rgba(23,107,112,.16) !important;
    }

    #tasks-list .notification-target-highlight{
      border-color:rgba(23,107,112,.45) !important;
    }

/* v6.87 — استعادة بطاقة التقويم القديمة كما كانت */

    #page-home .home-calendar-module{
      margin:0 !important;
      min-width:0 !important;
      min-height:520px !important;
      height:100% !important;
      display:flex !important;
      flex-direction:column !important;
      padding:22px !important;
      background:var(--panel) !important;
      border:1px solid rgba(0,0,0,.04) !important;
      border-radius:var(--radius) !important;
      box-shadow:var(--shadow) !important;
      overflow:hidden !important;
    }

    #page-home .calendar-module-head{
      display:flex !important;
      align-items:flex-start !important;
      justify-content:space-between !important;
      gap:18px !important;
      margin-bottom:18px !important;
    }

    #page-home .calendar-module-head h2{
      margin:0 !important;
      font-size:28px !important;
      color:var(--home-calendar-title-color,var(--text)) !important;
    }

    #page-home .calendar-module-head p{
      margin:5px 0 0 !important;
      color:var(--home-calendar-subtitle-color,var(--muted)) !important;
      font-size:13px !important;
    }

    #page-home .calendar-mode-control{
      display:flex !important;
      align-items:center !important;
      gap:12px !important;
      cursor:pointer !important;
      user-select:none !important;
      color:var(--muted) !important;
      font-weight:700 !important;
    }

    #page-home .calendar-mode-control input{
      position:absolute !important;
      opacity:0 !important;
      pointer-events:none !important;
    }

    #page-home .calendar-switch{
      position:relative !important;
      width:58px !important;
      height:30px !important;
      border:2px solid var(--text) !important;
      border-radius:999px !important;
      background:#fff !important;
      flex:0 0 58px !important;
    }

    #page-home .calendar-switch::after{
      content:"" !important;
      position:absolute !important;
      top:3px !important;
      right:3px !important;
      width:20px !important;
      height:20px !important;
      border-radius:50% !important;
      background:var(--text) !important;
      transition:transform .2s ease !important;
    }

    #page-home .calendar-mode-control input:checked + .calendar-switch::after{
      transform:translateX(-28px) !important;
    }

    #page-home .home-appointments-list{
      display:grid !important;
      gap:14px !important;
      flex:1 1 auto !important;
      min-height:0 !important;
      max-height:none !important;
      overflow-x:hidden !important;
      overflow-y:auto !important;
      padding-inline-end:5px !important;
      scrollbar-width:thin !important;
    }

    #page-home .home-appointment-card{
      display:grid !important;
      grid-template-columns:105px 1fr !important;
      gap:14px !important;
      padding:14px !important;
      border-radius:20px !important;
      background:#fff !important;
      border:1px solid color-mix(in srgb,var(--border) 70%,transparent) !important;
    }

    #page-home .appointment-date-card{
      min-height:115px !important;
      display:flex !important;
      flex-direction:column !important;
      align-items:center !important;
      justify-content:center !important;
      border-radius:18px !important;
      background:color-mix(in srgb,var(--secondary-card) 7%,#fff) !important;
      text-align:center !important;
    }

    #page-home .appointment-date-card strong{
      font-size:30px !important;
      line-height:1 !important;
    }

    #page-home .appointment-date-card span{
      margin-top:9px !important;
      font-size:16px !important;
      font-weight:800 !important;
    }

    #page-home .appointment-date-card small{
      margin-top:5px !important;
      font-size:14px !important;
    }

    #page-home .appointment-content{
      display:flex !important;
      flex-direction:column !important;
      justify-content:center !important;
    }

    #page-home .appointment-heading{
      display:flex !important;
      align-items:center !important;
      justify-content:space-between !important;
      gap:16px !important;
    }

    #page-home .appointment-heading h3{
      margin:-22px 0 0 !important;
      font-size:18px !important;
      color:#000000 !important;
    }

    #page-home .appointment-content > p{
      margin:10px 0 !important;
      color:var(--muted) !important;
    }

    #page-home .appointment-meta{
      margin-bottom:14px !important;
      font-weight:700 !important;
    }

    #page-home .appointment-action{
      width:max-content !important;
      padding:10px 20px !important;
      border:0 !important;
      border-radius:12px !important;
      background:var(--primary) !important;
      color:#fff !important;
      box-shadow:none !important;
      font-weight:800 !important;
    }

    #page-home .home-empty-appointments{
      padding:30px !important;
      text-align:center !important;
    }

    #page-home .home-empty-appointments .appointment-date-card{
      width:105px !important;
      margin:0 auto 16px !important;
    }

    #page-home .home-appointments-list::-webkit-scrollbar{
      width:5px !important;
    }

    #page-home .home-appointments-list::-webkit-scrollbar-thumb{
      border-radius:999px !important;
      background:color-mix(in srgb,var(--primary) 28%,transparent) !important;
    }

    @media(max-width:1000px){
      #page-home .home-calendar-module{
        min-height:0 !important;
      }
    }

/* v6.88 — توحيد حجم بطاقة التقويم مع بطاقة إدارة التحصيل */
    #page-home .home-calendar-module{
      min-height:0 !important;
      height:100% !important;
      align-self:stretch !important;
    }

    #page-home .home-shortcuts-module{
      height:100% !important;
      align-self:stretch !important;
    }

    #page-home .home-top-grid{
      align-items:stretch !important;
    }

/* v6.89 — لون مربع التاريخ ومحاذاة زر عرض المهمة */
    #page-home .appointment-date-card{
      background:var(--home-shortcuts-item,#ffffff) !important;
      color:var(--home-shortcuts-text,#171717) !important;
    }

    #page-home .appointment-date-card strong,
    #page-home .appointment-date-card span,
    #page-home .appointment-date-card small{
      color:var(--home-shortcuts-text,#171717) !important;
    }

    #page-home .appointment-content{
      position:relative !important;
      min-height:115px !important;
      padding-inline-end:0 !important;
      padding-inline-start:150px !important;
    }

    #page-home .appointment-action{
      position:absolute !important;
      left:0 !important;
      top:50% !important;
      transform:translateY(-50%) !important;
      margin:0 !important;
    }

    @media(max-width:700px){
      #page-home .appointment-content{
        padding-inline-start:0 !important;
        padding-bottom:54px !important;
      }

      #page-home .appointment-action{
        left:50% !important;
        top:auto !important;
        bottom:0 !important;
        transform:translateX(-50%) !important;
      }
    }

/* v6.90 — زر عرض المهمة بجانب مربع التاريخ مباشرة */
    #page-home .home-appointment-card{
      position:relative !important;
    }

    #page-home .appointment-content{
      position:relative !important;
      min-height:115px !important;
      padding-inline-start:0 !important;
    }

    #page-home .appointment-action{
      position:absolute !important;
      top:50% !important;
      right:0 !important;
      left:auto !important;
      transform:translateY(-50%) !important;
      margin:0 !important;
      z-index:2 !important;
    }

    @media(max-width:700px){
      #page-home .appointment-content{
        padding-bottom:54px !important;
      }

      #page-home .appointment-action{
        top:auto !important;
        right:0 !important;
        left:auto !important;
        bottom:0 !important;
        transform:none !important;
      }
    }

/* v6.97 — تصحيح ألوان بطاقة التقويم */
    #page-home{
      --home-calendar-card-bg:#f3eee7;
      --home-calendar-control-bg:#155e62;
      --home-calendar-control-text:#ffffff;
    }

    #page-home .home-appointment-card{
      position:relative !important;
      display:flex !important;
      flex-direction:row !important;
      align-items:stretch !important;
      gap:16px !important;
      min-height:145px !important;
      padding:14px !important;
      direction:ltr !important;
      overflow:hidden !important;
      box-sizing:border-box !important;
      background:var(--home-calendar-card-bg) !important;
      background-color:var(--home-calendar-card-bg) !important;
    }

    #page-home .home-appointment-card > .appointment-date-card{
      order:2 !important;
      flex:0 0 116px !important;
      width:116px !important;
      min-height:116px !important;
      margin:0 !important;
      box-sizing:border-box !important;
    }

    #page-home .home-appointment-card > .appointment-date-card{
      background:var(--home-calendar-control-bg) !important;
      background-color:var(--home-calendar-control-bg) !important;
      color:var(--home-calendar-control-text) !important;
      border:1px solid rgba(255,255,255,.12) !important;
    }

    #page-home .home-appointment-card > .appointment-date-card strong,
    #page-home .home-appointment-card > .appointment-date-card span,
    #page-home .home-appointment-card > .appointment-date-card small{
      color:var(--home-calendar-control-text) !important;
    }

    #page-home .home-appointment-card > .appointment-content{
      order:1 !important;
      flex:1 1 auto !important;
      min-width:0 !important;
      min-height:116px !important;
      position:static !important;
      display:flex !important;
      flex-direction:column !important;
      align-items:flex-start !important;
      justify-content:flex-start !important;
      gap:18px !important;
      padding:8px 0 4px !important;
      direction:rtl !important;
      text-align:right !important;
      box-sizing:border-box !important;
    }

    #page-home .appointment-heading{
      display:block !important;
      width:100% !important;
      min-width:0 !important;
      padding-left:124px !important;
      box-sizing:border-box !important;
    }

    #page-home .appointment-heading h3{
      margin:0 !important;
      color:#000000 !important;
      font-size:18px !important;
      line-height:1.55 !important;
      overflow-wrap:anywhere !important;
    }

    #page-home .home-appointment-card.home-empty-appointments .appointment-heading{
      padding-left:0 !important;
    }

    #page-home .appointment-status{
      position:absolute !important;
      top:18px !important;
      left:18px !important;
      right:auto !important;
      bottom:auto !important;
      z-index:3 !important;
      max-width:112px !important;
      margin:0 !important;
      white-space:nowrap !important;
    }

    #page-home .appointment-status.task-status-late,
    #page-home .appointment-status.late{
      background:#fee4e2 !important;
      color:#9f1d16 !important;
    }

    #page-home .appointment-status.task-status-progress{
      background:#dff4ff !important;
      color:#176c91 !important;
    }

    #page-home .appointment-status.today{
      background:#fef3c7 !important;
      color:#92400e !important;
    }

    #page-home .appointment-status.task-status-done{
      background:#dcfce7 !important;
      color:#166534 !important;
    }

    #page-home .appointment-status.upcoming{
      background:#e0f2fe !important;
      color:#075985 !important;
    }

    #page-home .appointment-action{
      position:static !important;
      inset:auto !important;
      transform:none !important;
      align-self:flex-start !important;
      width:max-content !important;
      max-width:100% !important;
      margin:0 !important;
      padding:10px 20px !important;
      background:var(--home-calendar-control-bg) !important;
      background-color:var(--home-calendar-control-bg) !important;
      color:var(--home-calendar-control-text) !important;
      border:1px solid rgba(255,255,255,.12) !important;
    }

    #page-home .home-scroll-content{
      scroll-behavior:smooth !important;
      scrollbar-gutter:stable;
      touch-action:pan-y;
    }

    #page-home .home-urgent-task-row{
      align-items:flex-start !important;
      gap:18px !important;
    }

    #page-home .home-urgent-task-row span{
      min-width:0;
      overflow-wrap:anywhere;
    }

    #page-home .home-urgent-task-row strong{
      flex:0 0 auto;
      font-size:12px;
      line-height:1.7;
      text-align:left;
    }

    #page-home #home-activities .timeline-item{
      display:grid;
      gap:3px;
    }

    #page-home #home-activities .home-activity-detail{
      display:block;
      color:var(--text);
      font-size:13px;
      overflow-wrap:anywhere;
    }

    #page-home .home-feed-empty{
      margin:8px 0 0;
    }

    @media(max-width:700px){
      #page-home .home-appointment-card{
        gap:10px !important;
        min-height:122px !important;
        padding:10px !important;
      }

      #page-home .home-appointment-card > .appointment-date-card{
        flex-basis:90px !important;
        width:90px !important;
        min-height:100px !important;
      }

      #page-home .home-appointment-card > .appointment-content{
        min-height:100px !important;
        gap:12px !important;
        padding:6px 0 2px !important;
      }

      #page-home .appointment-heading{
        padding-left:88px !important;
      }

      #page-home .appointment-heading h3{
        font-size:15px !important;
      }

      #page-home .appointment-status{
        top:12px !important;
        left:12px !important;
        max-width:82px !important;
        font-size:11px !important;
        padding:6px 8px !important;
      }

      #page-home .appointment-action{
        padding:8px 13px !important;
        font-size:12px !important;
      }
    }

/* v6.102 — فصل خلفية البطاقات الأربع السفلية عن اللون التركوازي */
    #page-home{
      --home-lower-card-bg:#ded7cf;
      --home-lower-card-text:var(--secondary-card-text,var(--text));
    }

    #page-home .home-shortcuts-module,
    #page-home .home-calendar-module,
    #page-home .home-secondary-grid > .home-compact-card{
      background:var(--home-lower-card-bg) !important;
      background-color:var(--home-lower-card-bg) !important;
      color:var(--home-lower-card-text) !important;
    }

/* v6.99 — البطاقات التركوازية في الصفحة الرئيسية */
    #page-home{
      --home-card-turquoise:#155e62;
      --home-card-turquoise-text:#ffffff;
    }

    #page-home #home-metrics > .metric,
    #page-home .home-shortcuts-module .home-shortcut-card{
      background:var(--home-card-turquoise) !important;
      background-color:var(--home-card-turquoise) !important;
      color:var(--home-card-turquoise-text) !important;
    }

    #page-home #home-metrics > .metric span,
    #page-home #home-metrics > .metric strong,
    #page-home #home-metrics > .metric a,
    #page-home .home-shortcuts-module .home-shortcut-card strong,
    #page-home .home-shortcuts-module .home-shortcut-content{
      color:var(--home-card-turquoise-text) !important;
    }

/* v6.100 — مؤشرات التمرير التركوازية الغامقة */
    #page-home #home-urgent-tasks,
    #page-home #home-activities{
      scrollbar-color:#155e62 transparent !important;
    }

    #page-home #home-urgent-tasks::-webkit-scrollbar-thumb,
    #page-home #home-activities::-webkit-scrollbar-thumb{
      background:#155e62 !important;
      background-color:#155e62 !important;
    }

/* v6.103 — بيج التقويم ونصوص البطاقات الثانوية */
    #page-home{
      --home-calendar-beige-control:#f3eee7;
      --home-calendar-beige-text:#171717;
    }

    #page-home .home-appointment-card,
    #page-home .home-appointment-card > .appointment-date-card,
    #page-home .appointment-action,
    #page-home .appointment-status.task-status-progress{
      background:var(--home-calendar-beige-control) !important;
      background-color:var(--home-calendar-beige-control) !important;
      color:var(--home-calendar-beige-text) !important;
      border-color:rgba(23,23,23,.08) !important;
    }

    #page-home .home-appointment-card > .appointment-date-card strong,
    #page-home .home-appointment-card > .appointment-date-card span,
    #page-home .home-appointment-card > .appointment-date-card small{
      color:var(--home-calendar-beige-text) !important;
    }

    #page-home .home-secondary-grid > .home-compact-card,
    #page-home .home-secondary-grid > .home-compact-card > h2,
    #page-home #home-urgent-tasks,
    #page-home #home-urgent-tasks *,
    #page-home #home-activities,
    #page-home #home-activities *{
      color:#171717 !important;
    }

    #page-home #home-urgent-tasks,
    #page-home #home-activities{
      scrollbar-color:#155e62 transparent !important;
    }

    #page-home #home-urgent-tasks::-webkit-scrollbar-thumb,
    #page-home #home-activities::-webkit-scrollbar-thumb{
      background:#155e62 !important;
      background-color:#155e62 !important;
    }

/* v6.104 — تصحيح نطاق البيج واستعادة ألوان محتوى التقويم */
    #page-home .home-appointment-card{
      background:#f3eee7 !important;
      background-color:#f3eee7 !important;
      color:#171717 !important;
    }

    #page-home .home-appointment-card > .appointment-date-card,
    #page-home .appointment-action{
      background:#155e62 !important;
      background-color:#155e62 !important;
      color:#ffffff !important;
      border-color:rgba(255,255,255,.12) !important;
    }

    #page-home .home-appointment-card > .appointment-date-card strong,
    #page-home .home-appointment-card > .appointment-date-card span,
    #page-home .home-appointment-card > .appointment-date-card small{
      color:#ffffff !important;
    }

    #page-home .appointment-status.task-status-progress{
      background:#dff4ff !important;
      background-color:#dff4ff !important;
      color:#176c91 !important;
      border-color:rgba(23,108,145,.12) !important;
    }

/* v6.105 — مطابقة المستطيل الداخلي مع لون الفاصل النصفي */
    #page-home .home-appointment-card{
      background:#e2ddda !important;
      background-color:#e2ddda !important;
    }

/* v6.106 — زر مهمة أصغر ومؤشرات تمرير شديدة النحافة */
    #page-home .appointment-action{
      position:absolute !important;
      left:18px !important;
      right:auto !important;
      top:auto !important;
      bottom:18px !important;
      transform:none !important;
      width:max-content !important;
      padding:7px 13px !important;
      border-radius:9px !important;
      font-size:12px !important;
      line-height:1.4 !important;
    }

    #page-home .home-appointments-list,
    #page-home #home-urgent-tasks,
    #page-home #home-activities,
    #page-home .home-shortcuts-track{
      scrollbar-width:thin !important;
    }

    #page-home .home-appointments-list::-webkit-scrollbar,
    #page-home #home-urgent-tasks::-webkit-scrollbar,
    #page-home #home-activities::-webkit-scrollbar{
      width:2px !important;
    }

    #page-home .home-shortcuts-track::-webkit-scrollbar{
      height:2px !important;
    }

    @media(max-width:700px){
      #page-home .appointment-action{
        left:12px !important;
        right:auto !important;
        bottom:12px !important;
        padding:6px 11px !important;
        font-size:11px !important;
      }
    }

/* v6.107 — نقل مؤشر تمرير المهام العاجلة إلى اليمين */
    #page-home #home-urgent-tasks{
      direction:ltr !important;
      padding-right:6px !important;
      padding-left:0 !important;
    }

    #page-home #home-urgent-tasks > *{
      direction:rtl !important;
    }

/* v6.108 — مساحة آمنة بين مؤشر المهام العاجلة والمحتوى */
    #page-home #home-urgent-tasks{
      padding-right:16px !important;
      padding-left:0 !important;
      scrollbar-gutter:stable !important;
    }

    #page-home #home-urgent-tasks > *{
      width:100% !important;
      box-sizing:border-box !important;
    }

/* v6.109 — ألوان زر تحويل التقويم */
    #page-home .calendar-switch{
      background:#e2ddda !important;
      background-color:#e2ddda !important;
    }

    #page-home .calendar-switch::after{
      background:#155e62 !important;
      background-color:#155e62 !important;
    }


/* v6.110 — يظهر فقط عند فشل تحميل مصدر بيانات، ولا يغير الشكل المعتاد */
.data-load-warning{
  position:fixed;inset:auto 18px 18px 18px;z-index:1200;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 16px;border:1px solid #b4232c;border-radius:14px;
  background:#fff2f2;color:#721c24;box-shadow:0 10px 30px rgba(0,0,0,.16);
  font-weight:700;
}
.data-load-warning.hidden{display:none}
.data-load-warning button{border:0;background:transparent;color:inherit;font-size:20px;cursor:pointer}


/* v6.128 — بطاقات أقصر وتمرير داخلي بعجلة الماوس */
#page-home .home-feature-grid,
#page-home .home-secondary-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:18px !important;
  align-items:stretch !important;
  width:100% !important;
  margin:18px 0 !important;
}

#page-home .home-feature-grid > .home-module,
#page-home .home-secondary-grid > .home-compact-card{
  width:100% !important;
  min-width:0 !important;
  height:280px !important;
  min-height:280px !important;
  max-height:280px !important;
  margin:0 !important;
  padding:22px !important;
  border-radius:var(--radius) !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}

#page-home .home-shortcuts-shell,
#page-home .home-shortcuts-track{
  min-width:0 !important;
  max-width:100% !important;
}

#page-home .home-shortcuts-track{
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:none !important;
  scroll-behavior:auto !important;
  overscroll-behavior-inline:contain;
  touch-action:pan-x pan-y;
  cursor:default !important;
}

#page-home .home-shortcuts-track .home-shortcut-card{
  cursor:pointer !important;
}

@media(max-width:1000px){
  #page-home .home-feature-grid,
  #page-home .home-secondary-grid{
    grid-template-columns:1fr !important;
  }
}

@media(max-width:620px){
  #page-home .home-feature-grid > .home-module,
  #page-home .home-secondary-grid > .home-compact-card{
    height:270px !important;
    min-height:270px !important;
    max-height:270px !important;
    padding:17px !important;
  }
}

/* v6.151 — توسيط حالة التقويم الفارغة وتصغير التاريخ */
#page-home .home-appointment-card.home-empty-appointments > .appointment-content{
  justify-content:center !important;
  align-items:center !important;
  padding:0 !important;
  text-align:center !important;
}

#page-home .home-appointment-card.home-empty-appointments .appointment-heading{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  padding:0 !important;
}

#page-home .home-appointment-card.home-empty-appointments .appointment-heading h3{
  margin:0 !important;
  text-align:center !important;
}

#page-home .home-appointment-card > .appointment-date-card strong{
  font-size:28px !important;
}

#page-home .home-appointment-card > .appointment-date-card span{
  font-size:15px !important;
}
