/* ==========================================================================
   Hudoor Platform Official Design System & Glassmorphic Dashboard
   منصة "حضور" - الهوية البصرية العصرية
   - تصميم مخصص 100% للهاتف
   - تصميم زجاجي عصري فاخر لأجهزة الكمبيوتر (Desktop Glassmorphism)
   - خالٍ تماماً من الإيموجي (رموز SVG وأيقونات احترافية فقط)
   ========================================================================== */

:root {
  /* TVTC Brand Palette */
  --tvtc-teal: #008b8c;
  --tvtc-teal-dark: #005f61;
  --tvtc-teal-darker: #004345;
  --tvtc-teal-light: #e6f6f6;
  --tvtc-teal-glow: rgba(0, 139, 140, 0.16);
  --tvtc-teal-border: rgba(0, 139, 140, 0.22);
  
  --tvtc-gold: #c69214;
  --tvtc-gold-light: #fff8e8;
  --tvtc-gold-border: rgba(198, 146, 20, 0.28);
  --tvtc-gold-dark: #9e730a;
  
  --primary: var(--tvtc-teal);
  --primary-dark: var(--tvtc-teal-dark);
  --primary-light: var(--tvtc-teal-light);
  --primary-glow: var(--tvtc-teal-glow);
  --primary-border: var(--tvtc-teal-border);
  
  --bg: #f2f7f7;
  --bg-gradient: radial-gradient(circle at 95% 5%, rgba(0, 139, 140, 0.07), transparent 35%),
                radial-gradient(circle at 5% 90%, rgba(198, 146, 20, 0.05), transparent 30%),
                #f2f7f7;
                
  --surface: #ffffff;
  --surface-alt: #f7faf9;
  --border: #e1ebea;
  --border-light: #ecf3f2;
  
  --ink: #162627;
  --ink-secondary: #354a4b;
  --muted: #6e8384;
  --light-muted: #9bb0b1;
  
  /* Status Colors */
  --ok: #16a34a;
  --ok-soft: #ecfdf5;
  --ok-border: #a7f3d0;
  
  --busy: #ef4444;
  --busy-soft: #fef2f2;
  --busy-border: #fecaca;
  
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  
  --gray-pill: #94a3b8;
  --gray-slot: #cbd5e1;
  
  /* Glassmorphism Variables (Desktop & Cards) */
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-bg-subtle: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(0, 139, 140, 0.16);
  --glass-blur: blur(18px);
  --glass-shadow: 0 10px 32px rgba(0, 60, 62, 0.06);
  --glass-shadow-lg: 0 18px 45px rgba(0, 60, 62, 0.10);
  
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 60, 62, 0.04);
  --shadow-md: 0 6px 20px rgba(0, 60, 62, 0.06);
  --shadow-dock: 0 -8px 30px rgba(0, 60, 62, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-gradient);
  color: var(--ink);
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

/* Base Glass Card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.glass-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--glass-shadow-lg);
}

/* ==========================================================================
   DESKTOP VS MOBILE LAYOUT SWITCHING
   ========================================================================== */

/* By default, desktop topbar is hidden on mobile */
.desktop-topbar { display: none; }
.desktop-only { display: none !important; }

/* Mobile Off-Canvas Sliding Drawer Sidebar (قائمة جانبية متحركة للجوال) */
@media (max-width: 768px) {
  .desktop-sidebar {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(315px, 86vw) !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border-left: 1px solid rgba(0, 139, 140, 0.2) !important;
    box-shadow: -10px 0 40px rgba(0, 50, 50, 0.28) !important;
    z-index: 1300 !important;
    transform: translateX(110%) !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 14px 14px 24px !important;
    overflow-y: auto !important;
  }
  .desktop-sidebar.drawer-open {
    transform: translateX(0) !important;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 35, 36, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1290;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    pointer-events: none;
  }
  .sidebar-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-drawer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
  }
  .sidebar-drawer-tag {
    font-size: 12px;
    font-weight: 800;
    color: var(--tvtc-teal);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .sidebar-fold-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .sidebar-fold-btn:hover {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  }
}

/* Mobile container wrapper */
.mobile-view-wrap {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 14px 14px 110px;
  position: relative;
}

