/* Manager pages contain several custom panels outside the vendor theme.
   Keep those panels aligned with the active Frest light/dark style. */
html.dark-style .manager-layout .school-hub-card,
html.dark-style .manager-layout .students-panel,
html.dark-style .manager-layout .schedule-summary-card,
html.dark-style .manager-layout .student-import-file-picker,
html.dark-style .manager-layout .student-import-table-wrapper,
html.dark-style .manager-layout .modal-content,
html.dark-style .manager-layout .card,
html.dark-style .manager-layout .bg-white,
html.dark-style .manager-layout .bg-light,
html.dark-style .manager-layout .bg-light-subtle {
  color: #a1b0cb !important;
  background: #283144 !important;
  border-color: #36445d !important;
  box-shadow: 0 8px 24px rgba(7, 12, 22, 0.18) !important;
}

html.dark-style .manager-layout .students-panel-primary,
html.dark-style .manager-layout .schedule-summary-card {
  background: linear-gradient(180deg, #283144 0%, #222a3a 100%) !important;
}

html.dark-style .manager-layout .school-hub-card-body h5,
html.dark-style .manager-layout .students-panel-header h5,
html.dark-style .manager-layout .student-import-file-name,
html.dark-style .manager-layout .text-dark,
html.dark-style .manager-layout .table > :not(caption) > * > * {
  color: #d8deea !important;
}

html.dark-style .manager-layout .school-hub-card-body p,
html.dark-style .manager-layout .students-panel-header p,
html.dark-style .manager-layout .text-muted,
html.dark-style .manager-layout .form-text {
  color: #8295ba !important;
}

html.dark-style .manager-layout .students-count {
  color: #86abf5;
  background: rgba(90, 141, 238, 0.16);
}

html.dark-style .manager-layout .students-note {
  color: #72e3ae;
  background: rgba(57, 218, 138, 0.12);
}

html.dark-style .manager-layout .students-pager,
html.dark-style .manager-layout .student-import-file-action,
html.dark-style .manager-layout .table > :not(:last-child) > :last-child > * {
  border-color: #36445d !important;
}

html.dark-style .manager-layout .student-import-file-action,
html.dark-style .manager-layout .input-group-text,
html.dark-style .manager-layout .form-control,
html.dark-style .manager-layout .form-select {
  color: #a1b0cb;
  background-color: #222a3a;
  border-color: #44536f;
}

html.dark-style .manager-layout .form-control::placeholder {
  color: #7183a4;
}

html.dark-style .manager-layout .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
  --bs-table-hover-bg: rgba(90, 141, 238, 0.08);
  --bs-table-border-color: #36445d;
  color: #a1b0cb;
}

html.dark-style .manager-layout .dropdown-menu,
html.dark-style .manager-layout .list-group-item {
  color: #a1b0cb;
  background-color: #283144;
  border-color: #36445d;
}

html.dark-style .manager-layout .class-stat-card,
html.dark-style .manager-layout .class-list-section,
html.dark-style .manager-layout .class-tabs-shell,
html.dark-style .manager-layout .student-tile,
html.dark-style .manager-layout .student-tile-action,
html.dark-style .manager-layout .schedule-panel,
html.dark-style .manager-layout .schedule-item-card,
html.dark-style .manager-layout .schedule-assignment-field,
html.dark-style .manager-layout .schedule-assignment-option {
  color: #a1b0cb !important;
  background: #283144 !important;
  border-color: #36445d !important;
}

html.dark-style .manager-layout .class-card-button,
html.dark-style .manager-layout .schedule-assignment-picker,
html.dark-style .manager-layout .schedule-modal-day,
html.dark-style .manager-layout .schedule-time-field,
html.dark-style .manager-layout .class-tabs-header {
  color: #a1b0cb !important;
  background: #222a3a !important;
  border-color: #36445d !important;
}

html.dark-style .manager-layout .class-card-content strong,
html.dark-style .manager-layout .student-tile-content strong,
html.dark-style .manager-layout .schedule-item-title,
html.dark-style .manager-layout .schedule-summary-value,
html.dark-style .manager-layout .section-title-row h5 {
  color: #d8deea !important;
}

html.dark-style .manager-layout .class-stat-card span,
html.dark-style .manager-layout .class-card-content span,
html.dark-style .manager-layout .student-tile-content span,
html.dark-style .manager-layout .section-title-row p,
html.dark-style .manager-layout .schedule-item-meta,
html.dark-style .manager-layout .schedule-summary-label,
html.dark-style .manager-layout .schedule-summary-meta,
html.dark-style .manager-layout .schedule-modal-day span {
  color: #8295ba !important;
}

/* AI consultant drawer: its component stylesheet predates the light/dark switch
   and intentionally uses white surfaces. Keep the drawer readable in both modes. */
.manager-layout .ai-drawer {
  color: #435971 !important;
  background: #ffffff !important;
  z-index: 1090 !important;
}

.manager-layout .ai-drawer .ai-drawer-header,
.manager-layout .ai-drawer .ai-drawer-footer {
  background: #ffffff !important;
  border-color: #d9dee3 !important;
}

.manager-layout .ai-drawer .ai-drawer-body {
  background: #f8f9fa !important;
}

.manager-layout .ai-drawer .text-muted,
.manager-layout .ai-drawer .voice-draft-header small {
  color: #65758a !important;
}

.manager-layout .ai-drawer .ai-bubble {
  color: #435971 !important;
  background: #ffffff !important;
  border-color: #d9dee3 !important;
}

.manager-layout .ai-drawer .ai-drawer-header h6,
.manager-layout .ai-drawer .ai-drawer-header .text-dark,
.manager-layout .ai-drawer .voice-draft-header,
.manager-layout .ai-drawer .chat-input-wrapper .form-control {
  color: #435971 !important;
}

.manager-layout .ai-drawer .ai-drawer-header .btn-light {
  color: #435971 !important;
  background-color: #f1f3f5 !important;
  border-color: #d9dee3 !important;
}

.manager-layout .ai-drawer .chat-input-wrapper .form-control::placeholder {
  color: #7d8da0 !important;
}

html.dark-style .manager-layout .ai-drawer {
  color: #a1b0cb !important;
  background: #283144 !important;
  border-color: #36445d !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .35) !important;
}

html.dark-style .manager-layout .ai-drawer .ai-drawer-header,
html.dark-style .manager-layout .ai-drawer .ai-drawer-footer {
  background: #283144 !important;
  border-color: #36445d !important;
}

html.dark-style .manager-layout .ai-drawer .ai-drawer-header h6,
html.dark-style .manager-layout .ai-drawer .ai-drawer-header .text-dark,
html.dark-style .manager-layout .ai-drawer .voice-draft-header,
html.dark-style .manager-layout .ai-drawer .chat-input-wrapper .form-control {
  color: #d8deea !important;
}

html.dark-style .manager-layout .ai-drawer .ai-drawer-header .btn-light {
  color: #d8deea !important;
  background-color: #36445d !important;
  border-color: #4b5d7e !important;
}

html.dark-style .manager-layout .ai-drawer .ai-drawer-body {
  background: #1c222f !important;
}

html.dark-style .manager-layout .ai-drawer .ai-bubble {
  color: #d8deea !important;
  background: #283144 !important;
  border-color: #36445d !important;
}

html.dark-style .manager-layout .ai-drawer .chat-input-wrapper {
  background: #222a3a !important;
  border-color: #4b5d7e !important;
}

html.dark-style .manager-layout .ai-drawer .chat-input-wrapper:focus-within {
  background: #283144 !important;
}

html.dark-style .manager-layout .ai-drawer .chat-input-wrapper .form-control::placeholder {
  color: #8295ba !important;
}

html.dark-style .manager-layout .ai-drawer .bg-lighter,
html.dark-style .manager-layout .ai-drawer .voice-recording-status,
html.dark-style .manager-layout .ai-drawer .voice-transcript-card,
html.dark-style .manager-layout .ai-drawer .voice-draft-card {
  color: #d8deea !important;
  background: #222a3a !important;
  border-color: #36445d !important;
}

html.dark-style .manager-layout .ai-drawer .voice-draft-header small,
html.dark-style .manager-layout .ai-drawer .text-muted {
  color: #8295ba !important;
}

@media (max-width: 576px) {
  .manager-layout .ai-drawer {
    top: 8px;
    bottom: 8px;
    left: calc(-100vw - 8px);
    width: calc(100vw - 16px);
    border-radius: 18px;
  }

  .manager-layout .ai-drawer.open {
    left: 8px;
  }
}

/* ═════════════════════════════════════════════════════════════════
   DarsChin-Style Modern Sidebar (منوی کناری مدرن فِرِست)
   ═════════════════════════════════════════════════════════════════ */

