/* ==========================================================================
   ذكي للعمليات المدرسية — نظام التصميم واللوحات الموحد (Unified Persona Dashboard)
   ThakiOperations Unified Dashboard Design System & Mobile-First Component Library
   ========================================================================== */

:root {
  /* ألوان الهوية الموحدة */
  --thaki-primary: #0c443f;
  --thaki-primary-dark: #072a27;
  --thaki-accent: #087b70;
  --thaki-accent-hover: #065b53;
  --thaki-accent-light: #e6f6f4;
  --thaki-accent-subtle: #f0fdf9;

  /* الحالات التشغيلية */
  --thaki-success: #10b981;
  --thaki-success-bg: #ecfdf5;
  --thaki-success-text: #065f46;
  --thaki-warning: #f59e0b;
  --thaki-warning-bg: #fffbeb;
  --thaki-warning-text: #92400e;
  --thaki-danger: #ef4444;
  --thaki-danger-bg: #fef2f2;
  --thaki-danger-text: #991b1b;
  --thaki-info: #0284c7;
  --thaki-info-bg: #f0f9ff;
  --thaki-info-text: #075985;
  --thaki-wa: #25d366;
  --thaki-wa-bg: #f0fdf4;

  /* الأسطح والحدود */
  --thaki-bg: #f8fafc;
  --thaki-card-bg: #ffffff;
  --thaki-border: #e2e8f0;
  --thaki-border-light: #f1f5f9;
  --thaki-text-main: #0f172a;
  --thaki-text-muted: #64748b;
  --thaki-text-dim: #94a3b8;

  /* قياسات الزوايا والظلال */
  --thaki-radius-sm: 8px;
  --thaki-radius-md: 12px;
  --thaki-radius-lg: 16px;
  --thaki-radius-xl: 20px;
  --thaki-radius-pill: 9999px;
  --thaki-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --thaki-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --thaki-shadow-lg: 0 10px 25px -3px rgba(12, 68, 63, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --thaki-shadow-hover: 0 12px 28px -4px rgba(8, 123, 112, 0.12);

  /* قياسات الجوال المريحة */
  --thaki-touch-min: 48px;
  --thaki-safe-bottom: env(safe-area-inset-bottom, 16px);
  --thaki-safe-top: env(safe-area-inset-top, 0px);
}

/* --------------------------------------------------------------------------
   الهيكل العام للحاوية (Unified Shell)
   -------------------------------------------------------------------------- */
.dash-unified-shell {
  padding: 20px 0 80px;
  max-width: 1280px;
  margin: 0 auto;
  font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
  color: var(--thaki-text-main);
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   الكتلة 1: الترويسة الذكية وشريط الإجراءات (Block 1: Identity & Action Toolbar)
   -------------------------------------------------------------------------- */
.dash-unified-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

@media (max-width: 1280px) {
  .dash-unified-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .dash-unified-toolbar {
    width: 100%;
    justify-content: flex-start;
  }
}

.dash-unified-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-unified-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--thaki-accent);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-unified-eyebrow .badge-pill {
  background: var(--thaki-accent-light);
  color: var(--thaki-accent);
  padding: 2px 8px;
  border-radius: var(--thaki-radius-pill);
  font-size: 0.74rem;
  font-weight: 800;
}

.dash-unified-title {
  margin: 0;
  font-family: 'Tajawal', sans-serif;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 800;
  color: var(--thaki-primary);
  line-height: 1.35;
}

.dash-unified-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--thaki-radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--thaki-shadow-sm);
  border: 1px solid var(--thaki-border);
  background: var(--thaki-card-bg);
  color: var(--thaki-text-main);
  min-height: 42px;
  white-space: nowrap;
}

.dash-action-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--thaki-shadow-md);
}

.dash-action-btn:active {
  transform: translateY(0);
}

