/* Oliy Maktab Unified Design System
   Combines Soliq Oliy Maktabi Portal + SaaS Dashboard + Mobile PWA Simulator
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --navy: #0F2557;
  --navy-light: #1B3A7A;
  --blue-primary: #1D61E7;
  --blue-hover: #154EC2;
  --gold: #C9A24B;
  --gold-light: #F6EEDC;
  --bg-main: #F4F6FA;
  --card-bg: #FFFFFF;
  --text-primary: #132244;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  
  --status-ok-bg: #DCFCE7;
  --status-ok-color: #15803D;
  --status-warn-bg: #FEF3C7;
  --status-warn-color: #B45309;
  --status-err-bg: #FEE2E2;
  --status-err-color: #B91C1C;
  --status-blue-bg: #E0F2FE;
  --status-blue-color: #0369A1;
}

/* GLOBAL SCROLLBAR HIDING (CLEAN NATIVE APP UI) WHILE KEEPING MOUSE WHEEL SCROLLING */
html,
body,
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html, body {
  scroll-behavior: smooth;
}

/* DARK MODE OVERRIDES */
body.dark-mode {
  --bg-main: #0B1226; /* Premium Space Dark Blue */
  --card-bg: #151F38; /* Navy Blue Card Background */
  --text-primary: #F8FAFC;
  --text-muted: #94A3B8;
  --border-color: #243256;
  --navy: #38BDF8;
}

body.dark-mode .main-header {
  background: transparent !important;
}

body.dark-mode .top-header-card,
body.dark-mode .sidebar,
body.dark-mode .data-card,
body.dark-mode .stat-pill-card,
body.dark-mode .profile-dropdown-card,
body.dark-mode .sidebar-footer-pill {
  background: #151F38 !important;
  color: #F8FAFC !important;
  border-color: #243256 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .brand-title {
  color: #FFFFFF !important;
}

body.dark-mode .brand-subtitle {
  color: #94A3B8 !important;
}

body.dark-mode .top-header-card {
  border-color: #243256 !important;
}

body.dark-mode .custom-table th {
  background: #0B1226 !important;
  color: #94A3B8 !important;
}

body.dark-mode .custom-table td {
  border-color: #243256 !important;
  color: #F8FAFC !important;
}

body.dark-mode .nav-group-header {
  color: #E2E8F0 !important;
}

body.dark-mode .nav-sub-item {
  color: #94A3B8 !important;
}

body.dark-mode .nav-sub-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #FFFFFF !important;
}

body.dark-mode .nav-sub-item.active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #FFFFFF !important;
  border-left: 3px solid #38BDF8 !important;
}