/* Smooth animation transitions */
.layout-menu,
.layout-page {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* Desktop sizing: expanded vs collapsed */
@media (min-width: 1200px) {
  .layout-menu {
    width: 260px !important;
  }
  .layout-page {
    padding-right: 0 !important;
  }
  .layout-menu-collapsed .layout-menu {
    width: 82px !important;
  }
  .layout-menu-collapsed .layout-page {
    padding-right: 0 !important;
  }
}

/* Circular floating toggle button on the left edge of right-sidebar */
.layout-menu-toggle.sidebar-toggle-btn,
.layout-menu .app-brand .layout-menu-toggle.sidebar-toggle-btn,
.layout-menu-collapsed:not(.layout-menu-hover) .layout-menu .app-brand .layout-menu-toggle.sidebar-toggle-btn {
  position: absolute !important;
  top: 20px !important;
  left: -14px !important;
  right: auto !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #5a8dee, #7367f0) !important;
  color: #fff !important;
  border: 3px solid #f5f6fa !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1060 !important;
  box-shadow: 0 2px 8px rgba(90, 141, 238, 0.35) !important;
  transition: all 0.2s ease !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  overflow: visible !important;
}

.layout-menu-toggle.sidebar-toggle-btn:hover {
  transform: scale(1.12) !important;
  background: linear-gradient(135deg, #4b7ee8, #6455ea) !important;
  box-shadow: 0 4px 12px rgba(90, 141, 238, 0.5) !important;
}

.layout-menu-toggle.sidebar-toggle-btn i {
  font-size: 1.15rem !important;
  color: #fff !important;
  transition: transform 0.3s ease !important;
}

.layout-menu-collapsed .layout-menu-toggle.sidebar-toggle-btn i.menu-toggle-icon,
.layout-menu-collapsed .layout-menu-toggle.sidebar-toggle-btn i.hamyar-toggle-icon {
  transform: rotate(180deg) !important;
}

html.dark-style .layout-menu-toggle.sidebar-toggle-btn {
  border-color: #222a3a !important;
}

/* Brand mark logo box */
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #5a8dee, #7f6df2);
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 6px 14px rgba(90, 141, 238, 0.3);
  transition: transform 0.2s ease;
}

.app-brand:hover .brand-mark {
  transform: scale(1.05);
}

.app-brand-text {
  color: #25396f;
  font-weight: 800;
  letter-spacing: -0.02em;
}

html.dark-style .app-brand-text {
  color: #e2e8f0 !important;
}

/* Active menu item with vibrant gradient */
.menu-inner > .menu-item {
  margin: 0.18rem 0.85rem;
}

.menu-inner > .menu-item > .menu-link {
  border-radius: 0.65rem !important;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.menu-inner .menu-item.active > .menu-link,
.menu-inner .menu-link.active {
  color: #ffffff !important;
  background: linear-gradient(118deg, #5a8dee, #7367f0) !important;
  box-shadow: 0 4px 14px rgba(90, 141, 238, 0.38) !important;
}

.menu-inner .menu-item.active > .menu-link i,
.menu-inner .menu-link.active i,
.menu-inner .menu-item.active > .menu-link div,
.menu-inner .menu-link.active div {
  color: #ffffff !important;
}

/* Collapsed state item visibility & icon centering */
.layout-menu-collapsed .app-brand-text,
.layout-menu-collapsed .menu-header-text,
.layout-menu-collapsed .menu-link div {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease !important;
}

.layout-menu-collapsed .brand-mark {
  margin: auto !important;
}

@media (min-width: 1200px) {
  .layout-menu-collapsed:not(.layout-menu-hover) .app-brand-text,
  .layout-menu-collapsed:not(.layout-menu-hover) .menu-header-text,
  .layout-menu-collapsed:not(.layout-menu-hover) .menu-link div,
  .layout-menu-collapsed:not(.layout-menu-hover) .menu-sub {
    display: none !important;
  }

  .layout-menu-collapsed:not(.layout-menu-hover) .menu-inner > .menu-item > .menu-link {
    justify-content: center !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
  }

  .layout-menu-collapsed:not(.layout-menu-hover) .menu-inner > .menu-item > .menu-link .menu-icon {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  /* Desktop hover expand preview */
  .layout-menu-collapsed.layout-menu-hover .layout-menu {
    width: 260px !important;
    box-shadow: -0.35rem 0 1.3rem rgba(31, 52, 89, 0.14) !important;
    z-index: 1050 !important;
  }

  .layout-menu-collapsed.layout-menu-hover .app-brand-text,
  .layout-menu-collapsed.layout-menu-hover .menu-header-text,
  .layout-menu-collapsed.layout-menu-hover .menu-link div {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* In hover expand preview: ONLY show submenus for items that are explicitly OPEN or animating */
  .layout-menu-collapsed.layout-menu-hover .menu-item.open > .menu-sub,
  .layout-menu-collapsed.layout-menu-hover .menu-item.menu-item-animating > .menu-sub {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .layout-menu-collapsed.layout-menu-hover .menu-item:not(.open):not(.menu-item-animating) > .menu-sub {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .layout-menu-collapsed.layout-menu-hover .brand-mark {
    margin: 0 !important;
  }

  .layout-menu-collapsed.layout-menu-hover .menu-inner {
    overflow: visible;
  }

  .layout-menu-collapsed.layout-menu-hover .menu-inner > .menu-item > .menu-link {
    justify-content: flex-start !important;
    padding-right: 1rem !important;
    padding-left: 1rem !important;
  }
}

/* Mobile drawer and overlay */
.layout-overlay {
  display: none;
}

.layout-menu-expanded .layout-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(34, 48, 62, 0.55);
  z-index: 1075;
}

@media (max-width: 1199.98px) {
  .layout-menu {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    transform: translate3d(100%, 0, 0) !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    z-index: 1080 !important;
  }

  .layout-menu-expanded .layout-menu {
    transform: translate3d(0, 0, 0) !important;
  }

  .layout-page {
    padding-right: 0 !important;
  }
}

/* ═════════════════════════════════════════════════════════════════
   DarsChin-Style Floating Navbar & Topbar (هدر جزیره‌ای شناور)
   ═════════════════════════════════════════════════════════════════ */
.app-topbar {
  height: auto !important;
  min-height: 76px !important;
  margin: 1rem 1.5rem 0 !important;
  border: 1px solid #d5e0f2 !important;
  border-radius: 1rem !important;
  background: linear-gradient(135deg, rgba(238, 243, 255, 0.97) 0%, rgba(232, 240, 250, 0.97) 100%) !important;
  box-shadow: 0 0.65rem 1.6rem rgba(31, 52, 89, 0.09) !important;
  backdrop-filter: blur(10px) !important;
}

html.dark-style .app-topbar {
  background: linear-gradient(135deg, rgba(39, 50, 73, 0.96) 0%, rgba(31, 43, 62, 0.96) 100%) !important;
  border-color: #41516e !important;
  box-shadow: 0 0.65rem 1.6rem rgba(7, 12, 22, 0.25) !important;
}

.app-topbar .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-start,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.topbar-title .fw-bold {
  font-size: 0.98rem;
  color: #25396f !important;
}

html.dark-style .topbar-title .fw-bold {
  color: #d8deea !important;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  width: max-content;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #eef4ff;
  color: #4d7fd8;
  font-size: 0.68rem;
  font-weight: 800;
}

html.dark-style .topbar-badge {
  background: rgba(90, 141, 238, 0.16);
  color: #86abf5;
}

/* Topbar School Context */
.topbar-school-context {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-school-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  min-height: 46px;
  padding: 0.18rem 0.22rem 0.18rem 0.72rem;
  border: 1px solid rgba(90, 141, 238, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0.3rem 0.8rem rgba(45, 74, 123, 0.07);
}

html.dark-style .topbar-school-identity {
  border-color: rgba(134, 171, 245, 0.28);
  background: rgba(18, 27, 43, 0.34);
  box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.16);
}

.topbar-school-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(90, 141, 238, 0.16) 0%, rgba(90, 141, 238, 0.06) 100%);
  color: #5a8dee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid rgba(90, 141, 238, 0.22);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(90, 141, 238, 0.12);
}

html.dark-style .topbar-school-avatar {
  background: rgba(90, 141, 238, 0.2);
  border-color: rgba(90, 141, 238, 0.35);
  color: #86abf5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.topbar-school-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topbar-school-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #25396f !important;
  letter-spacing: -0.2px;
}

html.dark-style .topbar-school-name {
  color: #d8deea !important;
}

.topbar-badge-city {
  background: rgba(0, 207, 232, 0.12) !important;
  color: #0099aa !important;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 207, 232, 0.25);
}

html.dark-style .topbar-badge-city {
  background: rgba(0, 207, 232, 0.18) !important;
  color: #5ce1e6 !important;
  border-color: rgba(0, 207, 232, 0.3);
}

.topbar-badge-year {
  background: rgba(57, 218, 138, 0.12) !important;
  color: #1b8a43 !important;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(57, 218, 138, 0.25);
}

html.dark-style .topbar-badge-year {
  background: rgba(57, 218, 138, 0.18) !important;
  color: #39da8a !important;
  border-color: rgba(57, 218, 138, 0.3);
}

html.dark-style .topbar-context-select { color: #d8deea; }
html.dark-style .topbar-context-select:focus { background-color: #25324a; }
html.dark-style .topbar-context-select option { background: #25324a; color: #d8deea; }
html.dark-style .topbar-year-control { background: #39da8a18; color: #57e69a; }

/* User Card */
.topbar-user-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.35rem 0.65rem 0.35rem 0.8rem;
  border: 1px solid #dfe8f6;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fff, #f8fbff);
  color: #435671;
  box-shadow: 0 0.45rem 1rem rgba(31, 52, 89, 0.045);
  transition: all 0.2s ease;
  cursor: pointer;
}

html.dark-style .topbar-user-card {
  border-color: #36445d;
  background: linear-gradient(135deg, #283144, #222a3a);
  color: #a1b0cb;
}

.topbar-user-card:hover,
.topbar-user-card[aria-expanded="true"] {
  border-color: #bcd0f5;
  background: #fff;
  box-shadow: 0 0.65rem 1.35rem rgba(31, 52, 89, 0.08);
  transform: translateY(-1px);
}

html.dark-style .topbar-user-card:hover,
html.dark-style .topbar-user-card[aria-expanded="true"] {
  border-color: #4b5d7e;
  background: #283144;
  box-shadow: 0 0.65rem 1.35rem rgba(7, 12, 22, 0.3);
}

.topbar-user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #5a8dee, #7367f0);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 0.45rem 1rem rgba(90, 141, 238, 0.25);
  overflow: hidden;
}

.topbar-user-avatar.small {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 0.75rem;
}

.topbar-user-info {
  text-align: right;
  line-height: 1.3;
}

.topbar-user-info strong,
.topbar-user-menu .dropdown-header strong {
  display: block;
  color: #25396f;
  font-size: 0.82rem;
  font-weight: 700;
}

html.dark-style .topbar-user-info strong,
html.dark-style .topbar-user-menu .dropdown-header strong {
  color: #d8deea !important;
}

.topbar-user-info small,
.topbar-user-menu .dropdown-header small {
  display: block;
  color: #8a98ac;
  font-size: 0.7rem;
}

.topbar-user-chevron {
  color: #9aa8bb;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.topbar-user-card[aria-expanded="true"] .topbar-user-chevron {
  transform: rotate(180deg);
}

.topbar-user-menu {
  min-width: 235px;
  padding: 0.55rem;
  border: 1px solid #e2e9f4;
  border-radius: 1rem;
  box-shadow: 0 1rem 2.4rem rgba(31, 52, 89, 0.14);
  text-align: right;
}

html.dark-style .topbar-user-menu {
  background: #283144;
  border-color: #36445d;
  box-shadow: 0 1rem 2.4rem rgba(7, 12, 22, 0.4);
}

.topbar-user-menu .dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.55rem 0.8rem;
}

.topbar-user-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 0.7rem;
  padding: 0.65rem 0.7rem;
  color: #516377;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

html.dark-style .topbar-user-menu .dropdown-item {
  color: #a1b0cb;
}

.topbar-user-menu .dropdown-item i {
  font-size: 1.1rem;
  color: #6f8099;
}

.topbar-user-menu .dropdown-item:hover {
  background: #f4f7fc;
  color: #315fae;
}

html.dark-style .topbar-user-menu .dropdown-item:hover {
  background: #222a3a;
  color: #86abf5;
}

.topbar-user-menu .dropdown-item:hover i {
  color: #5a8dee;
}

/* Glass Footer Widgets */
.footer-glass-box {
  display: flex;
  align-items: center;
  padding: 0.55rem 1.25rem;
  border-radius: 50rem;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.3s ease;
  cursor: default;
}

.footer-glass-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08) !important;
}

@media (max-width: 991.98px) {
  .app-topbar {
    margin: 0.75rem !important;
  }
  .topbar-title .app-topbar-subtitle,
  .topbar-badge {
    display: none;
  }
  .topbar-school-name {
    font-size: 0.95rem;
  }
}

@media (max-width: 767.98px) {
  .topbar-badge-year {
    display: none;
  }
  .topbar-badge-city {
    font-size: 0.72rem;
    padding: 0.22rem 0.5rem;
  }
}

@media (max-width: 575.98px) {
  .app-topbar .container-fluid {
    align-items: center;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .topbar-school-identity {
    min-height: 40px;
    gap: 0.4rem;
    padding: 0.16rem 0.16rem 0.16rem 0.52rem;
    border-radius: 11px;
  }
  .topbar-school-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.05rem;
    border-radius: 8px;
  }
  .topbar-school-name {
    font-size: 0.88rem;
  }
  .topbar-user-card {
    padding: 0.3rem 0.4rem;
  }
  .topbar-user-info {
    display: none !important;
  }
}

/* ═════════════════════════════════════════════════════════════════
   DarsChin-Style Cards, Stats, Tabs & Empty States (فاز ۳)
   ═════════════════════════════════════════════════════════════════ */

/* Page Background */
.layout-page {
  background-color: #f5f6fa !important;
}

html.dark-style .layout-page {
  background-color: #1a202c !important;
}

/* Card Base Enhancements (DarsChin Standard) */
.card.admin-card,
.stat-card {
  border: 0 !important;
  border-radius: 1.15rem !important;
  box-shadow: 0 4px 18px rgba(58, 53, 65, 0.06) !important;
  transition: all 0.25s ease !important;
}

html.dark-style .card.admin-card,
html.dark-style .stat-card {
  background: #283144 !important;
  border: 1px solid #36445d !important;
  box-shadow: 0 4px 18px rgba(7, 12, 22, 0.25) !important;
}

/* Stat Cards */
.stat-card:hover,
.class-stat-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 9px 25px rgba(58, 53, 65, 0.1) !important;
}

html.dark-style .stat-card:hover,
html.dark-style .class-stat-card:hover {
  box-shadow: 0 9px 25px rgba(7, 12, 22, 0.4) !important;
}

.stat-icon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 1.45rem !important;
}

/* Class Stat Cards Grid & Items */
.class-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  margin-bottom: 1.25rem !important;
}

.class-stat-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 1.15rem 1.35rem !important;
  border-radius: 1.15rem !important;
  background: #ffffff !important;
  box-shadow: 0 4px 18px rgba(58, 53, 65, 0.06) !important;
  border: 0 !important;
  transition: all 0.25s ease !important;
}