.dash-action-btn.btn-accent {
  background: linear-gradient(135deg, var(--thaki-accent) 0%, var(--thaki-primary) 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(8, 123, 112, 0.25);
}

.dash-action-btn.btn-accent:hover {
  box-shadow: 0 6px 18px rgba(8, 123, 112, 0.35);
  color: #ffffff;
}

.dash-action-btn.btn-soft {
  background: var(--thaki-accent-light);
  color: var(--thaki-primary);
  border-color: rgba(8, 123, 112, 0.25);
  font-weight: 800;
}

.dash-action-btn.btn-soft:hover {
  background: #d6f2ee;
  border-color: var(--thaki-accent);
}

.dash-action-btn.btn-wa {
  background: var(--thaki-wa-bg);
  color: #15803d;
  border-color: rgba(37, 211, 102, 0.3);
}

.dash-action-btn.btn-wa:hover {
  background: #dcfce7;
  border-color: var(--thaki-wa);
}

.dash-action-btn.btn-warning {
  background: var(--thaki-warning-bg);
  color: var(--thaki-warning-text);
  border-color: rgba(245, 158, 11, 0.3);
}

.dash-action-btn .btn-badge {
  background: rgba(0, 0, 0, 0.1);
  padding: 1px 7px;
  border-radius: var(--thaki-radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   الكتلة 2: شريط نبض اليوم والمؤشرات اللحظية (Block 2: Pulse & KPI Strip)
   -------------------------------------------------------------------------- */
.dash-unified-pulse-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dash-pulse-card {
  background: var(--thaki-card-bg);
  border: 1px solid var(--thaki-border);
  border-radius: var(--thaki-radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--thaki-shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.dash-pulse-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--thaki-shadow-hover);
  border-color: rgba(8, 123, 112, 0.35);
}

.dash-pulse-card::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: var(--thaki-accent);
  opacity: 0.85;
}

.dash-pulse-card.card-success::after { background: var(--thaki-success); }
.dash-pulse-card.card-warning::after { background: var(--thaki-warning); }
.dash-pulse-card.card-danger::after  { background: var(--thaki-danger); }
.dash-pulse-card.card-info::after    { background: var(--thaki-info); }

.dash-pulse-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dash-pulse-card-top span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--thaki-text-muted);
}

.dash-pulse-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--thaki-radius-sm);
  background: var(--thaki-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--thaki-accent);
}

.dash-pulse-value {
  font-family: 'Readex Pro', sans-serif;
  font-size: clamp(1.8rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: var(--thaki-text-main);
  line-height: 1.15;
  margin: 4px 0 6px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.dash-pulse-value small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--thaki-text-muted);
  font-family: 'Tajawal', sans-serif;
}

.dash-pulse-detail {
  font-size: 0.8rem;
  color: var(--thaki-text-muted);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.dash-pulse-progress {
  width: 100%;
  height: 6px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.dash-pulse-progress-bar {
  height: 100%;
  background: var(--thaki-accent);
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* --------------------------------------------------------------------------
   الكتلة 3: ودجت نبض الحصة والجدول المباشر (Block 3: Live Timetable Cockpit)
   -------------------------------------------------------------------------- */
.dash-live-timetable-section {
  width: 100%;
  margin-bottom: 24px;
  border-radius: var(--thaki-radius-lg);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   الكتلة 4: مركز القرارات والجدول التفاعلي (Block 4: Decision & Operations Hub)
   -------------------------------------------------------------------------- */
.dash-unified-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 20px;
  margin-bottom: 30px;
}

.dash-unified-card {
  background: var(--thaki-card-bg);
  border: 1px solid var(--thaki-border);
  border-radius: var(--thaki-radius-lg);
  box-shadow: var(--thaki-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--thaki-border);
  background: #fafcfb;
}

.dash-card-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--thaki-success);
  display: inline-block;
}

.dash-status-dot.has-critical {
  background: var(--thaki-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
  animation: pulse-ring 2s infinite;
}

.dash-status-dot.has-warning {
  background: var(--thaki-warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.dash-card-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--thaki-text-main);
}

.dash-card-header p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--thaki-text-muted);
}

.dash-counter-badge {
  font-family: 'Readex Pro', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--thaki-radius-pill);
  background: var(--thaki-accent-light);
  color: var(--thaki-accent);
}

.dash-counter-badge.urgent {
  background: var(--thaki-danger-bg);
  color: var(--thaki-danger-text);
}

/* قائمة بنود المتابعة */
.dash-stream-list {
  display: flex;
  flex-direction: column;
}

.dash-stream-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--thaki-border-light);
  transition: background 0.15s ease;
}

.dash-stream-item:last-child {
  border-bottom: none;
}

.dash-stream-item:hover {
  background: #fbfdfc;
}

.dash-stream-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dash-stream-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--thaki-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.dash-stream-icon.critical {
  background: var(--thaki-danger-bg);
  color: var(--thaki-danger);
}

.dash-stream-icon.warning {
  background: var(--thaki-warning-bg);
  color: var(--thaki-warning);
}

.dash-stream-icon.info {
  background: var(--thaki-accent-light);
  color: var(--thaki-accent);
}

.dash-stream-content {
  min-width: 0;
}

.dash-stream-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 4px;
  margin-bottom: 3px;
}