body.dark-mode .nav-group-items {
  background: rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .dropdown-item {
  color: #E2E8F0 !important;
}

body.dark-mode .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #38BDF8 !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

/* ACCESSIBILITY DYNAMIC BODY CLASSES */
body.acc-font-lg {
  font-size: 115% !important;
}

body.acc-font-xl {
  font-size: 130% !important;
}

body.acc-monochrome {
  filter: grayscale(100%) contrast(140%) !important;
}

body.acc-high-contrast {
  background: #000000 !important;
  color: #FFFF00 !important;
}

body.acc-high-contrast .top-header-card,
body.acc-high-contrast .sidebar,
body.acc-high-contrast .data-card,
body.acc-high-contrast .stat-pill-card,
body.acc-high-contrast .program-card {
  background: #111111 !important;
  color: #FFFF00 !important;
  border: 2px solid #FFFF00 !important;
}

body.acc-high-contrast a,
body.acc-high-contrast .brand-title,
body.acc-high-contrast .page-title,
body.acc-high-contrast .stat-pill-value {
  color: #FFFF00 !important;
}

/* HEADER BAR */
.main-header {
  background: transparent;
  padding: 16px 32px 8px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* FLOATING SHAFFOF GLASSMORPHISM HEADER CARD */
.top-header-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  border-radius: 20px;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  position: relative;
  transition: all 0.25s ease;
}

body.dark-mode .top-header-card {
  background: rgba(15, 23, 42, 0.82) !important;
  backdrop-filter: blur(24px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35) !important;
}

/* Brand Box Inside Card */
.brand-container-inside {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 44px;
  width: auto;
  border-radius: 6px;
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* USER PROFILE & HEADER CONTROLS */
.header-right-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* ACCESSIBILITY BUTTON & DROPDOWN PANEL */
.accessibility-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #1D61E7;
  cursor: pointer;
  transition: all 0.15s ease;
}

.accessibility-btn:hover {
  background: #1D61E7;
  color: #FFFFFF;
  transform: scale(1.08);
}

.accessibility-dropdown-card {
  position: absolute;
  top: calc(100% + 12px);
  right: 140px;
  width: 320px;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  padding: 20px;
  z-index: 1000;
  display: none;
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.accessibility-dropdown-card.show {
  display: block;
}

.acc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 16px;
}

.acc-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.acc-header-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.acc-header-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.acc-section {
  margin-bottom: 16px;
}

.acc-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.acc-segmented-control {
  display: flex;
  background: #F1F5F9;
  padding: 3px;
  border-radius: 12px;
  gap: 3px;
}

.acc-chip {
  flex: 1;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.acc-chip:hover {
  color: #1E293B;
}

.acc-chip.active {
  background: #FFFFFF;
  color: #1D61E7;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.acc-footer {
  border-top: 1px solid #F1F5F9;
  padding-top: 12px;
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.acc-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.acc-reset-btn:hover {
  background: #EFF6FF;
  color: #1D61E7;
  border-color: #DBEAFE;
}

/* LANGUAGE OPTION CARDS */
.lang-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #F8FAFC;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.lang-option-card:hover {
  background: #EFF6FF;
  border-color: #1D61E7;
  transform: translateY(-1px);
}

/* NOTIFICATIONS DROPDOWN CARD */
.notifications-dropdown-card {
  position: absolute;
  top: calc(100% + 12px);
  right: 180px;
  width: 340px;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  padding: 18px;
  z-index: 1000;
  display: none;
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.notifications-dropdown-card.show {
  display: block;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 12px;
}

.notif-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #FEF3C7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-header-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.notif-header-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.notif-item:hover {
  background: #EFF6FF;
  border-color: #DBEAFE;
}

.notif-item.unread {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.notif-icon.blue { background: #DBEAFE; color: #1D61E7; }
.notif-icon.green { background: #DCFCE7; color: #15803D; }
.notif-icon.warn { background: #FEF3C7; color: #B45309; }

.notif-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.notif-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.25;
}

.notif-desc {
  font-size: 11.5px;
  color: #475569;
  margin-top: 2px;
  line-height: 1.3;
}

.notif-time {
  font-size: 10.5px;
  color: #94A3B8;
  font-weight: 600;
  margin-top: 4px;
}

.notif-footer {
  border-top: 1px solid #F1F5F9;
  padding-top: 10px;
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.notif-clear-btn {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  color: #1D61E7;
  cursor: pointer;
}

.notif-clear-btn:hover {
  text-decoration: underline;
}

/* Notification Bell */
.notification-bell-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #475569;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
}

.notification-bell-btn:hover {
  background: #F1F5F9;
}

.bell-unread-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  border: 2px solid #FFFFFF;
}

/* Language Selector */
.lang-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.lang-selector-btn:hover {
  background: #F1F5F9;
}

.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

/* User Profile Trigger */
.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 30px;
  transition: background 0.15s ease;
}

.user-profile-trigger:hover {
  background: #F1F5F9;
}

.user-name-text {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
  letter-spacing: 0.2px;
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  position: relative;
}

.online-status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid #FFFFFF;
}

/* PROFILE DROPDOWN MENU CARD */
.profile-dropdown-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 20px;
  width: 240px;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  padding: 8px 0;
  z-index: 1000;
  display: none;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-card.show {
  display: block;
}

.dropdown-user-header {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.dropdown-user-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--navy);
}

.dropdown-user-role {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background 0.12s ease;
  text-decoration: none;
}

.dropdown-item:hover {
  background: #F8FAFC;
  color: var(--blue-primary);
}

.dropdown-item .item-icon {
  font-size: 16px;
  color: #64748B;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* SAAS LAYOUT WITH SMOOTH COLLAPSE TRANSITION */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 76px);
  transition: grid-template-columns 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.collapsed-layout {
  grid-template-columns: 84px 1fr;
}

/* SIDEBAR FLOATING SHAFFOF GLASS CARD */
.sidebar {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  padding: 20px 14px;
  margin-left: 32px;
  margin-top: 10px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - 110px);
  position: sticky;
  top: 90px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease, margin 0.25s ease;
}

/* Sidebar Top Header Click Area (Clean empty top card space) */
.sidebar-header-card {
  height: 20px;
  width: 100%;
  cursor: pointer;
  margin-bottom: 12px;
  border-radius: 8px;
  transition: background 0.15s ease;
  background: transparent;
}

.sidebar-header-card:hover {
  background: #F1F5F9;
}

/* Navigation List inside Sidebar */
.nav-accordion {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  scroll-behavior: smooth;
}

.nav-accordion::-webkit-scrollbar {
  width: 5px;
}

.nav-accordion::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.nav-accordion::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Section Label above groups (legacy, kept for any unconverted labels) */
.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
  margin: 10px 10px 4px;
  transition: opacity 0.2s ease;
}