html.dark-style .class-stat-card {
  background: #283144 !important;
  border: 1px solid #36445d !important;
  box-shadow: 0 4px 18px rgba(7, 12, 22, 0.25) !important;
}

.class-stat-card span {
  display: block !important;
  color: #8492a6 !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.35rem !important;
}

html.dark-style .class-stat-card span {
  color: #a1b0cb !important;
}

.class-stat-card strong {
  font-size: 1.75rem !important;
  font-weight: 850 !important;
  letter-spacing: -0.02em !important;
}

.class-stat-card.primary strong { color: #5a8dee !important; }
.class-stat-card.teal strong,
.class-stat-card.success strong { color: #28c76f !important; }
.class-stat-card.indigo strong,
.class-stat-card.info strong { color: #00bad1 !important; }
.class-stat-card.orange strong,
.class-stat-card.warning strong { color: #ff9f43 !important; }

/* Hub Navigation Cards */
.school-hub-card {
  display: flex !important;
  align-items: center !important;
  gap: 1.1rem !important;
  padding: 1.25rem 1.5rem !important;
  border-radius: 1.15rem !important;
  background: #ffffff !important;
  border: 0 !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  position: relative !important;
  min-height: 90px !important;
  box-shadow: 0 4px 18px rgba(58, 53, 65, 0.06) !important;
}

html.dark-style .school-hub-card {
  background: #283144 !important;
  border: 1px solid #36445d !important;
  box-shadow: 0 4px 18px rgba(7, 12, 22, 0.25) !important;
}

.school-hub-card:hover {
  box-shadow: 0 9px 25px rgba(58, 53, 65, 0.12) !important;
  transform: translateY(-3px) !important;
}

html.dark-style .school-hub-card:hover {
  box-shadow: 0 9px 25px rgba(0, 0, 0, 0.35) !important;
}

.school-hub-card:active {
  transform: translateY(0) !important;
}

.school-hub-card-icon {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  border-radius: 14px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 1.45rem !important;
}

.school-hub-card-body {
  flex: 1 !important;
}

.school-hub-card-body h5 {
  margin: 0 0 0.3rem 0 !important;
  font-size: 1.02rem !important;
  font-weight: 750 !important;
  color: #25396f !important;
}

html.dark-style .school-hub-card-body h5 {
  color: #d8deea !important;
}

.school-hub-card-body p {
  margin: 0 !important;
  font-size: 0.82rem !important;
  color: #8492a6 !important;
  line-height: 1.5 !important;
}

html.dark-style .school-hub-card-body p {
  color: #8295ba !important;
}

.school-hub-card-arrow {
  color: #a1b0cb !important;
  font-size: 1.35rem !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
}

.school-hub-card:hover .school-hub-card-arrow {
  color: #5a8dee !important;
  transform: translateX(-4px) !important;
}

/* School Manage Header Banner */
.school-manage-header {
  background: linear-gradient(118deg, #5a8dee, #7367f0) !important;
  border-radius: 1.25rem !important;
  padding: 1.5rem 1.8rem !important;
  box-shadow: 0 6px 20px rgba(90, 141, 238, 0.25) !important;
  color: #ffffff !important;
}

.school-manage-header-body {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}

.school-manage-avatar {
  width: 58px !important;
  height: 58px !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border-radius: 16px !important;
  display: grid !important;
  place-items: center !important;
  color: #fff !important;
  font-size: 1.9rem !important;
  backdrop-filter: blur(8px) !important;
}

/* DarsChin Segmented Pill Tabs */
.class-tabs-shell,
.class-list-section {
  padding: 1.35rem !important;
  border-radius: 1.25rem !important;
  background: #ffffff !important;
  box-shadow: 0 4px 18px rgba(58, 53, 65, 0.06) !important;
  border: 0 !important;
}

html.dark-style .class-tabs-shell,
html.dark-style .class-list-section {
  background: #283144 !important;
  border: 1px solid #36445d !important;
  box-shadow: 0 4px 18px rgba(7, 12, 22, 0.25) !important;
}

.class-tabs-header,
.nav-pills {
  display: inline-flex !important;
  gap: 0.35rem !important;
  padding: 0.35rem !important;
  margin-bottom: 1.2rem !important;
  border-radius: 0.85rem !important;
  background: #edf2f7 !important;
  border: 1px solid #e2e8f0 !important;
}

html.dark-style .class-tabs-header,
html.dark-style .nav-pills {
  background: #222a3a !important;
  border-color: #36445d !important;
}

.class-tab-button,
.nav-pills .nav-link {
  border: 0 !important;
  border-radius: 0.65rem !important;
  padding: 0.55rem 1.25rem !important;
  background: transparent !important;
  color: #64748b !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

html.dark-style .class-tab-button,
html.dark-style .nav-pills .nav-link {
  color: #a1b0cb !important;
}

.class-tab-button.active,
.nav-pills .nav-link.active {
  color: #25396f !important;
  background: #ffffff !important;
  font-weight: 850 !important;
  box-shadow: 0 4px 12px rgba(31, 52, 89, 0.08) !important;
}

html.dark-style .class-tab-button.active,
html.dark-style .nav-pills .nav-link.active {
  color: #ffffff !important;
  background: #283144 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Empty States */
.empty-state,
.empty-class-state {
  padding: 3.5rem 1rem !important;
  text-align: center !important;
  color: #8492a6 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.65rem !important;
}

.empty-state i,
.empty-class-state i {
  font-size: 3.2rem !important;
  color: #c5cce0 !important;
}

.empty-state h5,
.empty-state h6,
.empty-class-state h5,
.empty-class-state h6 {
  color: #25396f !important;
  font-weight: 800 !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.25rem !important;
}

html.dark-style .empty-state h5,
html.dark-style .empty-state h6,
html.dark-style .empty-class-state h5,
html.dark-style .empty-class-state h6 {
  color: #d8deea !important;
}

html.dark-style .empty-state,
html.dark-style .empty-class-state {
  color: #a1b0cb !important;
}

html.dark-style .empty-state i,
html.dark-style .empty-class-state i {
  color: #4a5a78 !important;
}

/* ═════════════════════════════════════════════════════════════════
   Select2 RTL Polish, SweetAlert2 & Responsive Utilities (فاز ۴)
   ═════════════════════════════════════════════════════════════════ */

/* Select2 RTL Controls */
.select2-container--default[dir="rtl"] .select2-selection--single,
[dir="rtl"] .select2-container--default .select2-selection--single {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: 0.75rem !important;
  border: 1px solid #d9dee3 !important;
  display: flex !important;
  align-items: center !important;
  position: relative !important;
  background-color: #ffffff !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #5a8dee !important;
  box-shadow: 0 0 0 0.2rem rgba(90, 141, 238, 0.16) !important;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__rendered {
  padding-right: 0 !important;
  padding-left: 28px !important;
  line-height: 40px !important;
  text-align: right !important;
  color: #516377 !important;
  width: 100% !important;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
  left: 8px !important;
  right: auto !important;
  height: 100% !important;
  top: 0 !important;
  width: 20px !important;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__clear,
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
  position: absolute !important;
  left: 26px !important;
  right: auto !important;
  float: none !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 1.1rem !important;
  color: #8492a6 !important;
  cursor: pointer !important;
}

.select2-dropdown {
  border-radius: 0.75rem !important;
  border-color: #e4ebf6 !important;
  box-shadow: 0 0.65rem 1.6rem rgba(31, 52, 89, 0.12) !important;
  z-index: 1080 !important;
  text-align: right !important;
  overflow: hidden !important;
}

.modal .select2-dropdown {
  z-index: 2050 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border-radius: 0.5rem !important;
  border-color: #d9dee3 !important;
  text-align: right !important;
  padding: 0.45rem 0.75rem !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #5a8dee !important;
  color: #ffffff !important;
  border-radius: 0.45rem !important;
}

.select2-container--default .select2-results__option {
  padding: 0.5rem 0.85rem !important;
  margin: 0.15rem 0.35rem !important;
  border-radius: 0.45rem !important;
  font-size: 0.88rem !important;
}

/* Dark style for Select2 */
html.dark-style .select2-container--default .select2-selection--single {
  background-color: #222a3a !important;
  border-color: #44536f !important;
}

html.dark-style .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #a1b0cb !important;
}

html.dark-style .select2-dropdown {
  background-color: #283144 !important;
  border-color: #36445d !important;
  box-shadow: 0 0.65rem 1.6rem rgba(7, 12, 22, 0.45) !important;
}

html.dark-style .select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: #222a3a !important;
  border-color: #36445d !important;
  color: #d8deea !important;
}

html.dark-style .select2-container--default .select2-results__option {
  color: #a1b0cb !important;
}

/* SweetAlert2 RTL & Modernization */
.swal2-container {
  z-index: 4000 !important;
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
}

.swal2-popup {
  border-radius: 1.2rem !important;
  padding: 1.75rem !important;
  font-family: inherit !important;
  direction: rtl !important;
  text-align: center !important;
  box-shadow: 0 1rem 3rem rgba(31, 52, 89, 0.18) !important;
}

.swal2-title {
  display: block !important;
  width: 100% !important;
  color: #25396f !important;
  font-weight: 800 !important;
  font-size: 1.25rem !important;
  margin: 0 auto 0.75rem !important;
  text-align: center !important;
}

.swal2-html-container {
  display: block !important;
  width: 100% !important;
  color: #64748b !important;
  font-size: 0.92rem !important;
  line-height: 1.7 !important;
  margin-right: auto !important;
  margin-left: auto !important;
  text-align: center !important;
}

.swal2-actions {
  display: flex !important;
  width: 100% !important;
  gap: 0.75rem !important;
  margin: 1.5rem auto 0 !important;
  justify-content: center !important;
  text-align: center !important;
}

.swal2-footer,
.swal2-input-label,
.swal2-validation-message,
.swal2-checkbox,
.swal2-radio {
  width: 100% !important;
  margin-right: auto !important;
  margin-left: auto !important;
  text-align: center !important;
  justify-content: center !important;
}

.swal2-popup p,
.swal2-popup small,
.swal2-popup strong {
  text-align: center !important;
}

.swal2-styled {
  border-radius: 0.65rem !important;
  padding: 0.6rem 1.5rem !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  min-height: 44px !important;
}

.swal2-styled.swal2-confirm {
  background: linear-gradient(118deg, #5a8dee, #7367f0) !important;
  box-shadow: 0 4px 12px rgba(90, 141, 238, 0.35) !important;
}

.swal2-styled.swal2-cancel {
  background: #edf2f7 !important;
  color: #64748b !important;
}

/* Dark Mode SweetAlert2 */
html.dark-style .swal2-popup {
  background: #283144 !important;
  color: #d8deea !important;
  border: 1px solid #36445d !important;
  box-shadow: 0 1rem 3rem rgba(7, 12, 22, 0.5) !important;
}

html.dark-style .swal2-title {
  color: #d8deea !important;
}

html.dark-style .swal2-html-container {
  color: #a1b0cb !important;
}

html.dark-style .swal2-styled.swal2-cancel {
  background: #222a3a !important;
  color: #a1b0cb !important;
  border: 1px solid #36445d !important;
}

/* Responsive Tables & Clean Headers */
.table-responsive {
  border-radius: 0.85rem !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 141, 238, 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(90, 141, 238, 0.25);
  border-radius: 999px;
}

.table > thead th {
  font-size: 0.82rem !important;
  text-transform: none !important;
  color: #8492a6 !important;
  background: #f7f8fb !important;
  border: 0 !important;
  white-space: nowrap !important;
  font-weight: 750 !important;
  padding: 0.85rem 1rem !important;
}

html.dark-style .table > thead th {
  background: #222a3a !important;
  color: #a1b0cb !important;
}

.table > :not(caption) > * > * {
  padding: 0.85rem 1rem !important;
  vertical-align: middle !important;
}

.student-mobile-cell {
  direction: ltr !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: 0.04em !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

/* Responsive Breakpoints (<768px and <576px) */
@media (max-width: 767.98px) {
  .class-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .class-tabs-header {
    width: 100% !important;
    display: flex !important;
  }

  .class-tab-button {
    flex: 1 !important;
    text-align: center !important;
    padding: 0.55rem 0.5rem !important;
    font-size: 0.82rem !important;
  }

  .school-manage-header {
    padding: 1.15rem !important;
  }

  .school-hub-card {
    padding: 1rem 1.15rem !important;
    min-height: 80px !important;
  }

  .school-hub-card-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    font-size: 1.3rem !important;
  }

  /* Toolbars and filter rows */
  .admin-card .card-body .row,
  .class-toolbar,
  .students-toolbar,
  .students-actions,
  .section-title-row,
  .class-detail-actions,
  .class-students-banner-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .admin-card .card-body .row > [class*="col-"] {
    width: 100% !important;
    margin-bottom: 0 !important;
  }

  .form-select,
  .form-control,
  .btn,
  .select2-container--default .select2-selection--single,
  .select2-container--default[dir="rtl"] .select2-selection--single {
    min-height: 44px !important;
    height: 44px !important;
  }

  .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

@media (max-width: 575.98px) {
  .class-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .form-select,
  .form-control,
  .btn {
    min-height: 44px !important;
  }
}



/* ═════════════════════════════════════════════════════════════════
   DarsChin Creative Polish: Sleek Headers, Segmented Tabs & Clean Sidebar
   ═════════════════════════════════════════════════════════════════ */

/* 1. Sidebar Clean Visual Identity */
html body #layout-menu,
#layout-menu.bg-menu-theme {
  background-color: #ffffff !important;
  border-left: 1px solid #e5ebf5 !important;
  box-shadow: -4px 0 20px rgba(58, 53, 65, 0.05) !important;
}

html.dark-style body #layout-menu,
html.dark-style #layout-menu.bg-menu-theme {
  background-color: #283144 !important;
  border-left: 1px solid #36445d !important;
  box-shadow: -4px 0 20px rgba(7, 12, 22, 0.3) !important;
}

/* Eliminate Frest's aggressive dark purple on open menu items in light mode */
html:not(.layout-menu-collapsed) .bg-menu-theme .menu-inner > .menu-item.open:not(.active),
.layout-menu-hover.layout-menu-collapsed .bg-menu-theme .menu-inner > .menu-item.open:not(.active),
html body #layout-menu .menu-inner > .menu-item.open,
html body #layout-menu .menu-inner > .menu-item.open:not(.active),
html body #layout-menu .menu-inner > .menu-item {
  background-color: transparent !important;
  background: transparent !important;
}

/* Submenu container: soft, clean, elegant */
html body #layout-menu .menu-sub,
html body #layout-menu .menu-inner > .menu-item.open > .menu-sub {
  background: #f8fafc !important;
  border: 1px solid #e8eef6 !important;
  border-radius: 0.85rem !important;
  margin: 0.35rem 0.65rem 0.5rem !important;
  padding: 0.4rem !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

html.dark-style body #layout-menu .menu-sub,
html.dark-style body #layout-menu .menu-inner > .menu-item.open > .menu-sub {
  background: #1e2636 !important;
  border-color: #334155 !important;
  box-shadow: none !important;
}

/* Submenu items */
html body #layout-menu .menu-sub .menu-item {
  margin: 0.15rem 0 !important;
}

html body #layout-menu .menu-sub .menu-link {
  padding: 0.55rem 0.85rem !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  border-radius: 0.6rem !important;
  transition: all 0.2s ease !important;
}

/* The vendor theme adds a circular marker to submenu links. In RTL it can
   overlap the Persian label, so submenu items intentionally have no marker. */
html body #layout-menu .menu-sub > .menu-item > .menu-link::before,
html body #layout-menu .menu-sub > .menu-item > .menu-link:before {
  content: none !important;
  display: none !important;
}

html body #layout-menu .menu-sub .menu-link:hover {
  background: #eef4ff !important;
  color: #2563eb !important;
  transform: translateX(-2px);
}