/* Desktop Styles */
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: block !important; }
  
  .app-layout {
    display: flex;
    min-height: 100vh;
    transition: all 0.28s ease;
  }
  
  /* Desktop Sticky Glass Sidebar */
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 242px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--glass-border);
    box-shadow: 4px 0 35px rgba(0, 60, 62, 0.05);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 12px 12px 14px;
    flex-shrink: 0;
    z-index: 100;
    transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), padding 0.28s ease;
  }

  /* Desktop Sidebar Collapsed State (توسيع المساحة للجدول) */
  .app-layout.sidebar-collapsed .desktop-sidebar {
    width: 74px;
    padding: 12px 8px;
  }
  .app-layout.sidebar-collapsed .sidebar-top-signature {
    padding: 8px;
    justify-content: center;
  }
  .app-layout.sidebar-collapsed .sidebar-top-signature .sig-info,
  .app-layout.sidebar-collapsed .sidebar-top-signature .sig-check,
  .app-layout.sidebar-collapsed .sidebar-top-title,
  .app-layout.sidebar-collapsed .desktop-brand-stacked::after,
  .app-layout.sidebar-collapsed .desktop-nav-item span,
  .app-layout.sidebar-collapsed .desktop-user-box > div:not(.user-avatar),
  .app-layout.sidebar-collapsed .desktop-user-box a,
  .app-layout.sidebar-collapsed .sidebar-brand-sub {
    display: none !important;
  }
  .app-layout.sidebar-collapsed .desktop-nav-item {
    justify-content: center;
    padding: 10px 0;
  }
  .app-layout.sidebar-collapsed .desktop-nav-item i {
    margin: 0;
    font-size: 19px;
  }
  .app-layout.sidebar-collapsed .desktop-user-box {
    justify-content: center;
    padding: 8px 4px;
  }
  
  .desktop-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
  }
  
  .desktop-brand::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--tvtc-gold);
    border-radius: 2px;
  }

  /* Compact Centered Logo Header in Sidebar */
  .desktop-brand-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 127, 130, 0.12);
    position: relative;
  }

  .desktop-brand-stacked::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: 50%;
    transform: translateX(50%);
    width: 46px;
    height: 2px;
    background: var(--tvtc-gold);
    border-radius: 2px;
  }

  .hudoor-sidebar-logo-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px 6px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .hudoor-sidebar-logo-img {
    width: 88px;
    height: 88px;
    max-width: 94px;
    max-height: 94px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 12px rgba(0, 60, 62, 0.10));
    transition: transform 0.25s ease, filter 0.25s ease;
  }

  .hudoor-sidebar-logo-img:hover {
    transform: translateY(-2px) scale(1.02);
    filter: drop-shadow(0 10px 24px rgba(0, 60, 62, 0.18));
  }

  .app-layout.sidebar-collapsed .hudoor-sidebar-logo-box {
    padding: 6px;
    border-radius: 12px;
  }

  .app-layout.sidebar-collapsed .hudoor-sidebar-logo-img {
    width: 37px !important;
    height: 37px !important;
    max-width: 37px !important;
    max-height: 37px !important;
  }

  .hudoor-brand-hero {
    background: linear-gradient(135deg, #00787a 0%, #004547 100%);
    border-radius: 15px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 69, 71, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
  }

  .hudoor-logo-emblem {
    width: 58px;
    height: 58px;
    max-width: 58px;
    max-height: 58px;
    border-radius: 13px;
    background: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16), 0 0 0 2px rgba(213, 162, 59, 0.45);
    overflow: hidden;
  }

  .hudoor-logo-emblem img,
  .hudoor-logo-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
  }

  .app-layout.sidebar-collapsed .hudoor-brand-texts,
  .app-layout.sidebar-collapsed .hudoor-dev-signature {
    display: none !important;
  }
  .app-layout.sidebar-collapsed .hudoor-brand-hero {
    padding: 5px;
    justify-content: center;
  }
  .app-layout.sidebar-collapsed .hudoor-logo-emblem {
    width: 42px;
    height: 42px;
  }
  
  .desktop-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    overflow-y: auto;
    padding-top: 4px;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 127, 130, 0.18) transparent;
  }
  
  .desktop-nav::-webkit-scrollbar {
    width: 4px;
  }
  .desktop-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 127, 130, 0.22);
    border-radius: 4px;
  }
  
  .desktop-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9.5px 14px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink-secondary);
    text-decoration: none;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: right;
  }
  
  .desktop-nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--tvtc-teal);
    transition: transform 0.2s ease;
  }
  
  .desktop-nav-item:hover {
    background: rgba(0, 139, 140, 0.08);
    color: var(--tvtc-teal-darker);
    border-color: rgba(0, 139, 140, 0.16);
    transform: translateX(-2px);
  }
  
  .desktop-nav-item:hover i {
    transform: translateX(-2px);
  }
  
  .desktop-nav-item.active {
    background: linear-gradient(135deg, var(--tvtc-teal), var(--tvtc-teal-dark));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 139, 140, 0.28);
  }
  
  .desktop-nav-item.active i {
    color: #ffffff;
  }
  
  .desktop-user-footer, .sidequote {
    display: none !important;
  }
  
  .desktop-user-box .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tvtc-teal-light);
    color: var(--tvtc-teal);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
  }
  
  /* Desktop Main Area (مساحة مريحة وواسعة تناسب عرض 100% بدون ضغط) */
  .desktop-main {
    flex: 1;
    min-width: 0;
    padding: 16px 20px 45px;
    transition: padding 0.2s ease;
  }
  
  .desktop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1050;
  }

  .desktop-sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 139, 140, 0.08);
    border: 1px solid rgba(0, 139, 140, 0.2);
    color: var(--tvtc-teal);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  .desktop-sidebar-toggle-btn:hover {
    background: var(--tvtc-teal);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 139, 140, 0.25);
  }
  
  .desktop-topbar-title h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
  }
  
  .desktop-topbar-title span {
    font-size: 12px;
    color: var(--muted);
  }
  
  .desktop-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .mobile-view-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
}

/* ==========================================================================
   MOBILE HEADER & WELCOME CARD
   ========================================================================== */
.top-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 4px 2px;
}