.dash-stream-tag.critical { background: var(--thaki-danger-bg); color: var(--thaki-danger-text); }
.dash-stream-tag.warning { background: var(--thaki-warning-bg); color: var(--thaki-warning-text); }
.dash-stream-tag.info { background: var(--thaki-accent-light); color: var(--thaki-accent); }

.dash-stream-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--thaki-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-stream-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--thaki-text-muted);
}

.dash-stream-action {
  flex-shrink: 0;
}

.dash-stream-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--thaki-radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dash-stream-action-btn.btn-critical {
  background: var(--thaki-danger);
  color: #ffffff;
}
.dash-stream-action-btn.btn-critical:hover { background: #dc2626; color: #ffffff; }

.dash-stream-action-btn.btn-warning {
  background: var(--thaki-warning);
  color: #ffffff;
}
.dash-stream-action-btn.btn-warning:hover { background: #d97706; color: #ffffff; }

.dash-stream-action-btn.btn-info {
  background: var(--thaki-accent);
  color: #ffffff;
}
.dash-stream-action-btn.btn-info:hover { background: var(--thaki-accent-hover); color: #ffffff; }

/* فارغ / مكتمل */
.dash-empty-state {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dash-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--thaki-success-bg);
  color: var(--thaki-success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.dash-empty-state strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--thaki-primary);
  margin-bottom: 4px;
}

.dash-empty-state p {
  font-size: 0.82rem;
  color: var(--thaki-text-muted);
  max-width: 340px;
  margin: 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   ودجت نبض الحصة المدمج (Compact Live Period Widget)
   -------------------------------------------------------------------------- */
.dash-compact-pulse {
  background: linear-gradient(135deg, #0c443f 0%, #08332f 100%);
  color: #ffffff;
  border-radius: var(--thaki-radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--thaki-shadow-md);
  margin-bottom: 18px;
}

.dash-compact-pulse::before {
  content: '';
  position: absolute;
  top: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(8, 123, 112, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.dash-compact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 14px;
}

.dash-compact-period-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-compact-period-title h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
}

.dash-compact-period-badge {
  background: rgba(233, 216, 166, 0.2);
  color: #f6e05e;
  border: 1px solid rgba(233, 216, 166, 0.35);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--thaki-radius-pill);
}

.dash-compact-countdown {
  font-family: 'Readex Pro', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-compact-countdown small {
  font-size: 0.75rem;
  color: #cce0da;
  font-family: 'Tajawal', sans-serif;
}

.dash-compact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.dash-compact-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--thaki-radius-sm);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dash-compact-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   الكتلة 4: بوابات العمليات المدرسية المنظمة (Block 4: The 4 Operational Hubs)
   -------------------------------------------------------------------------- */
.dash-unified-workspaces-heading {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-unified-workspaces-heading h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--thaki-primary);
}

.dash-unified-workspaces-heading span {
  font-size: 0.8rem;
  color: var(--thaki-text-muted);
}

.dash-hubs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.dash-hub-card {
  background: var(--thaki-card-bg);
  border: 1px solid var(--thaki-border);
  border-radius: var(--thaki-radius-lg);
  padding: 20px;
  box-shadow: var(--thaki-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.dash-hub-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--thaki-shadow-hover);
  border-color: rgba(8, 123, 112, 0.35);
}

.dash-hub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--thaki-border-light);
}

.dash-hub-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--thaki-radius-md);
  background: var(--thaki-accent-light);
  color: var(--thaki-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.dash-hub-header h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--thaki-primary);
  line-height: 1.3;
}

.dash-hub-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.dash-hub-links li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--thaki-radius-sm);
  color: var(--thaki-text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.dash-hub-links li a:hover {
  background: var(--thaki-bg);
  color: var(--thaki-accent);
  transform: translateX(-3px);
}

.dash-hub-links li a span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dash-hub-links li a i {
  color: var(--thaki-accent);
  font-size: 0.75rem;
  opacity: 0.7;
}

.dash-hub-links li a .link-badge {
  font-size: 0.72rem;
  background: #edf2f7;
  color: #4a5568;
  padding: 1px 6px;
  border-radius: var(--thaki-radius-pill);
  font-family: 'Readex Pro', sans-serif;
}

/* --------------------------------------------------------------------------
   شريط الإجراء العائم الثابت للجوال (Mobile Sticky Bottom Bar)
   -------------------------------------------------------------------------- */
.dash-mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--thaki-border);
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--thaki-safe-bottom));
  z-index: 1500;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
}

.dash-mobile-menu-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid var(--thaki-border);
  color: var(--thaki-primary);
  border-radius: var(--thaki-radius-md);
  padding: 6px 10px;
  min-width: 58px;
  height: 48px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  flex-shrink: 0;
  text-decoration: none;
}