html body #layout-menu .menu-sub .menu-item.active > .menu-link {
  background: linear-gradient(118deg, #5a8dee, #7367f0) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(90, 141, 238, 0.3) !important;
}

html.dark-style body #layout-menu .menu-sub .menu-link {
  color: #94a3b8 !important;
}

html.dark-style body #layout-menu .menu-sub .menu-link:hover {
  background: rgba(90, 141, 238, 0.15) !important;
  color: #93c5fd !important;
}

/* Inactive main menu links */
html body #layout-menu .menu-inner > .menu-item > .menu-link {
  color: #475569 !important;
  font-weight: 650 !important;
  border-radius: 0.75rem !important;
  padding: 0.65rem 1rem !important;
  transition: all 0.2s ease !important;
}

html body #layout-menu .menu-inner > .menu-item > .menu-link:hover {
  background: #f1f5f9 !important;
  color: #2563eb !important;
}

html.dark-style body #layout-menu .menu-inner > .menu-item > .menu-link {
  color: #cbd5e1 !important;
}

html.dark-style body #layout-menu .menu-inner > .menu-item > .menu-link:hover {
  background: #334155 !important;
  color: #93c5fd !important;
}

/* Active main menu link */
html body #layout-menu .menu-inner > .menu-item.active > .menu-link,
html body #layout-menu .menu-inner .menu-item.active > .menu-link,
html body #layout-menu .menu-link.active {
  background: linear-gradient(118deg, #5a8dee, #7367f0) !important;
  color: #ffffff !important;
  font-weight: 750 !important;
  box-shadow: 0 4px 14px rgba(90, 141, 238, 0.35) !important;
}
html body #layout-menu .menu-inner > .menu-item.active > .menu-link i,
html body #layout-menu .menu-inner > .menu-item.active > .menu-link div {
  color: #ffffff !important;
}