.mobile-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.mobile-signature-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #00787a 0%, #004d4e 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 30px;
  padding: 5px 12px 5px 8px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 77, 78, 0.25);
  text-decoration: none;
  cursor: pointer;
  min-width: 0;
  flex: 1;
  max-width: calc(100% - 54px);
  transition: all 0.2s ease;
}
.mobile-signature-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 77, 78, 0.35);
}
.mobile-signature-pill .m-sig-code {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  color: #5eead4;
  font-size: 11.5px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.mobile-signature-pill .m-sig-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  text-align: right;
  line-height: 1.2;
}
.mobile-signature-pill .m-sig-name {
  font-size: 12.5px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.mobile-signature-pill .m-sig-sub {
  font-size: 9.5px;
  color: #a7f3d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-signature-pill .m-sig-check {
  font-size: 11px;
  color: #34d399;
  flex-shrink: 0;
}

.mobile-header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.menu-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.top-title-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.top-subtitle {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}

.top-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 2px 0 0;
  line-height: 1.2;
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px 5px 6px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: calc(100% - 90px);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-meta-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-role {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Welcome Card */
.welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.welcome-card-content {
  flex: 1;
  min-width: 0;
}

.welcome-heading {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}

.welcome-date {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 600;
  margin: 0 0 2px;
}

.welcome-semester {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.welcome-building-thumb {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.welcome-calendar-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   STATS GRID (2x2 on Mobile, 4-col Glass Row on Desktop)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 769px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 106px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 769px) {
  .stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 20px;
    box-shadow: var(--glass-shadow);
  }
}

.stat-card:hover {
  border-color: var(--primary-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin-top: 8px;
  text-align: center;
}

/* ==========================================================================
   OCCUPANCY & VACANT ROOMS
   ========================================================================== */
.occupancy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 769px) {
  .occupancy-row {
    gap: 18px;
    margin-bottom: 22px;
  }
}

.occupancy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 769px) {
  .occupancy-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    padding: 22px;
  }
}

.occupancy-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 12px;
  text-align: center;
}

/* Donut Chart */
.donut-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0;
}

.donut-circle {
  --pct: 0%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(var(--busy) 0% var(--pct), var(--ok) var(--pct) 100%);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}

.donut-circle::before {
  content: "";
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--surface);
  position: absolute;
}

@media (min-width: 769px) {
  .donut-circle::before {
    background: #ffffff;
  }
}

.donut-val {
  position: relative;
  z-index: 2;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
}

.occupancy-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.busy { background: var(--busy); }
.legend-dot.free { background: var(--ok); }
.legend-dot.total { background: var(--gray-pill); }

.occupancy-total-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.vacant-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
}

.vacant-icon {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 4px;
}

.vacant-number {
  font-size: 42px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.vacant-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 14px;
}

.btn-vacant-link {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-vacant-link:hover {
  background: var(--primary);
  color: #fff;
}

/* ==========================================================================
   LIVE TIME & CURRENT PERIOD BAR
   ========================================================================== */
.live-period-bar {
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 769px) {
  .live-period-bar {
    border-radius: var(--radius-xl);
    padding: 16px 22px;
    margin-bottom: 22px;
  }
}

.live-time-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-time-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.15);
  color: var(--ok);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.live-time-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.live-period-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-period-info {
  text-align: left;
}

.live-period-label {
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 700;
}

.live-period-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--ok);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
}

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-wrap h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.section-badge-count {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-border);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.section-link-all {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.section-link-all:hover {
  text-decoration: underline;
}

/* ==========================================================================
   LECTURE CARDS
   ========================================================================== */
.lecture-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  position: relative;
  transition: all 0.2s ease;
}

@media (min-width: 769px) {
  .lecture-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
  }
}

.lecture-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.lecture-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.lecture-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.lecture-details {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.lecture-time-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  direction: ltr;
  display: inline-block;
  margin-bottom: 3px;
}

.lecture-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lecture-trainer {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 2px;
}

.lecture-room {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.lecture-chevron {
  color: var(--light-muted);
  font-size: 16px;
}

/* Progress bar inside current lecture */
.lecture-progress-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.lecture-progress-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-light);
  overflow: hidden;
  margin-bottom: 6px;
}

.lecture-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), #14b8a6);
  width: 45%;
  transition: width 0.3s ease;
}

.lecture-remaining-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

/* ==========================================================================
   ROOMS SCREEN (rooms.php)
   ========================================================================== */
.rooms-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.back-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 16px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.back-circle-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.rooms-title-group h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.rooms-title-group p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}

/* Segmented Tabs Control */
.segmented-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #eaefee;
  padding: 4px;
  border-radius: 16px;
  margin-bottom: 16px;
}

@media (min-width: 769px) {
  .segmented-tabs {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    padding: 6px;
    border-radius: 18px;
    margin-bottom: 22px;
  }
}

.segment-btn {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 6px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.segment-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 139, 140, 0.25);
}

/* Horizontal Available Rooms Slider (Carousel on desktop & mobile) */
.available-slider-container {
  position: relative;
  margin-bottom: 16px;
}

.available-scroll-wrap {
  overflow-x: auto;
  padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.available-scroll-wrap::-webkit-scrollbar {
  display: none;
}

.available-scroll-inner {
  display: flex;
  gap: 12px;
  width: max-content;
  transition: all 0.25s ease;
}

/* Expanded Grid Mode when clicking 'عرض الكل' */
.available-scroll-wrap.grid-mode {
  overflow: visible;
}

.available-scroll-wrap.grid-mode .available-scroll-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  width: 100%;
  gap: 12px;
}

.available-scroll-wrap.grid-mode .avail-room-card {
  width: auto;
  min-width: 0;
}