.dash-mobile-menu-btn:active {
  background: var(--thaki-accent-light);
  border-color: var(--thaki-accent);
  color: var(--thaki-accent);
  transform: scale(0.96);
}

.dash-mobile-menu-btn i {
  font-size: 1.15rem;
  color: var(--thaki-accent);
}

.dash-mobile-sticky-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--thaki-radius-md);
  font-size: 0.94rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--thaki-accent) 0%, var(--thaki-primary) 100%);
  border: none;
  box-shadow: 0 4px 14px rgba(8, 123, 112, 0.35);
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   الألواح السفلية المنزلقة للجوال (Mobile Bottom Sheets)
   -------------------------------------------------------------------------- */
.dash-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2500;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dash-sheet-backdrop.active {
  display: block;
  opacity: 1;
}

.dash-bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  max-height: 88vh;
  background: var(--thaki-card-bg);
  border-radius: 20px 20px 0 0;
  z-index: 2600;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 16px 20px calc(20px + var(--thaki-safe-bottom));
  box-sizing: border-box;
}

.dash-bottom-sheet.active {
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}

.dash-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 0 auto 14px;
}

.dash-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--thaki-border);
}

.dash-sheet-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--thaki-primary);
}

.dash-sheet-close {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #64748b;
  cursor: pointer;
}

.dash-sheet-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 16px;
}

.dash-sheet-action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--thaki-radius-lg);
  border: 1px solid var(--thaki-border);
  background: var(--thaki-card-bg);
  cursor: pointer;
  text-align: right;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  text-decoration: none;
  font-family: 'Tajawal', sans-serif;
}

.dash-sheet-action-item:active {
  transform: scale(0.98);
  background: #f8fafc;
}

.dash-sheet-action-item.item-accent {
  background: linear-gradient(to left, #ffffff 40%, #f0fdf9 100%);
  border-color: rgba(8, 123, 112, 0.35);
}

.dash-sheet-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dash-sheet-action-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-sheet-action-text strong {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--thaki-primary);
  line-height: 1.3;
}

.dash-sheet-action-text span {
  font-size: 0.76rem;
  color: var(--thaki-text-muted);
  line-height: 1.35;
}

.dash-sheet-chevron {
  color: var(--thaki-text-dim);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.dash-sheet-action-item:hover .dash-sheet-chevron {
  transform: translateX(-4px);
  color: var(--thaki-accent);
}

/* --------------------------------------------------------------------------
   قواعد التجاوب والشاشات المختلفة (Media Queries & Breakpoints)
   -------------------------------------------------------------------------- */

/* شاشات الحواسيب المحمولة والأجهزة المتوسطة (<= 1100px) */
@media (max-width: 1100px) {
  .dash-unified-pulse-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-hubs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-unified-grid {
    grid-template-columns: 1fr;
  }
}

/* شاشات الجوال الميدانية (<= 768px) */
@media (max-width: 768px) {
  .dash-unified-shell {
    padding: 12px 14px 100px; /* مساحة عازلة للشريط السفلي العائم */
  }

  /* شريط الإجراءات الأفقي القابل للانزلاق */
  .dash-unified-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .dash-unified-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
  }

  .dash-unified-toolbar::-webkit-scrollbar {
    display: none;
  }

  .dash-action-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.84rem;
    min-height: 44px; /* راحة اللمس الميداني */
  }

  /* نبض الصباح في شبكة 2x2 مدمجة */
  .dash-unified-pulse-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }

  .dash-pulse-card {
    padding: 12px 14px;
  }

  .dash-pulse-card-top span {
    font-size: 0.78rem;
  }

  .dash-pulse-icon {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
  }

  .dash-pulse-value {
    font-size: 1.6rem;
    margin: 2px 0 4px;
  }

  .dash-pulse-detail {
    font-size: 0.72rem;
  }

  /* قائمة القرارات والمتابعة */
  .dash-stream-item {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .dash-stream-left {
    width: 100%;
  }

  .dash-stream-action {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .dash-stream-action-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* مراكز العمليات الأربعة */
  .dash-hubs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dash-hub-card {
    padding: 16px;
  }

  /* إظهار الشريط العائم السفلي الميداني مع زر القائمة والعملية المباشرة */
  .dash-mobile-sticky-bar {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* إخفاء الزر العائم القديم في الصفحات التي بها شريط سفلي منعاً للتداخل */
  .tree-mobile-trigger {
    display: none !important;
  }

  /* منع تكبير الشاشة في حقول الإدخال */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
}