/* Sidebar Toggle Floating Button */
.layout-menu-toggle.sidebar-toggle-btn {
  position: absolute !important;
  top: 22px !important;
  left: -13px !important;
  right: auto !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #5a8dee, #7367f0) !important;
  color: #ffffff !important;
  border: 3px solid #f8fafc !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 1060 !important;
  box-shadow: 0 2px 8px rgba(90, 141, 238, 0.35) !important;
  transition: all 0.2s ease !important;
}

.layout-menu-toggle.sidebar-toggle-btn:hover {
  transform: scale(1.1) !important;
}

.layout-menu-toggle.sidebar-toggle-btn i {
  font-size: 1.15rem !important;
  color: #ffffff !important;
  transition: transform 0.3s ease !important;
}

.layout-menu-collapsed .layout-menu-toggle.sidebar-toggle-btn i.hamyar-toggle-icon {
  transform: rotate(180deg) !important;
}

html.dark-style .layout-menu-toggle.sidebar-toggle-btn {
  border-color: #1a202c !important;
}

/* 2. Compact Modern School Header Strip */
.school-manage-header {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 1rem !important;
  padding: 0.75rem 1.25rem !important;
  box-shadow: 0 4px 18px rgba(31, 52, 89, 0.04) !important;
}

html.dark-style .school-manage-header {
  background: #283144 !important;
  border-color: #36445d !important;
  box-shadow: 0 4px 18px rgba(7, 12, 22, 0.25) !important;
}

.school-manage-header-body {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

.school-manage-avatar {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #5a8dee, #7367f0) !important;
  display: grid !important;
  place-items: center !important;
  color: #ffffff !important;
  font-size: 1.35rem !important;
  box-shadow: 0 4px 10px rgba(90, 141, 238, 0.28) !important;
}

.school-manage-header .school-name {
  color: #1e293b !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
}

html.dark-style .school-manage-header .school-name {
  color: #f1f5f9 !important;
}

.school-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0.3rem 0.65rem !important;
  border-radius: 999px !important;
}

.school-badge.city-badge {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #dbeafe !important;
}

.school-badge.year-badge {
  background: #f0fdf4 !important;
  color: #16a34a !important;
  border: 1px solid #dcfce7 !important;
}

html.dark-style .school-badge.city-badge {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #93c5fd !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}

html.dark-style .school-badge.year-badge {
  background: rgba(22, 163, 74, 0.18) !important;
  color: #86efac !important;
  border-color: rgba(22, 163, 74, 0.3) !important;
}

/* Class Students Banner Compact Polish */
.class-students-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
  padding: 0.85rem 1.25rem !important;
  margin-bottom: 1.25rem !important;
  border-radius: 1rem !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 18px rgba(31, 52, 89, 0.04) !important;
  color: #1e293b !important;
}

html.dark-style .class-students-banner {
  background: #283144 !important;
  border-color: #36445d !important;
  color: #f1f5f9 !important;
  box-shadow: 0 4px 18px rgba(7, 12, 22, 0.25) !important;
}

.class-students-banner h2 {
  color: #1e293b !important;
  font-size: 1.2rem !important;
  font-weight: 850 !important;
  margin: 0 !important;
}

html.dark-style .class-students-banner h2 {
  color: #f1f5f9 !important;
}

.class-students-banner p {
  color: #64748b !important;
  font-size: 0.85rem !important;
  margin: 0 !important;
}

html.dark-style .class-students-banner p {
  color: #94a3b8 !important;
}

.class-students-kicker {
  display: inline-block !important;
  color: #2563eb !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
}

html.dark-style .class-students-kicker {
  color: #93c5fd !important;
}

/* 3. Modern Segmented Pill Tabs (Native App Quality) */
.modern-segmented-tabs {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  background: #eef2f7 !important;
  padding: 4px !important;
  border-radius: 12px !important;
  gap: 4px !important;
  border: 1px solid #e2e8f0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
}

.modern-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 18px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  width: auto !important;
}

.modern-tab-btn:hover {
  color: #2563eb !important;
}

.modern-tab-btn.active {
  background: #ffffff !important;
  color: #1e293b !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
}

.modern-tab-btn .tab-badge {
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  background: #e2e8f0 !important;
  color: #475569 !important;
  line-height: 1.4 !important;
}

.modern-tab-btn.active .tab-badge {
  background: #5a8dee !important;
  color: #ffffff !important;
}

/* Dark Mode Segmented Tabs */
html.dark-style .modern-segmented-tabs {
  background: #1e2533 !important;
  border-color: #334155 !important;
}

html.dark-style .modern-tab-btn {
  color: #94a3b8 !important;
}

html.dark-style .modern-tab-btn:hover {
  color: #93c5fd !important;
}

html.dark-style .modern-tab-btn.active {
  background: #283144 !important;
  color: #f1f5f9 !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4) !important;
}

html.dark-style .modern-tab-btn .tab-badge {
  background: #334155 !important;
  color: #cbd5e1 !important;
}

html.dark-style .modern-tab-btn.active .tab-badge {
  background: #5a8dee !important;
  color: #ffffff !important;
}

/* 4. Context Switcher Card & Hub Card Polish */
.admin-card[data-ai-target="manager.context"] {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%) !important;
  border: 1px solid #e2eaf5 !important;
  border-radius: 1rem !important;
  box-shadow: 0 4px 18px rgba(31, 52, 89, 0.04) !important;
}