.slider-arrow {
  display: none;
  position: absolute;
  top: calc(50% - 5px);
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.slider-arrow:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 107, 101, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.slider-arrow.prev { right: -14px; }
.slider-arrow.next { left: -14px; }

@media (min-width: 769px) {
  .slider-arrow {
    display: flex;
  }
}

.avail-room-card {
  width: 145px;
  min-width: 145px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avail-room-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (min-width: 769px) {
  .avail-room-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
  }
}

.avail-room-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 17px;
  margin-bottom: 4px;
}

.avail-room-number {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.avail-room-type {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  margin-top: -2px;
}

.avail-room-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ok);
}

.avail-room-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* Filter Chips Bar */
.rooms-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 12px;
}
.rooms-filter-bar::-webkit-scrollbar { display: none; }

.rooms-filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.rooms-filter-chip:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.rooms-filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Training Hours Notice Banner */
.training-notice-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(3, 105, 161, 0.08);
  border: 1px solid rgba(3, 105, 161, 0.22);
  color: #0369a1;
  padding: 11px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}

/* Occupancy Matrix Table (خريطة إشغال القاعات) */
.matrix-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

@media (min-width: 769px) {
  .matrix-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    margin-bottom: 22px;
  }
}

.matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.matrix-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.matrix-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
  margin-bottom: 12px;
  table-layout: fixed;
}

.matrix-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding: 8px 2px;
}

.matrix-table th:first-child,
.matrix-room-cell {
  width: 110px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  padding-right: 6px;
}

.matrix-slot-block {
  height: 26px;
  border-radius: 6px;
  display: block;
  transition: transform 0.15s ease, opacity 0.15s ease;
  cursor: pointer;
}

.matrix-slot-block:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

.matrix-slot-block.busy {
  background: #ef4444;
}

.matrix-slot-block.free {
  background: #10b981;
}

.matrix-slot-block.unavailable {
  background: var(--gray-slot);
}

.matrix-legend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 16px;
}

.matrix-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.matrix-legend-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.matrix-legend-box.busy { background: #ef4444; }
.matrix-legend-box.free { background: #10b981; }
.matrix-legend-box.unavailable { background: var(--gray-slot); }

.btn-matrix-action {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-matrix-action:hover {
  background: var(--primary-dark);
}

/* Quick Tips Card */
.tips-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

@media (min-width: 769px) {
  .tips-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
  }
}

.tips-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tips-list {
  margin: 0;
  padding-right: 18px;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.8;
}

/* ==========================================================================
   FLOATING BOTTOM NAVIGATION DOCK (Mobile Only)
   ========================================================================== */
.floating-bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 24px));
  height: 70px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 139, 140, 0.18);
  border-radius: 28px;
  box-shadow: var(--shadow-dock);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 10px;
  z-index: 1000;
}

@media (min-width: 769px) {
  .floating-bottom-nav {
    display: none !important;
  }
}

.nav-dock-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #788a8a;
  background: transparent;
  border: 0;
  padding: 6px 14px;
  border-radius: 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-width: 58px;
}

.nav-dock-item i,
.nav-dock-item svg {
  font-size: 19px;
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.nav-dock-item:hover {
  color: var(--primary);
}

.nav-dock-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
}

.nav-dock-item.active i,
.nav-dock-item.active svg {
  transform: translateY(-1px);
}

/* ==========================================================================
   MORE BOTTOM SHEET DRAWER
   ========================================================================== */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 35, 36, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: 20px 20px 36px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1200;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.bottom-sheet-overlay.open .bottom-sheet-drawer {
  transform: translate(-50%, 0);
}

.sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: #d1dcda;
  margin: 0 auto 16px;
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
  text-align: center;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sheet-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.sheet-item i {
  font-size: 17px;
  color: var(--primary);
}

.sheet-item.danger {
  color: var(--busy);
}

.sheet-item.danger i {
  color: var(--busy);
}

.sheet-item.danger:hover {
  background: var(--busy-soft);
  border-color: var(--busy-border);
}

/* Empty State */
.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & ICON OVERLAP PROTECTIONS
   ========================================================================== */

/* 1. Prevent any icon or badge from squishing/colliding into text */
.lecture-badge i,
.course-code-pill i,
.section-badge i,
.pblc-trainer-tag i,
.status-pill i,
.time-tag i,
.filter-chip i,
.rowBtn i,
.btn i,
.menu-btn i,
.sidebar-fold-btn i,
.dept-badge-icon i,
.live-clock-label i,
.user-avatar i,
.sig-badge i,
.m-sig-code i,
.kpi-live-dot,
.kpi-sub-pill i,
.kpi-footer-arrow,
.kpi-link-arrow {
  flex-shrink: 0 !important;
}