/* Collapsible Nav Group (accordion category) */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155; /* Dark Slate visible text */
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-group-header span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-header:hover {
  background: #F1F5F9;
  color: #1D61E7;
}

.nav-chevron {
  flex-shrink: 0;
  font-size: 13px;
  color: #94A3B8;
  transition: transform 0.2s ease;
}

.nav-group.open > .nav-group-header .nav-chevron {
  transform: rotate(90deg);
  color: #1D61E7;
}

.nav-group.open > .nav-group-header {
  color: #1D61E7;
}

.nav-group-items {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  background: #F8FAFC; /* Light gray background for nested items */
  border-radius: 8px;
  margin-top: 2px;
  overflow: hidden;
}

.nav-group.open > .nav-group-items {
  display: flex;
}

/* Sub-item Row with Blue Left Accent Border */
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569; /* Dark Slate visible text */
  cursor: pointer;
  transition: all 0.12s ease;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-sub-item:hover {
  background: #EFF6FF;
  color: #1D61E7;
}

.nav-sub-item.active {
  background: #EFF6FF;
  color: #1D61E7;
  font-weight: 700;
  border-left: 3px solid #1D61E7;
}

.sub-bullet {
  font-size: 16px;
  color: #1D61E7; /* High contrast blue icons */
  flex-shrink: 0;
}

/* COLLAPSED SIDEBAR MODE (ICON RAIL) */
.sidebar.collapsed {
  padding: 16px 10px;
  margin-left: 16px;
  width: 80px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-header-card {
  height: 28px;
  margin-bottom: 16px;
  background: #F1F5F9;
  border-radius: 8px;
}

.sidebar.collapsed .sidebar-header-card:hover {
  background: #DBEAFE;
}

/* Hide section labels, chevrons and sub-items in collapsed mode */
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .nav-group-items,
.sidebar.collapsed .nav-chevron {
  display: none !important;
}

/* Show main group headers as clean icon buttons */
.sidebar.collapsed .nav-group {
  margin-bottom: 6px;
}

.sidebar.collapsed .nav-group-header {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar.collapsed .nav-group-header:hover {
  background: #F1F5F9;
  transform: scale(1.05);
}

.sidebar.collapsed .nav-group.open .nav-group-header,
.sidebar.collapsed .nav-group-header.active,
.sidebar.collapsed .nav-group:has(.nav-sub-item.active) .nav-group-header {
  background: #EFF6FF;
  box-shadow: inset 0 0 0 2px #1D61E7;
}

/* Display ONLY the leading emoji icon from header text */
.sidebar.collapsed .nav-group-header span:first-child {
  display: inline-block !important;
  width: 28px !important;
  max-width: 28px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  font-size: 20px !important;
  line-height: 1 !important;
  text-align: center !important;
  text-overflow: clip !important;
}

/* MAIN CONTENT AREA */
.main-viewport {
  padding: 24px 32px 24px 24px;
  width: 100%;
  max-width: 100%;
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* BUTTONS */
.btn-primary {
  background: var(--blue-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--blue-hover);
}

.btn-secondary {
  background: #F1F5F9;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--blue-primary);
  color: #FFFFFF;
  border-color: var(--blue-primary);
}

/* STAT PILLS GRID */
.stat-pills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-pill-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-pill-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}

.stat-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: #F8FAFC;
}

.stat-pill-card.blue .stat-icon-wrapper { background: var(--status-blue-bg); color: var(--status-blue-color); }
.stat-pill-card.green .stat-icon-wrapper { background: var(--status-ok-bg); color: var(--status-ok-color); }
.stat-pill-card.warn .stat-icon-wrapper { background: var(--status-warn-bg); color: var(--status-warn-color); }

.stat-pill-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

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

/* TABS ROW */
.tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  padding-bottom: 8px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
}