html.dark-style .admin-card[data-ai-target="manager.context"] {
  background: linear-gradient(135deg, #283144 0%, #222a3a 100%) !important;
  border-color: #36445d !important;
  box-shadow: 0 4px 18px rgba(7, 12, 22, 0.25) !important;
}

.admin-card[data-ai-target="manager.context"] .form-select {
  border-radius: 0.75rem !important;
  border-color: #dbe5f2 !important;
  font-weight: 600 !important;
}

html.dark-style .admin-card[data-ai-target="manager.context"] .form-select {
  border-color: #44536f !important;
}

/* Hub Cards Depth & Micro-interactions */
.school-hub-card {
  border: 1px solid #e8eef6 !important;
  border-radius: 1.15rem !important;
  background: #ffffff !important;
  box-shadow: 0 4px 16px rgba(31, 52, 89, 0.04) !important;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.school-hub-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 28px rgba(31, 52, 89, 0.1) !important;
  border-color: #bcd0f5 !important;
}

.school-hub-card:hover .school-hub-card-icon {
  transform: scale(1.08) !important;
}

.school-hub-card:hover .bx-chevron-left {
  transform: translateX(-4px) !important;
  color: #5a8dee !important;
}

.school-hub-card .bx-chevron-left {
  transition: transform 0.2s ease, color 0.2s ease !important;
}

html.dark-style .school-hub-card {
  background: #283144 !important;
  border-color: #36445d !important;
  box-shadow: 0 4px 16px rgba(7, 12, 22, 0.25) !important;
}

html.dark-style .school-hub-card:hover {
  border-color: #5a8dee !important;
  box-shadow: 0 12px 28px rgba(7, 12, 22, 0.45) !important;
}

/* Action buttons in tables */
.btn-icon.btn-sm {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
}

/* Student table monospace cells and search input */
.student-cell-mono {
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: #3f5576;
}

.search-input-group .form-control:focus {
  box-shadow: none !important;
  border-color: #5a8dee !important;
}

.search-input-group .input-group-text {
  border-color: #d9deea;
}

html.dark-style .student-cell-mono {
  color: #c5d2e7 !important;
}

html.dark-style .search-input-group .input-group-text,
html.dark-style .search-input-group .form-control {
  background-color: #222a3a !important;
  border-color: #36445d !important;
  color: #d8deea !important;
}

/* ═════════════════════════════════════════════════════════════════
   Manager operational analytics dashboard
   ═════════════════════════════════════════════════════════════════ */
.manager-analytics-shell {
  --analytics-ink: #172033;
  --analytics-muted: #6f7d91;
  --analytics-border: #e6ebf2;
  --analytics-surface: #ffffff;
  --analytics-soft: #f7f9fc;
  display: grid;
  gap: 1.25rem;
}

.analytics-context-card {
  position: relative;
  overflow: hidden;
  padding: 1.05rem;
  color: var(--analytics-ink);
  border: 1px solid rgba(90, 141, 238, 0.18);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 10% 0%, rgba(105, 108, 255, 0.13), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f6f9ff 58%, #f4fbff 100%);
  box-shadow: 0 12px 38px rgba(31, 52, 89, 0.07);
}

.analytics-context-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.analytics-context-icon {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  color: #ffffff;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #5a8dee, #7367f0);
  box-shadow: 0 9px 24px rgba(90, 141, 238, 0.28);
}

.analytics-context-icon i {
  font-size: 1.35rem;
}

.analytics-eyebrow,
.analytics-card-kicker {
  color: #5a8dee;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.analytics-context-intro h1 {
  margin: 0;
  color: var(--analytics-ink);
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.analytics-context-title {
  min-width: 0;
}

.analytics-context-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.analytics-selected-date {
  display: inline-flex;
  gap: 0.42rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.78rem;
  color: #41587f;
  border: 1px solid #d8e5f8;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, #edf4ff, #f7faff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-selected-date i {
  color: #5a8dee;
  font-size: 1rem;
}

.analytics-date-badge {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.8rem;
  color: #536079;
  border: 1px solid #dfe6f1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-date-badge.is-today {
  color: #15803d;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.analytics-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(222, 229, 240, 0.84);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.analytics-filter-field {
  min-width: 0;
  margin: 0;
}

.analytics-filter-field > span {
  display: flex;
  gap: 0.38rem;
  align-items: center;
  margin: 0 0.2rem 0.42rem;
  color: #526076;
  font-size: 0.76rem;
  font-weight: 800;
}

.analytics-filter-field > span i {
  color: #5a8dee;
  font-size: 1rem;
}

.analytics-filter-field .form-select,
.analytics-filter-field .form-control {
  min-height: 45px;
  color: #26344d;
  border-color: #dce4ef;
  border-radius: 0.78rem;
  background-color: #ffffff;
  font-size: 0.87rem;
  font-weight: 700;
  box-shadow: none;
}

.analytics-filter-field .form-select:focus,
.analytics-filter-field .form-control:focus {
  border-color: #8eb2f3;
  box-shadow: 0 0 0 0.18rem rgba(90, 141, 238, 0.12);
}

.analytics-date-field {
  position: relative;
}

.analytics-loading,
.analytics-error-state {
  min-height: 92px;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  color: var(--analytics-muted);
  border: 1px solid var(--analytics-border);
  border-radius: 1rem;
  background: var(--analytics-surface);
}

.analytics-error-state {
  justify-content: flex-start;
  padding: 1rem 1.1rem;
  color: #b42318;
  background: #fff8f7;
  border-color: #f5d1cc;
}

.analytics-error-state > i {
  font-size: 1.55rem;
}

.analytics-error-state > div {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 0.15rem;
}

.analytics-error-state span {
  color: #7a4a45;
  font-size: 0.82rem;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.analytics-kpi-card {
  --kpi-color: #5a8dee;
  --kpi-soft: #eef4ff;
  min-width: 0;
  min-height: 185px;
  display: flex;
  flex-direction: column;
  padding: 1.05rem;
  border: 1px solid var(--analytics-border);
  border-radius: 1.05rem;
  background: var(--analytics-surface);
  box-shadow: 0 8px 26px rgba(31, 52, 89, 0.055);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.analytics-kpi-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--kpi-color) 28%, var(--analytics-border));
  box-shadow: 0 14px 32px rgba(31, 52, 89, 0.09);
}

.analytics-kpi-card.tone-success { --kpi-color: #16a34a; --kpi-soft: #ecfdf3; }
.analytics-kpi-card.tone-primary { --kpi-color: #5a8dee; --kpi-soft: #eef4ff; }
.analytics-kpi-card.tone-danger { --kpi-color: #dc2626; --kpi-soft: #fff1f2; }
.analytics-kpi-card.tone-warning { --kpi-color: #d97706; --kpi-soft: #fff7e8; }

.analytics-kpi-head {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.analytics-kpi-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--kpi-color);
  border-radius: 0.78rem;
  background: var(--kpi-soft);
}

.analytics-kpi-icon i {
  font-size: 1.25rem;
}

.analytics-kpi-label {
  color: #59677d;
  font-size: 0.8rem;
  font-weight: 800;
}

.analytics-kpi-value {
  margin-top: 0.75rem;
  color: var(--analytics-ink);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
}

.analytics-kpi-fraction small {
  color: #8a96a8;
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0;
}

.analytics-kpi-card p {
  margin: 0.55rem 0 0;
  color: var(--analytics-muted);
  font-size: 0.76rem;
  font-weight: 620;
  line-height: 1.65;
}

.analytics-kpi-foot {
  margin-top: auto;
  padding-top: 0.65rem;
  color: #8793a4;
  font-size: 0.72rem;
  font-weight: 650;
}

.analytics-progress {
  height: 5px;
  overflow: hidden;
  margin-top: 0.7rem;
  border-radius: 999px;
  background: #edf1f6;
}

.analytics-progress > span {
  height: 100%;
  display: block;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5a8dee, #7367f0);
  transition: width 400ms ease;
}

.analytics-kpi-link {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  padding: 0.55rem 0 0;
  color: var(--kpi-color);
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 850;
  text-align: right;
}

.analytics-kpi-link:hover:not(:disabled) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.analytics-kpi-link:disabled {
  cursor: default;
  color: #16a34a;
  opacity: 1;
}

.analytics-kpi-link:focus-visible,
.analytics-context-card select:focus-visible,
.analytics-context-card input:focus-visible {
  outline: 3px solid rgba(90, 141, 238, 0.24);
  outline-offset: 2px;
}

.analytics-chart-grid {
  display: grid;
  gap: 1rem;
}

.analytics-chart-grid-primary {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
}

.analytics-chart-card,
.analytics-pending-panel {
  min-width: 0;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--analytics-border);
  border-radius: 1.05rem;
  background: var(--analytics-surface);
  box-shadow: 0 8px 26px rgba(31, 52, 89, 0.05);
}

.analytics-card-heading {
  min-height: 42px;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.analytics-card-heading h2 {
  margin: 0.15rem 0 0;
  color: var(--analytics-ink);
  font-size: 1rem;
  font-weight: 900;
}

.analytics-card-note {
  padding: 0.38rem 0.65rem;
  color: #708097;
  border-radius: 999px;
  background: var(--analytics-soft);
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.analytics-chart {
  width: 100%;
  min-height: 250px;
}

.analytics-grade-card .analytics-chart {
  min-height: 220px;
}

.analytics-empty-chart {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  color: #8a96a8;
  border: 1px dashed #d9e1eb;
  border-radius: 0.9rem;
  background: #fbfcfe;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.analytics-empty-chart.compact {
  min-height: 145px;
}

.analytics-empty-chart i {
  color: #aab5c5;
  font-size: 2.1rem;
}

.analytics-pending-panel {
  border-color: #f4d7a4;
  background: linear-gradient(180deg, #fffdf8, #ffffff);
}

.analytics-pending-panel .analytics-card-kicker {
  color: #c26b05;
}

.analytics-pending-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  max-height: 310px;
  overflow-y: auto;
  padding-left: 0.2rem;
}

.analytics-pending-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.72rem;
  border: 1px solid #f1e2c9;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.86);
}

.analytics-pending-avatar {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  color: #c26b05;
  border-radius: 0.7rem;
  background: #fff4df;
}

.analytics-pending-item strong,
.analytics-pending-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-pending-item strong {
  color: var(--analytics-ink);
  font-size: 0.79rem;
  font-weight: 850;
}

.analytics-pending-item div > span,
.analytics-pending-item small {
  color: var(--analytics-muted);
  font-size: 0.69rem;
  font-weight: 650;
}

.analytics-pending-item small {
  max-width: 150px;
  text-align: left;
}

html.dark-style .manager-analytics-shell {
  --analytics-ink: #f1f4f9;
  --analytics-muted: #a7b0c1;
  --analytics-border: #3a4358;
  --analytics-surface: #283144;
  --analytics-soft: #222a3a;
}

html.dark-style .analytics-context-card {
  border-color: #3c4a66;
  background:
    radial-gradient(circle at 10% 0%, rgba(90, 141, 238, 0.2), transparent 36%),
    linear-gradient(135deg, #283144, #222a3a);
  box-shadow: 0 12px 38px rgba(5, 10, 20, 0.28);
}

html.dark-style .analytics-filter-grid {
  border-color: #3a465f;
  background: rgba(25, 32, 46, 0.58);
}

html.dark-style .analytics-filter-field > span,
html.dark-style .analytics-kpi-label {
  color: #b8c1d0;
}

html.dark-style .analytics-filter-field .form-select,
html.dark-style .analytics-filter-field .form-control {
  color: #eef2f8;
  border-color: #44516b;
  background-color: #202838;
}

html.dark-style .analytics-date-badge {
  color: #c3cad6;
  border-color: #44516b;
  background: rgba(32, 40, 56, 0.8);
}

html.dark-style .analytics-date-badge.is-today {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(22, 163, 74, 0.14);
}

html.dark-style .analytics-selected-date {
  color: #dbeafe;
  border-color: #405170;
  background: linear-gradient(135deg, rgba(45, 75, 120, 0.46), rgba(32, 40, 56, 0.84));
  box-shadow: none;
}

html.dark-style .analytics-kpi-card,
html.dark-style .analytics-chart-card {
  box-shadow: 0 10px 26px rgba(5, 10, 20, 0.22);
}

html.dark-style .analytics-kpi-card.tone-success { --kpi-soft: rgba(22, 163, 74, 0.16); }
html.dark-style .analytics-kpi-card.tone-primary { --kpi-soft: rgba(90, 141, 238, 0.17); }
html.dark-style .analytics-kpi-card.tone-danger { --kpi-soft: rgba(220, 38, 38, 0.16); }
html.dark-style .analytics-kpi-card.tone-warning { --kpi-soft: rgba(217, 119, 6, 0.16); }

html.dark-style .analytics-progress {
  background: #3a4358;
}

html.dark-style .analytics-empty-chart {
  color: #9ca6b7;
  border-color: #46516a;
  background: #222a3a;
}

html.dark-style .analytics-pending-panel {
  border-color: rgba(217, 119, 6, 0.32);
  background: linear-gradient(180deg, rgba(72, 49, 20, 0.42), #283144);
}

html.dark-style .analytics-pending-item {
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(32, 40, 56, 0.72);
}

html.dark-style .analytics-pending-avatar {
  color: #fbbf24;
  background: rgba(217, 119, 6, 0.16);
}

html.dark-style .analytics-error-state {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.2);
}

html.dark-style .analytics-error-state span {
  color: #fca5a5;
}

@media (max-width: 1199.98px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-chart-grid-primary {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  }
}

@media (max-width: 991.98px) {
  .analytics-filter-grid,
  .analytics-chart-grid-primary {
    grid-template-columns: 1fr;
  }

  .analytics-pending-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .manager-analytics-shell {
    gap: 0.9rem;
  }

  .analytics-context-card,
  .analytics-chart-card,
  .analytics-pending-panel {
    padding: 0.9rem;
    border-radius: 0.95rem;
  }

  .analytics-context-intro {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .analytics-context-icon {
    width: 2.75rem;
    height: 2.75rem;
  }

  .analytics-context-meta {
    grid-column: 1 / -1;
    justify-self: start;
    flex-wrap: wrap;
  }

  .analytics-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
  }

  .analytics-kpi-card {
    min-height: 178px;
    padding: 0.85rem;
  }

  .analytics-kpi-value {
    font-size: 1.65rem;
  }

  .analytics-kpi-label,
  .analytics-kpi-card p,
  .analytics-kpi-link {
    font-size: 0.68rem;
  }

  .analytics-card-heading {
    flex-wrap: wrap;
  }

  .analytics-pending-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .analytics-pending-item small {
    grid-column: 2;
    max-width: none;
    text-align: right;
  }
}

@media (max-width: 390px) {
  .analytics-kpi-grid {
    grid-template-columns: 1fr;
  }

  .analytics-kpi-card {
    min-height: 165px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-kpi-card,
  .analytics-progress > span {
    transition: none !important;
  }
}

/* Progressive dashboard loading */
.manager-initial-skeleton,
.analytics-content-skeleton {
  display: grid;
  gap: 1rem;
}

.manager-initial-skeleton {
  padding: 1.35rem;
  border: 1px solid #e6ebf2;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, #ffffff, #f7f9fd);
  box-shadow: 0 12px 38px rgba(31, 52, 89, 0.06);
}

.skeleton-block {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0.65rem;
  background: #e9edf4;
}

.skeleton-block::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: manager-skeleton-shimmer 1.35s ease-in-out infinite;
}

@keyframes manager-skeleton-shimmer {
  100% { transform: translateX(-100%); }
}

.analytics-skeleton-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.skeleton-icon {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 1rem;
}

.skeleton-icon.small {
  width: 2.35rem;
  height: 2.35rem;
}

.skeleton-line {
  height: 0.7rem;
  margin-bottom: 0.55rem;
}

.skeleton-line.short { width: 28%; }
.skeleton-line.medium { width: 58%; }
.skeleton-line.title { width: 42%; height: 1.25rem; }
.skeleton-number { width: 34%; height: 2rem; margin: 0.9rem 0 0.65rem; }

.analytics-skeleton-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: 1rem;
  background: rgba(245, 248, 252, 0.85);
}

.skeleton-field {
  height: 4.2rem;
}

.analytics-skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.analytics-skeleton-card,
.analytics-skeleton-chart {
  padding: 1.05rem;
  border: 1px solid #e6ebf2;
  border-radius: 1.05rem;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 52, 89, 0.045);
}

.analytics-skeleton-card {
  min-height: 185px;
}

.analytics-skeleton-periods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #e6ebf2;
  border-radius: 1.05rem;
  background: #ffffff;
}

.skeleton-period {
  height: 104px;
}

.analytics-skeleton-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 1rem;
}

.skeleton-chart-body {
  height: 250px;
  margin-top: 1rem;
}

/* Per-period attendance control */
.analytics-period-section {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--analytics-border);
  border-radius: 1.05rem;
  background: var(--analytics-surface);
  box-shadow: 0 8px 26px rgba(31, 52, 89, 0.05);
}