/* 2. KPI Cards Responsive Optimization on Mobile & Small Screens */
@media (max-width: 768px) {
  .stats-grid {
    gap: 10px;
    margin-bottom: 14px;
  }
  .stat-card.stat-card-clickable {
    padding: 12px 12px 10px !important;
    min-height: 118px !important;
    border-radius: 14px !important;
  }
  .kpi-card-top {
    gap: 6px !important;
    align-items: flex-start !important;
  }
  .kpi-info-side {
    min-width: 0 !important;
    flex: 1 !important;
  }
  .stat-card .stat-label {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    margin-bottom: 2px !important;
  }
  .kpi-main-val {
    font-size: 20px !important;
    line-height: 1.1 !important;
    letter-spacing: -0.3px !important;
  }
  .kpi-main-val .kpi-unit {
    font-size: 10.5px !important;
  }
  .kpi-main-val .kpi-total-slash {
    font-size: 15px !important;
  }
  .kpi-sub-label {
    font-size: 10px !important;
    margin-top: 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .kpi-gauge-wrap {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
    margin-right: auto !important;
  }
  .kpi-ring-pct {
    font-size: 10.5px !important;
  }
  .kpi-card-footer {
    margin-top: 6px !important;
    padding-top: 5px !important;
    font-size: 10.5px !important;
  }
  .kpi-sub-row {
    gap: 4px !important;
    margin-top: 4px !important;
  }
  .kpi-sub-pill {
    font-size: 9.5px !important;
    padding: 2px 5px !important;
    flex-shrink: 0 !important;
  }
}

/* 3. Floating Bottom Nav Sizing on Mobile */
@media (max-width: 768px) {
  .floating-bottom-nav {
    height: 60px !important;
    padding: 3px 6px !important;
    width: min(440px, calc(100% - 16px)) !important;
    bottom: 8px !important;
    border-radius: 24px !important;
  }
  .nav-dock-item {
    min-width: 0 !important;
    flex: 1 !important;
    padding: 3px 2px !important;
    gap: 2px !important;
    font-size: 10px !important;
    border-radius: 14px !important;
  }
  .nav-dock-item i,
  .nav-dock-item svg {
    font-size: 17px !important;
    width: 18px !important;
    height: 18px !important;
  }
  .nav-dock-item span {
    font-size: 9.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
}

/* 4. Toolbar & Filter Chips Responsive Adjustments */
@media (max-width: 768px) {
  .sched-toolbar {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  .sched-filters-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    width: 100% !important;
    padding-bottom: 4px !important;
    gap: 6px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .sched-filters-group::-webkit-scrollbar {
    display: none;
  }
  .filter-chip {
    padding: 4px 10px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .sched-view-switcher {
    width: 100% !important;
    display: flex !important;
  }
  .sched-view-btn {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    padding: 5px 8px !important;
  }
}

/* ==========================================================================
   GLOBAL HUDOOR BRANDING & COMPACT LOGO SIZING (ALL SCREENS)
   ========================================================================== */
.hudoor-sidebar-logo-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px 6px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.hudoor-sidebar-logo-img {
  width: 88px;
  height: 88px;
  max-width: 94px;
  max-height: 94px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(0, 60, 62, 0.10));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.hudoor-sidebar-logo-img:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 10px 24px rgba(0, 60, 62, 0.18));
}

.hudoor-brand-hero {
  background: linear-gradient(135deg, #00787a 0%, #004547 100%);
  border-radius: 15px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 69, 71, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hudoor-logo-emblem {
  width: 45px;
  height: 45px;
  max-width: 45px;
  max-height: 45px;
  border-radius: 11px;
  background: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  padding: 2.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16), 0 0 0 2px rgba(213, 162, 59, 0.45);
  overflow: hidden;
}

.hudoor-logo-emblem img,
.hudoor-logo-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block;
}

.login-box .hudoor-logo-emblem {
  width: 54px;
  height: 54px;
  max-width: 54px;
  max-height: 54px;
  border-radius: 12px;
  padding: 3px;
}

.top-header .hudoor-logo-emblem,
.mobile-hudoor-brand .hudoor-logo-emblem {
  width: 35px;
  height: 35px;
  max-width: 35px;
  max-height: 35px;
  border-radius: 9px;
  padding: 2px;
}

/* ==========================================================================
   TRAINING PROCESS PROGRESS (سير العملية التدريبية - SO09)
   ========================================================================== */
.tp-hero-card {
  background: linear-gradient(135deg, #00787a 0%, #004547 100%);
  border-radius: 22px;
  padding: 22px 24px;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 69, 71, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.tp-hero-card::before {
  content: "";
  position: absolute;
  top: -40px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.tp-week-bar,
.tp-weeks-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.tp-week-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.tp-week-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.tp-week-pill .week-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.tp-week-pill.has-data {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.6);
  color: #fef3c7;
}

.tp-week-pill.has-data .week-dot {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.tp-week-pill.active {
  background: #ffffff !important;
  border-color: #fbbf24 !important;
  color: #004547 !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.tp-week-pill.active .week-dot {
  background: #008b8c;
  box-shadow: 0 0 6px rgba(0, 139, 140, 0.6);
}

.tp-week-pill.active.has-data .week-dot {
  background: #d97706;
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.8);
}

.tp-formula-banner,
.tp-formula-box {
  background: linear-gradient(135deg, #ffffff 0%, #f4fbfb 100%);
  border: 2px solid rgba(0, 139, 140, 0.25);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 8px 26px rgba(0, 60, 62, 0.06);
}

.tp-formula-steps {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tp-step-box {
  flex: 1;
  min-width: 155px;
  background: #ffffff;
  border: 1.5px solid #dbe7e7;
  border-top: 4px solid var(--tvtc-teal, #008b8c);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 60, 62, 0.04);
}

.tp-step-box.highlight-gold {
  background: linear-gradient(135deg, #fffdf5 0%, #fef3c7 100%);
  border-color: #fcd34d;
  border-top: 4px solid #d97706;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.12);
}

.tp-step-box.highlight-gold .tp-step-val {
  color: #b45309;
}

.tp-step-box.highlight {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
  border-top: 4px solid #16a34a;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.14);
}

.tp-step-box.highlight .tp-step-val {
  color: #15803d;
}

.tp-step-label {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 6px;
}

.tp-step-val {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 4px;
}

.tp-step-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.35;
}

.tp-math-op {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #00787a;
  padding: 0 4px;
  user-select: none;
}

@media (max-width: 960px) {
  .tp-math-op {
    display: none;
  }
}

.tp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.tp-kpi-card {
  background: #ffffff;
  border: 1px solid #dbe7e7;
  border-radius: 16px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 60, 62, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 139, 140, 0.09);
  border-color: rgba(0, 139, 140, 0.35);
}

.tp-kpi-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
}

.tp-kpi-value {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  margin: 2px 0;
}

.tp-kpi-meta {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.tp-progress-stack {
  width: 100%;
  height: 14px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tp-seg-present {
  background: linear-gradient(90deg, #10b981, #059669);
  height: 100%;
  transition: width 0.35s ease;
}

.tp-seg-absent {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  height: 100%;
  transition: width 0.35s ease;
}

.tp-seg-unrec-active {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  height: 100%;
  transition: width 0.35s ease;
}

.tp-seg-unrec-inactive {
  background: #94a3b8;
  height: 100%;
  transition: width 0.35s ease;
}

.tp-rate-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.tp-rate-high {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.tp-rate-mid {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.tp-rate-low {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ==========================================================================
   PERIOD BOARD UNIFIED DESIGN (لوحة الفترات المعتمدة - الجدول العام وجدول المدرب)
   ========================================================================== */
.sched-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 139, 140, 0.18);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 70, 72, 0.04);
}

.sched-filters-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-chip {
  border: 1px solid #dbe7e7;
  background: #f8fbfb;
  color: #334155;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip:hover {
  background: #e6f6f6;
  color: #00787a;
  border-color: #008b8c;
}

.filter-chip.active {
  background: linear-gradient(135deg, #008b8c 0%, #005f61 100%);
  color: #ffffff;
  border-color: #005f61;
  box-shadow: 0 4px 12px rgba(0, 139, 140, 0.25);
}

.filter-chip .count-pill,
.filter-chip .chip-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.filter-chip.active .count-pill,
.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.period-board-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

.period-board-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 10px;
  align-items: stretch;
  padding-bottom: 6px;
}

.period-board-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.current-period-5col-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(195px, 1fr));
  gap: 10px;
  align-items: stretch;
}

@media (max-width: 1280px) {
  .period-board-grid {
    grid-template-columns: repeat(5, minmax(195px, 1fr));
  }
  .period-board-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
  .current-period-5col-grid {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
  }
}

@media (max-width: 960px) {
  .period-board-grid.cols-3 {
    grid-template-columns: 1fr;
  }
  .current-period-5col-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .period-board-grid,
  .period-board-grid.cols-3,
  .current-period-5col-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.period-board-col {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 253, 250, 0.7) 100%);
  border: 1px solid rgba(0, 139, 140, 0.18);
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 260px;
  box-shadow: 0 4px 18px rgba(0, 70, 72, 0.04);
  transition: all 0.2s ease;
}

.period-board-col.period-col-live,
.period-board-col.ongoing {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 253, 250, 0.7) 100%);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15), 0 4px 18px rgba(0, 70, 72, 0.04);
}

.period-board-header {
  background: #ffffff;
  border: 1px solid rgba(0, 139, 140, 0.15);
  border-radius: 12px;
  padding: 9px 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.period-board-header.ongoing {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #10b981;
}

.pb-header-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pb-header-title.ongoing {
  color: #047857;
}

.pb-header-time {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  margin-top: 2px;
}

.pb-header-meta {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  margin-top: 3px;
}

.period-board-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 253, 250, 0.9) 100%);
  border: 1px solid rgba(0, 139, 140, 0.22);
  border-radius: 13px;
  padding: 8px 9px;
  box-shadow: 0 3px 12px rgba(0, 70, 72, 0.05), inset 0 1px 1px #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.period-board-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.period-board-card.ongoing {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22), inset 0 1px 1px #fff;
}