.tab-btn.active {
  background: var(--status-blue-bg);
  color: var(--blue-primary);
  font-weight: 700;
}

/* DATA TABLE CARD */
.data-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  overflow: hidden;
}

.table-controls {
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.search-input-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  width: 280px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.custom-table th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

/* BADGES & TAGS */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-tag.ok { background: var(--status-ok-bg); color: var(--status-ok-color); }
.status-tag.warn { background: var(--status-warn-bg); color: var(--status-warn-color); }
.status-tag.err { background: var(--status-err-bg); color: var(--status-err-color); }
.status-tag.blue { background: var(--status-blue-bg); color: var(--status-blue-color); }

/* HERO PROGRAM CARDS */
.hero-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.program-card {
  background: var(--navy);
  color: #FFFFFF;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.program-card:hover {
  transform: translateY(-3px);
  background: var(--navy-light);
}

.program-card .icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.program-card h4 {
  font-size: 15px;
  font-weight: 700;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .hero-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* FLOATING DRAGGABLE AI WIDGET */
.floating-widget-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  touch-action: none;
  user-select: none;
}

.floating-buttons-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.float-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: grab;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  text-decoration: none;
}

.float-btn:active {
  cursor: grabbing;
}

.float-btn.telegram {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #0088cc, #00A6FF);
  box-shadow: 0 8px 20px rgba(0, 136, 204, 0.35);
}

.float-btn.telegram:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 136, 204, 0.45);
}

.float-btn.ai-bot {
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
}

.float-btn.ai-bot:hover {
  transform: scale(1.12);
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.55);
}

.ai-bot-icon {
  font-size: 26px;
}

.pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.6);
  animation: pulseExpand 2s infinite;
  pointer-events: none;
}

@keyframes pulseExpand {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* FLOATING AI CHAT CARD */
.floating-ai-chat-card {
  width: 350px;
  height: 460px;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 20px 45px rgba(15, 37, 87, 0.3);
  border: 1px solid var(--border-color);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpPopup 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10001;
}

@keyframes slideUpPopup {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.floating-ai-chat-card.show {
  display: flex;
}

.floating-ai-header {
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.floating-ai-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.4;
  max-width: 85%;
}

.ai-msg.bot {
  background: #FFFFFF;
  color: #1E293B;
  border: 1px solid var(--border-color);
  align-self: flex-start;
}

.ai-msg.user {
  background: #7C3AED;
  color: #FFFFFF;
  align-self: flex-end;
}

.floating-ai-chips {
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
}

.floating-ai-chips button {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}

.floating-ai-chips button:hover {
  background: #EFF6FF;
  color: #4F46E5;
  border-color: #C7D2FE;
}

.floating-ai-input-row {
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
}

.floating-ai-input-row input {
  flex: 1;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  font-size: 12.5px;
  background: #F8FAFC;
}

.floating-ai-input-row button {
  background: #7C3AED;
  color: #FFF;
  border: none;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