.analytics-period-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.analytics-period-card {
  --period-color: #dc2626;
  --period-soft: #fff1f2;
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  padding: 0.85rem;
  color: var(--analytics-ink);
  border: 1px solid color-mix(in srgb, var(--period-color) 20%, var(--analytics-border));
  border-radius: 0.95rem;
  background: linear-gradient(145deg, var(--analytics-surface), var(--period-soft));
  font-family: inherit;
  text-align: right;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.analytics-period-card.is-complete {
  --period-color: #16a34a;
  --period-soft: #f0fdf4;
}

.analytics-period-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--period-color) 44%, var(--analytics-border));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--period-color) 12%, transparent);
}

.analytics-period-card:focus-visible,
.analytics-modal-close:focus-visible {
  outline: 3px solid rgba(90, 141, 238, 0.25);
  outline-offset: 2px;
}

.analytics-period-status {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  color: var(--period-color);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--period-color) 12%, transparent);
}

.analytics-period-main {
  min-width: 0;
}

.analytics-period-main strong,
.analytics-period-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-period-main strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.analytics-period-main small,
.analytics-period-caption {
  color: var(--analytics-muted);
  font-size: 0.65rem;
  font-weight: 650;
}

.analytics-period-count {
  color: var(--period-color);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.analytics-period-count b {
  font-size: 1rem;
  font-weight: 900;
}

.analytics-period-progress {
  height: 4px;
  overflow: hidden;
  grid-column: 1 / -1;
  border-radius: 999px;
  background: color-mix(in srgb, var(--period-color) 12%, #e9edf4);
}

.analytics-period-progress > span {
  height: 100%;
  display: block;
  max-width: 100%;
  border-radius: inherit;
  background: var(--period-color);
}

.analytics-period-caption {
  grid-column: 1 / 3;
  color: var(--period-color);
  font-weight: 800;
}

.analytics-period-arrow {
  justify-self: end;
  color: var(--period-color);
}

.analytics-period-empty {
  min-height: 92px;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  color: var(--analytics-muted);
  border: 1px dashed var(--analytics-border);
  border-radius: 0.9rem;
  background: var(--analytics-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.analytics-period-empty i {
  font-size: 1.3rem;
}

/* Period details modal */
.analytics-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1095;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 20, 34, 0.55);
  backdrop-filter: blur(5px);
}

.analytics-period-modal {
  width: min(860px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--analytics-ink);
  border: 1px solid var(--analytics-border);
  border-radius: 1.25rem;
  background: var(--analytics-surface);
  box-shadow: 0 26px 80px rgba(8, 18, 36, 0.28);
  animation: analytics-modal-enter 180ms ease-out;
}

@keyframes analytics-modal-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.analytics-period-modal-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.2rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--analytics-border);
}

.analytics-period-modal-header h2 {
  margin: 0.15rem 0 0.25rem;
  color: var(--analytics-ink);
  font-size: 1.2rem;
  font-weight: 900;
}

.analytics-period-modal-header p {
  margin: 0;
  color: var(--analytics-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.analytics-modal-close {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--analytics-muted);
  border: 0;
  border-radius: 0.75rem;
  background: var(--analytics-soft);
  font-size: 1.25rem;
}

.analytics-period-modal-summary {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem;
  background: var(--analytics-soft);
}

.analytics-period-modal-summary span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
}

.summary-complete { color: #15803d; background: #dcfce7; }
.summary-pending { color: #b42318; background: #fee2e2; }

.analytics-period-detail-list {
  display: grid;
  gap: 0.65rem;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.analytics-period-detail-item {
  --detail-color: #dc2626;
  display: grid;
  grid-template-columns: auto minmax(130px, 1.1fr) minmax(130px, 1fr) minmax(135px, 0.9fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--detail-color) 18%, var(--analytics-border));
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--detail-color) 4%, var(--analytics-surface));
}

.analytics-period-detail-item.is-complete {
  --detail-color: #16a34a;
}

.detail-status-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  color: var(--detail-color);
  border-radius: 50%;
  background: color-mix(in srgb, var(--detail-color) 12%, transparent);
}