.period-board-card.ongoing::before {
  background: #10b981;
}

.period-board-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(0, 139, 140, 0.18), 0 0 12px rgba(45, 212, 191, 0.2);
  border-color: var(--primary);
}

.period-col-header {
  background: linear-gradient(135deg, #00787a 0%, #004d4f 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 69, 71, 0.18);
}

.period-board-col.period-col-live .period-col-header {
  background: linear-gradient(135deg, #059669 0%, #065f46 100%);
}

.period-col-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.period-col-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.period-num-badge {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fbbf24;
  display: grid;
  place-items: center;
  font-size: 13.5px;
  font-weight: 900;
  flex-shrink: 0;
}

.p-title-main {
  font-size: 13.5px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
}

.p-title-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 2px;
}

.period-count-badge {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.period-col-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #e2f8f8;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.period-live-pill {
  background: #fef3c7;
  color: #92400e;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.period-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.period-empty-box {
  flex: 1;
  min-height: 150px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.period-empty-box i {
  font-size: 22px;
  color: #94a3b8;
}

.pblc-card {
  background: #ffffff;
  border: 1px solid #dbe7e7;
  border-right: 4px solid #008b8c;
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(0, 60, 62, 0.05);
  transition: all 0.18s ease;
}

.pblc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 139, 140, 0.12);
  border-color: #008b8c;
}

.pblc-card.card-present {
  border-right-color: #16a34a;
}

.pblc-card.card-late {
  border-right-color: #d97706;
}

.pblc-card.card-absent {
  border-right-color: #dc2626;
}

.pblc-card.card-ongoing {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
  border-color: #86efac;
  border-right: 4px solid #10b981;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.14);
}