.detail-class-info,
.detail-teacher-info,
.detail-record-info {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.detail-class-info strong,
.detail-teacher-info strong,
.detail-record-info strong,
.detail-class-info span,
.detail-teacher-info span,
.detail-record-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-class-info strong,
.detail-teacher-info strong,
.detail-record-info strong {
  color: var(--analytics-ink);
  font-size: 0.77rem;
  font-weight: 850;
}

.detail-class-info span,
.detail-teacher-info span,
.detail-record-info span {
  color: var(--analytics-muted);
  font-size: 0.66rem;
  font-weight: 650;
}

.detail-record-info strong {
  color: var(--detail-color);
}

/* Pending attendance modal */
.analytics-pending-modal {
  width: min(820px, 100%);
}

.analytics-pending-modal-header {
  position: relative;
  padding: 1.25rem 1.35rem;
  background:
    radial-gradient(circle at 12% 15%, rgba(245, 158, 11, 0.13), transparent 34%),
    linear-gradient(135deg, #fffaf2 0%, var(--analytics-surface) 70%);
}

.pending-modal-heading {
  min-width: 0;
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.pending-modal-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #c96800;
  border: 1px solid #fed7aa;
  border-radius: 1rem;
  background: #fff0d5;
  box-shadow: 0 8px 24px rgba(194, 107, 5, 0.13);
  font-size: 1.45rem;
}

.pending-modal-heading .analytics-card-kicker {
  color: #c26400;
}

.pending-modal-overview {
  display: grid;
  grid-template-columns: 1.15fr repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.9rem 1.35rem;
  border-bottom: 1px solid var(--analytics-border);
  background: var(--analytics-soft);
}

.pending-overview-primary,
.pending-overview-stat {
  min-height: 72px;
  display: flex;
  align-items: center;
  border-radius: 0.9rem;
}

.pending-overview-primary {
  justify-content: space-between;
  padding: 0.85rem 1rem;
  color: #8a3c00;
  border: 1px solid #fed7aa;
  background: linear-gradient(135deg, #fff4df, #fffbf3);
}

.pending-overview-primary span {
  font-size: 0.76rem;
  font-weight: 800;
}

.pending-overview-primary strong {
  font-size: 1.75rem;
  font-weight: 950;
  line-height: 1;
}

.pending-overview-stat {
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--analytics-border);
  background: var(--analytics-surface);
}

.pending-overview-stat > i {
  width: 2rem;
  height: 2rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #64748b;
  border-radius: 0.65rem;
  background: var(--analytics-soft);
  font-size: 1.05rem;
}

.pending-overview-stat div {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.pending-overview-stat strong {
  color: var(--analytics-ink);
  font-size: 1rem;
  font-weight: 900;
}

.pending-overview-stat span {
  overflow: hidden;
  color: var(--analytics-muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-pending-modal .analytics-pending-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 1rem 1.35rem;
  scrollbar-gutter: stable;
}

.analytics-pending-modal .analytics-pending-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--analytics-border);
  border-radius: 0.95rem;
  background: var(--analytics-surface);
  box-shadow: 0 5px 16px rgba(31, 52, 89, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.analytics-pending-modal .analytics-pending-item::before {
  position: absolute;
  top: 0.75rem;
  right: 0;
  bottom: 0.75rem;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: #f59e0b;
  content: "";
}

.analytics-pending-modal .analytics-pending-item:hover {
  border-color: #f4c77e;
  box-shadow: 0 9px 24px rgba(124, 74, 7, 0.09);
  transform: translateY(-1px);
}

.analytics-pending-modal .analytics-pending-avatar {
  width: 2.65rem;
  height: 2.65rem;
  color: #c96800;
  border: 1px solid #fed7aa;
  border-radius: 0.85rem;
  background: #fff4df;
  font-size: 1.2rem;
}

.pending-class-identity {
  min-width: 0;
  display: grid;
  gap: 0.38rem;
}

.pending-class-title-row {
  min-width: 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.analytics-pending-modal .pending-class-title-row strong {
  color: var(--analytics-ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.pending-subject-badge {
  max-width: 180px;
  overflow: hidden;
  padding: 0.24rem 0.48rem;
  color: #475569;
  border-radius: 999px;
  background: var(--analytics-soft);
  font-size: 0.62rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-teacher-name {
  display: inline-flex !important;
  gap: 0.3rem;
  align-items: center;
  color: var(--analytics-muted) !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
}

.pending-time-block {
  min-width: 150px;
  display: grid;
  gap: 0.3rem;
  justify-items: end;
  text-align: left;
}

.pending-time-block span,
.pending-time-block strong {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  white-space: nowrap;
}

.pending-time-block span {
  color: var(--analytics-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.pending-time-block strong {
  color: #c2410c;
  font-size: 0.68rem;
  font-weight: 850;
}

.pending-modal-footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--analytics-border);
  background: var(--analytics-soft);
}

.pending-modal-footer p {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
  color: var(--analytics-muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.pending-modal-footer .btn {
  flex: 0 0 auto;
  min-width: 108px;
  border-radius: 0.75rem;
  font-weight: 800;
}

html.dark-style .analytics-pending-modal-header {
  background:
    radial-gradient(circle at 12% 15%, rgba(245, 158, 11, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(82, 53, 16, 0.38), var(--analytics-surface) 70%);
}

html.dark-style .pending-modal-icon,
html.dark-style .analytics-pending-modal .analytics-pending-avatar {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(217, 119, 6, 0.15);
}

html.dark-style .pending-overview-primary {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(120, 65, 8, 0.2);
}

html.dark-style .pending-subject-badge {
  color: #cbd5e1;
}

@media (max-width: 720px) {
  .pending-modal-overview {
    grid-template-columns: 1fr 1fr;
  }

  .pending-overview-primary {
    grid-column: 1 / -1;
  }

  .analytics-pending-modal .analytics-pending-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pending-time-block {
    grid-column: 2;
    min-width: 0;
    justify-items: start;
    text-align: right;
  }
}

@media (max-width: 520px) {
  .analytics-pending-modal-header,
  .pending-modal-overview,
  .analytics-pending-modal .analytics-pending-list,
  .pending-modal-footer {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .pending-modal-icon {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 0.8rem;
    font-size: 1.2rem;
  }

  .pending-modal-overview {
    grid-template-columns: 1fr;
  }

  .pending-overview-primary {
    grid-column: auto;
  }

  .pending-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pending-modal-footer .btn {
    width: 100%;
  }
}

html.dark-style .manager-initial-skeleton,
html.dark-style .analytics-skeleton-card,
html.dark-style .analytics-skeleton-periods,
html.dark-style .analytics-skeleton-chart {
  border-color: #3a4358;
  background: #283144;
}

html.dark-style .analytics-skeleton-filters {
  background: #222a3a;
}

html.dark-style .skeleton-block {
  background: #3a4358;
}

html.dark-style .skeleton-block::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

html.dark-style .analytics-period-card {
  --period-soft: rgba(220, 38, 38, 0.12);
}

html.dark-style .analytics-period-card.is-complete {
  --period-soft: rgba(22, 163, 74, 0.12);
}

html.dark-style .summary-complete { color: #86efac; background: rgba(22, 163, 74, 0.16); }
html.dark-style .summary-pending { color: #fca5a5; background: rgba(220, 38, 38, 0.16); }

@media (max-width: 1199.98px) {
  .analytics-skeleton-kpis,
  .analytics-period-grid,
  .analytics-skeleton-periods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .analytics-skeleton-charts,
  .analytics-skeleton-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .analytics-period-detail-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .detail-teacher-info {
    grid-column: 2;
  }

  .detail-record-info {
    grid-column: 3;
    grid-row: 1 / span 2;
    text-align: left;
  }
}

@media (max-width: 575.98px) {
  .manager-initial-skeleton {
    padding: 0.9rem;
  }

  .analytics-period-section {
    padding: 0.9rem;
  }

  .analytics-period-grid,
  .analytics-skeleton-periods {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .analytics-period-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .analytics-period-count {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .analytics-period-modal {
    max-height: 90vh;
    border-radius: 1rem;
  }

  .analytics-period-modal-header,
  .analytics-period-detail-list {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .analytics-period-modal-summary {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .analytics-period-detail-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .detail-record-info {
    grid-column: 2;
    grid-row: auto;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block::after,
  .analytics-period-modal {
    animation: none !important;
  }
}

html.dark-style .table-light th {
  background-color: #222a3a !important;
  color: #a1b0cb !important;
  border-color: #36445d !important;
}

/* Report readability in the manager dark theme. */
    html.dark-style .hm-report-page { --report-ink:#e1e7f1; --report-muted:#a4b1c4; }
    html.dark-style .hm-report-page .report-hero { background:#28354b !important; border-color:#3b4b65 !important; }
    html.dark-style .hm-report-page .report-hero h3,html.dark-style .hm-report-page .report-results-card h5,html.dark-style .hm-report-page .report-metric-card h4 { color:#e1e7f1; }
    html.dark-style .report-table-scroll,html.dark-style .report-metric-card { border-color:#3b4b65 !important; }
    html.dark-style .report-table thead th { background:#2c3b53; color:#c2cde0; }
    html.dark-style .report-table td { color:#dce5f3; border-color:#3b4b65; }
    html.dark-style .hm-report-page .report-table tbody tr:nth-child(even) { background:#28354b; }
    html.dark-style .hm-report-page .report-table tbody tr:hover { background:#32415a; }
    html.dark-style .hm-report-page .report-eyebrow,html.dark-style .hm-report-page .report-filter-card .form-label { color:#b7c7de; }
    html.dark-style .hm-report-page .report-filter-card .btn-outline-primary { color:#a9caff; border-color:#6a94d0; }
    html.dark-style .hm-report-page .hm-bar { background:#3b4b65; }
    html.dark-style .hm-report-page .report-table td { background:transparent; }

/* Weekly workspace: use the same layout in both manager themes. */
html.dark-style .weekly-workspace {
    --week-surface: #28354b;
    --week-tint: #2c3b53;
    --week-border: #3b4b65;
    --week-ink: #e1e7f1;
    --week-muted: #a4b1c4;
}
html.dark-style .weekly-workspace .weekly-heading-icon { background: #364766; color: #a9caff; }
html.dark-style .weekly-workspace .weekly-bell { background: #293e42; border-color: #46645f; }
html.dark-style .weekly-workspace .weekly-bell.is-split { background: #433c32; border-color: #685b44; }
html.dark-style .weekly-workspace .weekly-bell-time { background: #ffffff08; color: #b4c6df; border-color: #46645f; }
html.dark-style .weekly-workspace .weekly-bell.is-split .weekly-bell-time { border-color: #685b44; }
html.dark-style .weekly-workspace .weekly-segment { color: #e2bc86; }
html.dark-style .weekly-workspace .weekly-lesson + .weekly-lesson { border-color: #685b44; }