.pblc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.pblc-room-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.pblc-room-chip.lab {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.pblc-room-chip.hall {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pblc-course {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pblc-trainer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pblc-trainer-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 139, 140, 0.08);
  color: #006668;
  font-weight: 800;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(0, 139, 140, 0.18);
  text-decoration: none;
}

.pblc-time-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #edf2f7;
}

.pblc-span-tag {
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
}

.pblc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-pill.done {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-pill.late {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-pill.absent {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.status-pill.pending {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.section-badge {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lecture-badge {
  font-size: 10px;
  padding: 1.5px 6px;
  border-radius: 5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lecture-badge.practical {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.lecture-badge.theory {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.course-code-pill {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
}

.time-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 6px;
}

.time-tag.ongoing {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.live-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
  animation: pulseDot 1.8s infinite ease-in-out;
  margin-left: 4px;
}

.dev-signature-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: linear-gradient(145deg, #f8fbfb 0%, #ffffff 100%);
  border: 1px solid rgba(0, 139, 140, 0.22);
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0, 69, 71, 0.05);
  direction: ltr;
  text-align: left;
}

.dev-signature-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 139, 140, 0.14) 0%, rgba(0, 139, 140, 0.06) 100%);
  border: 1px solid rgba(0, 139, 140, 0.25);
  color: #00787a;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.dev-signature-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.dev-signature-name {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.dev-signature-email {
  font-size: 11.5px;
  font-weight: 700;
  color: #00787a;
  text-decoration: none;
}

.dev-signature-email:hover {
  text-decoration: underline;
}

/* ================= UNIFIED MODERN FILE PICKER (خانة رفع الملفات الموحدة) ================= */
.hudoor-file-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 290px;
  padding: 6px 8px 6px 12px;
  background: linear-gradient(145deg, #f8fbfb 0%, #ffffff 100%);
  border: 1.5px dashed rgba(0, 139, 140, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 69, 71, 0.04);
}

.hudoor-file-picker.full-flex {
  flex: 1;
  min-width: 260px;
}

.hudoor-file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
  margin: 0;
  padding: 0;
}

.hudoor-file-picker:hover {
  border-color: #008b8c;
  background: linear-gradient(145deg, #f0fdfa 0%, #ffffff 100%);
  box-shadow: 0 5px 15px rgba(0, 139, 140, 0.1);
  transform: translateY(-1px);
}

.hudoor-file-picker .hfp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 9px;
  background: rgba(0, 139, 140, 0.11);
  border: 1px solid rgba(0, 139, 140, 0.25);
  color: #00787a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.hudoor-file-picker:hover .hfp-btn {
  background: #008b8c;
  border-color: #00787a;
  color: #ffffff;
}

.hudoor-file-picker .hfp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: right;
}

.hudoor-file-picker .hfp-name {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
}

.hudoor-file-picker .hfp-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #94a3b8;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.hudoor-file-picker.has-file {
  border-style: solid;
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.14);
}

.hudoor-file-picker.has-file .hfp-btn {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
}

.hudoor-file-picker.has-file .hfp-name {
  color: #065f46;
  font-weight: 800;
}

.hudoor-file-picker.has-file .hfp-status-icon {
  background: #d1fae5;
  color: #059669;
}

/* ==========================================================================
   EXECUTIVE 10-CARD DASHBOARD GRID
   ========================================================================== */
.dashboard-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
}

@media (max-width: 1200px) {
  .dashboard-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}

@media (max-width: 460px) {
  .dashboard-stat-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   LEVELS DISTRIBUTION DASHBOARD COMPONENT
   ========================================================================== */
.levels-dashboard-panel {
  display: flex;
  flex-direction: column;
}

.levels-exec-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.level-exec-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink);
  transition: all 0.2s ease;
}

.level-exec-pill b {
  color: var(--ink);
  font-weight: 800;
}

.levels-pillars-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  height: 235px;
  padding: 16px 8px 12px;
  background: radial-gradient(ellipse at bottom, rgba(0, 139, 140, 0.04) 0%, transparent 75%);
  border-radius: 12px;
  border-bottom: 1px dashed var(--border-light);
  margin-bottom: 14px;
}

.level-column-item {
  flex: 1;
  max-width: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  padding: 0 4px;
}

.level-column-item:hover {
  transform: translateY(-5px);
}

.level-pct-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 8px;
  line-height: 1.2;
  transition: transform 0.2s ease;
}

.level-column-item:hover .level-pct-tag {
  transform: scale(1.08);
}

.level-pillar-track {
  width: 100%;
  max-width: 44px;
  height: 155px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.025);
  border-radius: 10px;
  padding: 0;
  position: relative;
}

.level-pillar-fill {
  width: 100%;
  border-radius: 8px 8px 3px 3px;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.level-column-item:hover .level-pillar-fill {
  filter: brightness(1.12);
}

.level-pillar-count {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.level-pillar-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 2px;
}

.level-pillar-meta {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.85;
  margin-top: 2px;
  font-weight: 600;
}

/* Home Levels & Alerts Asymmetric Grid */
.home-levels-alerts-grid {
  display: grid;
  grid-template-columns: 1.48fr 1fr;
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .home-levels-alerts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.home-alerts-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.levels-dashboard-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.levels-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: auto;
}

@media (max-width: 1250px) {
  .levels-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 6px;
  }
}

@media (max-width: 600px) {
  .levels-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.level-stat-mini-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.level-stat-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--tvtc-teal);
  box-shadow: 0 6px 18px rgba(0, 139, 140, 0.1);
}

.level-stat-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11.5px;
}

.level-stat-mini-header .badge {
  font-size: 10px !important;
  padding: 2px 5px !important;
  white-space: nowrap;
}

.level-stat-mini-metrics {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}

.level-mini-metric {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.level-mini-metric .val {
  font-weight: 700;
  color: var(--ink);
}

.level-stat-mini-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  flex-wrap: nowrap;
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px dashed var(--border-light);
}

.level-stat-mini-status .badge {
  font-size: 9.5px !important;
  padding: 2px 4px !important;
  white-space: nowrap;
}

.level-mini-btn {
  background: transparent;
  border: none;
  color: var(--tvtc-teal);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: auto;
  white-space: nowrap;
}

.level-mini-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   LEVEL DETAILS MODAL TABLE
   ========================================================================== */
.modalbox-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  padding-bottom: 14px;
  padding-left: 54px;
}

.modal-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.modal-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  background: #ffffff;
}

.level-roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: right;
}

.level-roster-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 2px solid var(--border-light, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

.level-roster-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  color: var(--ink, #1e293b);
  vertical-align: middle;
}

.level-roster-table tr:hover td {
  background: rgba(0, 139, 140, 0.04);
}

/* ==========================================================================
   ADVANCED RESPONSIVE SYSTEM (DESKTOP & MOBILE COMPATIBILITY)
   ========================================================================== */

/* Universal form grid inside modals: 2 columns on desktop/tablet, 1 column on mobile */
.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .modal-form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* Universal filter toolbar: 4 columns on large, 2 columns on tablet, 1 column on mobile */
.filter-toolbar-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}

@media (max-width: 1024px) {
  .filter-toolbar-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .filter-toolbar-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Mid-screen topbar collision prevention (769px to 1200px) */
@media (max-width: 1200px) {
  .desktop-topbar .dev-signature-badge {
    display: none !important;
  }
}

@media (max-width: 992px) {
  .user-role-name {
    display: none !important;
  }
  .desktop-topbar-title h1 {
    font-size: 16px !important;
  }
}

/* Mobile modal optimizations */
@media (max-width: 640px) {
  .modal {
    padding: 10px !important;
  }
  .modalbox {
    max-width: 100% !important;
    width: 100% !important;
    padding: 18px 14px !important;
    border-radius: 14px !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }
}

/* Department Selector single arrow styling (Desktop & Mobile) */
.dept-select-modern {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background: #ffffff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23008b8c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat left 14px center/12px !important;
}

.dept-select-modern::-ms-expand {
  display: none !important;
}

.mobile-dept-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background: #ffffff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23008b8c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat left 12px center/12px !important;
  border: 1.5px solid var(--tvtc-teal) !important;
  color: var(--ink) !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  padding: 8px 12px 8px 32px !important;
  box-shadow: var(--shadow-sm) !important;
  outline: none !important;
  width: 100% !important;
  cursor: pointer;
}

.mobile-dept-select::-ms-expand {
  display: none !important;
}

/* Section Header actions wrapping on mobile */
@media (max-width: 768px) {
  .sectionhead {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .sectionhead .actions,
  .sectionhead .filters {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .sectionhead .actions button,
  .sectionhead .filters button,
  .sectionhead .filters select {
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
  }
}

/* Plan header strip mobile responsiveness */
@media (max-width: 768px) {
  .plan-header-strip {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 14px 16px !important;
    gap: 12px !important;
  }
  .plan-header-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .plan-header-actions button {
    width: 100% !important;
    justify-content: center !important;
  }
  .plan-search-box {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* Responsive Table Wrapper with smooth touch scrolling */
.tablewrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Advising cards and tab responsiveness */
@media (max-width: 440px) {
  .advising-tabs-nav {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* Mobile Drawer active user styling */
.sidebar-user-mobile {
  display: none;
}
@media (max-width: 768px) {
  .sidebar-user-mobile {
    display: block !important;
  }
}


/* =========================================================
   Advanced What-If Engine & Snapshots System Styles
   ========================================================= */

.whatif-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 6px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.whatif-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.whatif-tab-item:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.whatif-tab-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 93, 112, 0.25);
}

.whatif-tab-item.active i {
  color: #fff !important;
}

.whatif-panel-content {
  animation: fadeIn 0.25s ease-out;
}

.merge-pair-card {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.merge-pair-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.merge-pair-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.merge-section-box {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
}

.realloc-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.realloc-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.realloc-candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.realloc-candidate-pill {
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.realloc-candidate-pill:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.realloc-candidate-pill.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px var(--primary);
}

.realloc-candidate-pill.is-excluded {
  opacity: 0.55;
  background: #f8fafc;
  border-style: dashed;
  cursor: not-allowed;
}

.exclusion-pill {
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
  color: var(--ink);
}

.exclusion-pill:hover {
  border-color: var(--primary);
  background: var(--surface);
}

.exclusion-pill.excluded {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: var(--bad);
  box-shadow: 0 0 0 1px var(--bad);
}

.exclusion-pill .badge {
  font-size: 10px;
  padding: 2px 6px;
}


.auto-conf-plan-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.snapshots-table-wrap {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

@media (max-width: 768px) {
  .whatif-tabs-nav {
    padding: 4px;
  }
  .whatif-tab-item {
    padding: 7px 11px;
    font-size: 11.5px;
  }
}
