/**
 * نظام الأوامر التقنية لإدارة الموارد البشرية والرواتب (TC-HRMS Enterprise)
 * نظام التصميم الفائق ومعايير Apple Design للواجهات العربية RTL
 * Liquid Glass Materials + Spring Physics + Fluid Optical Typography
 */

/* Google Fonts is preconnected and loaded asynchronously in layout templates for ultra-fast rendering */

:root {
  /* ألوان النظام المرجعية التنفيذية - الهوية العنابية الملكية الفاخرة (Executive Plum) */
  --primary: #5d255d;
  --primary-hover: #431844;
  --primary-light: rgba(93, 37, 93, 0.10);
  --primary-gradient: linear-gradient(135deg, #5d255d 0%, #431844 100%);
  --accent-ai: #7c3aed;
  --accent-cyan: #0284c7;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0284c7;
  --purple: #8b5cf6;

  /* خلفيات وسطوح الوضع المضيء (Light Glass) */
  --bg-app: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.78);
  --bg-glass-heavy: rgba(255, 255, 255, 0.90);
  --border-glass: rgba(255, 255, 255, 0.60);
  --border-subtle: rgba(226, 232, 240, 0.80);
  --shadow-glass: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
  --shadow-floating: 0 20px 40px -15px rgba(0, 0, 0, 0.12), 0 0 1px 1px rgba(255, 255, 255, 0.8) inset;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;

  --sidebar-w: 270px;
  --sidebar-compact-w: 74px;
  --header-h: 70px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --primary: #c084fc;
  --primary-hover: #d8b4fe;
  --primary-light: rgba(192, 132, 252, 0.15);
  --primary-gradient: linear-gradient(135deg, #7e22ce 0%, #581c87 100%);

  --bg-app: #090d16;
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-heavy: rgba(15, 23, 42, 0.92);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(51, 65, 85, 0.60);
  --shadow-glass: 0 10px 35px -10px rgba(0, 0, 0, 0.6), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-floating: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.1) inset;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
}

[data-theme="semi-dark"] {
  --bg-app: #0f172a;
  --bg-glass: rgba(30, 41, 59, 0.82);
  --bg-glass-heavy: rgba(30, 41, 59, 0.95);
  --border-glass: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
}

/* التصفير العام وضبط الخط والاتجاه */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 300ms ease, color 300ms ease;
}

/* Unified SVG icon language: crisp, accessible and consistent across the system. */
.tc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.tc-icon svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tc-icon-inline {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.18em;
  margin-inline: 0.1em;
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.sidebar-link.active .nav-icon {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.app-header {
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.app-main-content {
  max-width: 1680px;
}

.dashboard-welcome,
.stats-grid,
.dashboard-grid {
  gap: 18px !important;
}

button,
a,
input,
select,
textarea {
  font-family: inherit;
}

/* Employee self-service profile */
.profile-settings-page {
  max-width: 1320px;
  margin: 0 auto;
}

.settings-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 4px 28px;
}

.settings-hero h1 {
  margin: 8px 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -.04em;
}

.settings-hero p,
.eyebrow {
  color: var(--text-muted);
  font-weight: 600;
}

.eyebrow {
  color: var(--primary);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.settings-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.settings-summary {
  padding: 26px 20px;
  text-align: center;
  position: sticky;
  top: 20px;
}

.profile-avatar-wrap {
  width: 112px;
  height: 112px;
  margin: 0 auto 16px;
  position: relative;
}

.profile-avatar-large,
.profile-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  object-fit: cover;
  border: 4px solid var(--bg-glass-heavy);
  box-shadow: 0 10px 25px rgba(15, 23, 42, .16);
}

.profile-status-dot {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 17px;
  height: 17px;
  border: 3px solid var(--bg-glass-heavy);
  background: var(--success);
  border-radius: 50%;
}

.settings-summary h2 {
  font-size: 1.08rem;
  margin-bottom: 4px;
}

.settings-summary>p {
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 22px;
}

.summary-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  text-align: right;
  font-size: .78rem;
}

.summary-meta span {
  color: var(--text-muted);
}

.summary-meta strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-block {
  margin: 18px 0;
  padding: 14px;
  background: var(--primary-light);
  border-radius: 16px;
  text-align: right;
}

.completion-block>div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 800;
  color: var(--primary);
}

.progress-track {
  height: 7px;
  margin: 10px 0 7px;
  overflow: hidden;
  background: rgba(148, 163, 184, .25);
  border-radius: 99px;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--primary));
  border-radius: inherit;
}

.completion-block small {
  color: var(--text-muted);
  font-size: .68rem;
  line-height: 1.6;
}

.settings-nav {
  display: grid;
  gap: 4px;
  text-align: right;
}

.settings-nav a {
  padding: 10px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 800;
}

.settings-nav a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.settings-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.settings-card {
  padding: clamp(20px, 3vw, 30px);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-heading h2 {
  font-size: 1.05rem;
  margin-bottom: 3px;
}

.section-heading p {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--primary);
  background: var(--primary-light);
}

.section-icon svg {
  width: 21px;
  height: 21px;
}

.form-grid {
  display: grid;
  gap: 17px;
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 13px;
  outline: none;
  background: var(--bg-glass-heavy);
  color: var(--text-main);
  transition: border-color .18s, box-shadow .18s;
}

.form-grid textarea {
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.notice-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 12px 14px;
  color: var(--text-muted);
  background: rgba(16, 185, 129, .09);
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 700;
}

.notice-line svg {
  width: 17px;
  color: var(--success);
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 22px;
}

.photo-upload-row small {
  display: block;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: .72rem;
}

.upload-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border: 1px dashed var(--primary);
  color: var(--primary);
  border-radius: 12px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 800;
}

.upload-control input {
  display: none;
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding-bottom: 24px;
}

.settings-actions svg {
  width: 17px;
}

.empty-state {
  color: var(--text-muted);
  padding: 20px;
  text-align: center;
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-summary {
    position: static;
  }

  .settings-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .settings-hero {
    display: grid;
    align-items: start;
  }

  .form-grid-3,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .photo-upload-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-actions {
    justify-content: stretch;
  }

  .settings-actions .apple-btn {
    flex: 1;
  }
}

/* خلفية الجزيئات الحركية الناعمة */
.dynamic-particles-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 15% 20%, rgba(30, 58, 138, 0.05), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(124, 58, 237, 0.04), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(2, 132, 199, 0.03), transparent 60%);
}

.site-background-media {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: #0b1224;
}

.site-background-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .70;
  filter: saturate(.82) contrast(1.02) brightness(.74);
}

.site-background-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 45, var(--site-overlay-opacity, .42));
}

.site-background-media~.dynamic-particles-bg {
  background: transparent;
}

html[data-site-video="off"] .site-background-media {
  display: none;
}

html[data-site-video="off"] .site-background-media~.dynamic-particles-bg {
  background: var(--surface-0);
}

.site-background-media~.app-main-content .apple-card,
.site-background-media~.app-main-content .surface-card,
.site-background-media~.app-main-content .app-header {
  border-color: rgba(255, 255, 255, .38);
  box-shadow: 0 14px 36px rgba(2, 8, 23, .14);
}

.appearance-settings-card {
  max-width: 900px;
  padding: 28px;
}

.appearance-settings-card .settings-form {
  display: grid;
  gap: 20px;
}

.appearance-current-video {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-glass);
  color: var(--primary);
}

.appearance-current-video svg {
  width: 22px;
  flex: 0 0 auto;
}

.appearance-current-video strong,
.appearance-current-video small {
  display: block;
}

.appearance-current-video strong {
  color: var(--text-main);
  font-size: .82rem;
}

.appearance-current-video small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: .68rem;
  overflow-wrap: anywhere;
}

.site-background-media {
  z-index: 0;
}

.site-background-media~.dynamic-particles-bg {
  z-index: 1;
}

.site-background-media~.app-main-content {
  z-index: 2;
}

.site-background-media~.app-sidebar {
  z-index: 100;
}

/* ألواح الزجاج السائل Apple Liquid Glass */
.apple-card,
.liquid-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), box-shadow 200ms ease;
}

.apple-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-floating);
}

/* الأزرار التفاعلية باستجابة فيزيائية فورية */
.apple-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: transform 120ms cubic-bezier(0.2, 0, 0, 1), background-color 150ms ease, box-shadow 150ms ease;
  user-select: none;
  will-change: transform;
}

.apple-btn:active {
  transform: scale(0.96);
}

.apple-btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 rgba(30, 58, 138, 0.35);
}

.apple-btn-primary:hover {
  box-shadow: 0 6px 20px 0 rgba(30, 58, 138, 0.45);
}

.apple-btn-ai {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.35);
}

.apple-btn-secondary {
  background: var(--bg-glass-heavy);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.apple-btn-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   شريط التنقل الجانبي الفاخر RTL Sidebar (Liquid Glass & macOS Architecture)
   -------------------------------------------------------------------------- */
.app-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-w, 270px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(36px) saturate(210%);
  -webkit-backdrop-filter: blur(36px) saturate(210%);
  border-left: 1px solid rgba(226, 232, 240, 0.75);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  box-shadow: -4px 0 28px rgba(15, 23, 42, 0.04);
  transition: width 240ms cubic-bezier(0.16, 1, 0.3, 1), transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* رأس الشريط وشعار المنظومة */
.sidebar-brand-wrapper {
  padding: 20px 18px 14px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  background: linear-gradient(180deg, rgba(93, 37, 93, 0.04) 0%, transparent 100%);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  transition: transform 160ms ease;
}

.sidebar-brand:hover {
  transform: translateY(-1px);
}

.brand-logo-frame {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #ffffff 0%, rgba(245, 243, 246, 0.9) 100%);
  border: 1.5px solid rgba(93, 37, 93, 0.18);
  box-shadow: 0 4px 14px rgba(67, 24, 68, 0.10), inset 0 1px 1px #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo {
  height: 30px;
  width: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.brand-status-beacon {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-text h2 {
  margin: 0;
  font-size: 1.10rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #431844 0%, #5d255d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.25;
}

.brand-subtag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: #5d255d !important;
  background: rgba(93, 37, 93, 0.08);
  border: 1px solid rgba(93, 37, 93, 0.18);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-top: 3px;
  width: fit-content;
}

/* حقل التصفية السريعة للقائمة */
.sidebar-filter-wrapper {
  padding: 12px 16px 8px 16px;
  flex-shrink: 0;
}

.sidebar-filter-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(241, 245, 249, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 10px;
  padding: 2px 10px;
  transition: all 180ms ease;
}

.sidebar-filter-box:focus-within {
  background: #ffffff;
  border-color: #5d255d;
  box-shadow: 0 0 0 3px rgba(93, 37, 93, 0.14);
}

.sidebar-filter-icon {
  width: 15px;
  height: 15px;
  color: var(--text-sub, #94a3b8);
  flex-shrink: 0;
  margin-left: 8px;
}

.sidebar-filter-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main, #0f172a);
  outline: none;
  font-family: inherit;
}

.sidebar-filter-input::placeholder {
  color: var(--text-sub, #94a3b8);
  font-weight: 500;
}

.sidebar-filter-clear {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-sub, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-filter-clear svg {
  width: 13px;
  height: 13px;
}

/* حاوية التمرير الانسيابي */
.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 20px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.sidebar-nav-scroll::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 10px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

/* تسميات الأقسام والتصنيفات */
.sidebar-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px 12px;
  color: #5d255d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-section-label-spaced {
  margin-top: 14px;
}

.section-count-tag {
  background: rgba(93, 37, 93, 0.09);
  color: #5d255d;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 20px;
  border: 1px solid rgba(93, 37, 93, 0.14);
}

/* قوائم الروابط */
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav-item {
  position: relative;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  color: #334155;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.sidebar-link:hover {
  background: rgba(93, 37, 93, 0.08);
  color: #431844;
  transform: translateX(-3px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, #431844 0%, #5d255d 65%, #7e2d7e 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(67, 24, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
  transform: translateX(-2px);
}

/* مؤشر النشاط المضيء للرابط الفعال */
.sidebar-active-indicator {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, #f59e0b, #ec4899);
  border-radius: 4px 0 0 4px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.85);
}

.sidebar-link.active .sidebar-active-indicator {
  display: block;
}

/* كبسولة أيقونة التنقل */
.sidebar-link .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(93, 37, 93, 0.07);
  color: #5d255d;
  flex-shrink: 0;
  transition: all 180ms ease;
}

.sidebar-link:hover .nav-icon {
  background: rgba(93, 37, 93, 0.15);
  color: #431844;
}

.sidebar-link.active .nav-icon {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.sidebar-link .nav-icon i,
.sidebar-link .nav-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

.sidebar-link .nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

/* الشارات الحية المدمجة مع البنود */
.sidebar-item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
  margin-right: auto;
  flex-shrink: 0;
}

.sidebar-link.active .sidebar-item-badge {
  background: #ffffff;
  color: #ef4444;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sidebar-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: auto;
  flex-shrink: 0;
}

.sidebar-item-dot.dot-online {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* حالة عدم العثور على نتائج في تصفية القائمة */
.sidebar-filter-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-sub, #94a3b8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.sidebar-filter-empty svg {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

/* بطاقة المستخدم السفلية الفاخرة العائمة */
.sidebar-account-container {
  padding: 12px 14px 16px 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.sidebar-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  transition: all 180ms ease;
}

.sidebar-account-card:hover {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.sidebar-account-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  flex: 1;
}

.sidebar-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.sidebar-account-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-active-ping {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
}

.sidebar-user-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 0.80rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.sidebar-user-role {
  font-size: 0.68rem;
  color: var(--text-sub, #64748b);
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.sidebar-logout-form {
  margin: 0;
  padding: 0;
  display: flex;
}

.sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  cursor: pointer;
  transition: all 180ms ease;
}

.sidebar-logout-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.sidebar-logout-btn svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   وضع القائمة الجانبية المصغرة - أيقونات فقط (Compact Icon Dock Mode)
   -------------------------------------------------------------------------- */
body.sidebar-compact .app-sidebar {
  width: var(--sidebar-compact-w, 74px) !important;
  padding: 0 !important;
  overflow-x: hidden;
}

body.sidebar-compact .sidebar-brand-wrapper {
  padding: 16px 8px !important;
}

body.sidebar-compact .sidebar-brand {
  justify-content: center !important;
  gap: 0 !important;
}

body.sidebar-compact .brand-logo-frame {
  width: 42px !important;
  height: 42px !important;
}

body.sidebar-compact .brand-text,
body.sidebar-compact .sidebar-filter-wrapper,
body.sidebar-compact .sidebar-section-label,
body.sidebar-compact .sidebar-user-details,
body.sidebar-compact .sidebar-logout-form {
  display: none !important;
}

body.sidebar-compact .sidebar-nav-scroll {
  padding: 10px 8px !important;
}

body.sidebar-compact .sidebar-link {
  justify-content: center !important;
  padding: 11px 0 !important;
  border-radius: 12px !important;
  gap: 0 !important;
  position: relative;
  text-align: center;
}

body.sidebar-compact .sidebar-link .nav-label,
body.sidebar-compact .sidebar-link .sidebar-item-dot,
body.sidebar-compact .sidebar-active-indicator {
  display: none !important;
}

body.sidebar-compact .sidebar-link .nav-icon {
  margin: 0 !important;
  width: 38px !important;
  height: 38px !important;
}

body.sidebar-compact .sidebar-link .nav-icon i,
body.sidebar-compact .sidebar-link .nav-icon svg {
  width: 20px !important;
  height: 20px !important;
}

body.sidebar-compact .sidebar-link .sidebar-item-badge {
  position: absolute;
  top: 4px;
  left: 8px;
  min-width: 16px;
  height: 16px;
  font-size: 0.60rem;
  padding: 0 4px;
}

body.sidebar-compact .sidebar-account-container {
  padding: 12px 8px !important;
}

body.sidebar-compact .sidebar-account-card {
  padding: 6px 0 !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.sidebar-compact .sidebar-account-info {
  justify-content: center !important;
}

body.sidebar-compact .sidebar-account-avatar {
  width: 40px !important;
  height: 40px !important;
}

/* تلميح أنيق عائم عند التحويم على الأيقونة في الوضع المصغر */
body.sidebar-compact .sidebar-link:hover::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: tooltipFlyIn 140ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tooltipFlyIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(6px);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

html[data-theme="dark"] body.sidebar-compact .sidebar-link:hover::after {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

/* --------------------------------------------------------------------------
   أنماط الوضع الليلي للشريط الجانبي (Dark Mode Sidebar Contract)
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .app-sidebar {
  background: rgba(11, 18, 32, 0.92) !important;
  border-left-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: -6px 0 35px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .sidebar-brand-wrapper {
  border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}

html[data-theme="dark"] .brand-logo-frame {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.8)) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] .brand-text h2 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .brand-text span {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .sidebar-filter-box {
  background: rgba(15, 23, 42, 0.7) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .sidebar-filter-box:focus-within {
  background: rgba(24, 36, 56, 0.95) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html[data-theme="dark"] .sidebar-filter-input {
  color: #f8fafc !important;
}

html[data-theme="dark"] .sidebar-section-label {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .section-count-tag {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .sidebar-link {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .sidebar-link:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .sidebar-link.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4) !important;
}

html[data-theme="dark"] .sidebar-link .nav-icon {
  background: rgba(30, 41, 59, 0.7) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .sidebar-link:hover .nav-icon {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #38bdf8 !important;
}

html[data-theme="dark"] .sidebar-link.active .nav-icon {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .sidebar-account-container {
  background: rgba(15, 23, 42, 0.8) !important;
  border-top-color: rgba(148, 163, 184, 0.14) !important;
}

html[data-theme="dark"] .sidebar-account-card {
  background: rgba(24, 36, 56, 0.8) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .sidebar-account-card:hover {
  background: rgba(30, 46, 72, 0.9) !important;
}

html[data-theme="dark"] .sidebar-user-name {
  color: #f8fafc !important;
}

html[data-theme="dark"] .sidebar-user-role {
  color: #94a3b8 !important;
}


/* المحتوى الرئيسي والهيدر العلوي */
.app-main-content {
  margin-right: var(--sidebar-w);
  padding: 24px 32px 85px 32px;
  min-height: 100vh;
  transition: margin-right 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-compact .app-main-content,
body.sidebar-collapsed .app-main-content {
  margin-right: var(--sidebar-compact-w, 74px) !important;
}

.app-header {
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-glass);
}

.header-user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

/* بطاقات الإحصائيات (KPI Metric Cards) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-title {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.kpi-val {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-icon-box {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* الجداول الفاخرة */
.apple-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.apple-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.apple-table th {
  padding: 16px 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.90rem;
  border-bottom: 1px solid var(--border-subtle);
}

.apple-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.92rem;
  font-weight: 600;
}

.apple-table tr:hover td {
  background: rgba(30, 58, 138, 0.03);
}

/* شارات الحالة (Pill Badges) */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.80rem;
  font-weight: 800;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

/* نافذة المساعد الذكي العائم المنبثقة (Floating AI Modal) */
.ai-floating-widget {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 999;
}

.ai-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), box-shadow 200ms ease;
}

.ai-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.55);
}

.ai-chat-window {
  position: fixed;
  bottom: 95px;
  left: 28px;
  width: 440px;
  height: 620px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 1px 1px rgba(255, 255, 255, 0.15) inset;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1200;
  transform-origin: bottom left;
  animation: springPopup 350ms cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
  transition: width 300ms cubic-bezier(0.16, 1, 0.3, 1), height 300ms cubic-bezier(0.16, 1, 0.3, 1), transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.expanded {
  width: 820px !important;
  height: 84vh !important;
  max-height: 880px !important;
  max-width: calc(100vw - 48px) !important;
  bottom: 35px !important;
  left: 35px !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.15) inset !important;
}

.ai-chat-window.expanded .ai-prompt-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
}

.ai-chat-window.expanded .ai-msg-bubble {
  font-size: 0.98rem !important;
  padding: 14px 18px !important;
  line-height: 1.7 !important;
}

@keyframes springPopup {
  0% {
    transform: scale(0.6) translateY(40px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.ai-chat-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ai-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-icon-button {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-icon-button:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.ai-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-glass);
}

/* فقاعات محادثة المساعد الذكي والجداول التفاعلية */
.ai-msg-bubble {
  max-width: 90%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.84rem;
  line-height: 1.65;
  word-break: break-word;
  animation: fadeInMsg 250ms ease forwards;
}

@keyframes fadeInMsg {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-msg-bubble.msg-user {
  align-self: flex-start;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.ai-msg-bubble.msg-ai {
  align-self: flex-end;
  background: var(--bg-card, rgba(255, 255, 255, 0.9));
  color: var(--text-main, #1e293b);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.3));
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .ai-msg-bubble.msg-ai {
  background: rgba(30, 41, 59, 0.9);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.1);
}

.ai-msg-bubble.msg-blocked {
  border: 1px solid #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.ai-msg-bubble p.ai-p {
  margin: 0 0 6px 0;
}

.ai-msg-bubble p.ai-p:last-child {
  margin-bottom: 0;
}

.ai-spacer {
  height: 8px;
}

.ai-h3,
.ai-h4,
.ai-h5 {
  font-weight: 800;
  margin: 8px 0 4px 0;
  color: var(--primary, #7c3aed);
}

.ai-list-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.ai-bullet {
  color: var(--primary, #7c3aed);
  font-weight: 900;
}

.ai-num-bullet {
  color: var(--primary, #7c3aed);
  font-weight: 800;
  font-size: 0.8rem;
}

.ai-code {
  display: inline-block;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary, #7c3aed);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(124, 58, 237, 0.25);
  cursor: pointer;
  transition: all 150ms ease;
  margin: 1px 2px;
}

.ai-code:hover {
  background: var(--primary, #7c3aed);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.ai-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary, #7c3aed);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid rgba(124, 58, 237, 0.25);
  transition: all 180ms ease;
  margin: 3px 2px;
}

.ai-link:hover {
  background: var(--primary, #7c3aed);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}

.ai-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 10px 0;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}

.ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  text-align: right;
}

.ai-table th {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(99, 102, 241, 0.08));
  color: var(--text-main, #1e293b);
  font-weight: 800;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.1));
  white-space: nowrap;
}

.ai-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.05));
  white-space: nowrap;
}

.ai-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .ai-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-style: italic;
  color: var(--text-muted, #64748b);
  font-size: 0.8rem;
}

.ai-typing-indicator span {
  animation: blink 1.2s infinite both;
  font-weight: 900;
  font-size: 1.1rem;
}

.ai-typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% {
    opacity: 0.2;
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0.2;
  }
}

/* درج تخصيص المظهر (Theme Drawer) */
.theme-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid var(--border-glass);
  box-shadow: var(--shadow-floating);
  z-index: 1100;
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.2, 0, 0, 1);
  padding: 24px;
  overflow-y: auto;
}

.theme-drawer.open {
  transform: translateX(0);
}

/* استجابة الشاشات الصغيرة والتطبيقات المتنقلة */
@media (max-width: 992px) {
  .app-sidebar {
    transform: translateX(100%);
    transition: transform 250ms ease;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-main-content {
    margin-right: 0;
    padding: 16px;
  }

  .ai-chat-window {
    width: calc(100vw - 32px);
    left: 16px;
    bottom: 80px;
    height: 70vh;
  }
}


/* --------------------------------------------------------------------------
   TC-HRMS UI refinement layer: consistent shell, icons, ESS and accessibility
   -------------------------------------------------------------------------- */
.header-leading,
.header-actions,
.header-identity,
.header-user-badge,
.header-shortcut,
.header-theme-button,
.sidebar-account-copy,
.sidebar-logout,
.flash-content,
.section-heading,
.settings-hero-actions,
.document-upload-actions,
.document-row,
.document-row-copy,
.ai-chat-title,
.ai-input-shell,
.ai-security-note {
  display: flex;
  align-items: center;
}

.header-leading {
  gap: 14px;
  min-width: 0;
}

.header-actions {
  gap: 12px;
  min-width: 0;
}

.header-identity {
  gap: 10px;
  min-width: 0;
}

.header-identity-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-light);
}

.header-identity-icon svg {
  width: 19px;
  height: 19px;
}

.header-identity strong,
.header-identity span,
.header-user-copy strong,
.header-user-copy span {
  display: block;
}

.header-identity strong {
  font-size: .94rem;
  font-weight: 900;
  white-space: nowrap;
}

.header-identity span {
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
  margin-top: 2px;
}

.header-shortcut {
  gap: 7px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 10px;
}

.header-shortcut:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.header-shortcut svg,
.header-theme-button svg {
  width: 17px;
  height: 17px;
}

.header-theme-button {
  gap: 7px;
  padding: 9px 13px;
  border-radius: 11px;
  font-size: .78rem;
}

.header-user-copy {
  text-align: right;
  min-width: 0;
}

.header-user-copy strong {
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.header-menu-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 180ms ease;
}

.header-menu-toggle.active,
body.sidebar-compact .header-menu-toggle,
body.sidebar-collapsed .header-menu-toggle {
  background: var(--primary, #2563eb) !important;
  color: #ffffff !important;
  border-color: var(--primary, #2563eb) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32) !important;
}

.header-menu-toggle svg,
.header-menu-toggle i {
  width: 19px;
  height: 19px;
}

.flash-content {
  gap: 9px;
  font-weight: 800;
  font-size: .86rem;
}

.flash-icon {
  display: inline-flex;
  color: var(--primary);
}

.flash-icon svg,
.alert-close svg {
  width: 17px;
  height: 17px;
}

.alert-close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.alert-close:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.settings-hero-copy {
  min-width: 0;
}

.settings-hero-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.apple-btn-quiet {
  color: var(--text-muted);
  background: transparent;
  padding-inline: 12px;
}

.apple-btn-quiet:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.settings-content-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.settings-card {
  overflow: hidden;
}

.section-heading {
  gap: 12px;
}

.section-heading>div {
  min-width: 0;
  flex: 1;
}

.section-heading h2 {
  font-weight: 900;
}

.readonly-chip,
.documents-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 900;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 9px;
}

.readonly-chip svg {
  width: 12px;
  height: 12px;
}

.status-text-success {
  color: var(--success);
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.overview-item {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: var(--bg-glass-heavy);
}

.overview-item span,
.overview-item strong {
  display: block;
}

.overview-item span {
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.overview-item strong {
  font-size: .82rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-nav svg {
  width: 15px;
  height: 15px;
}

.form-grid label {
  line-height: 1.4;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 46px;
  font-size: .84rem;
}

.form-grid textarea {
  min-height: 112px;
}

.photo-upload-copy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-upload-copy small {
  flex-basis: 100%;
  margin-top: 0;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .76rem;
  font-weight: 800;
  padding: 8px;
  border-radius: 8px;
}

.text-button:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.text-button svg {
  width: 15px;
  height: 15px;
}

.empty-state {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.empty-state svg {
  width: 18px;
  height: 18px;
  color: var(--text-sub);
}

.document-upload-form {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 15px;
  background: var(--bg-app);
}

.document-upload-form .form-grid {
  gap: 13px;
}

.document-upload-form input,
.document-upload-form select {
  background: var(--bg-glass-heavy);
}

.document-upload-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.document-upload-actions small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 700;
}

.document-upload-actions small svg {
  width: 14px;
  height: 14px;
}

.documents-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.document-row {
  gap: 11px;
  padding: 12px;
  color: var(--text-main);
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: var(--bg-glass-heavy);
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.document-row:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.document-type-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-light);
}

.document-type-icon svg,
.document-open-icon {
  width: 17px;
  height: 17px;
}

.document-row-copy {
  display: block;
  flex: 1;
  min-width: 0;
}

.document-row-copy strong,
.document-row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-row-copy strong {
  font-size: .8rem;
  font-weight: 900;
}

.document-row-copy small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
}

.document-open-icon {
  color: var(--text-muted);
}

.ai-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-toggle-btn svg {
  width: 23px;
  height: 23px;
}

.ai-chat-header,
.ai-chat-footer {
  padding: 14px 16px;
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-chat-title {
  gap: 7px;
}

.ai-chat-title strong {
  font-size: .88rem;
}

.ai-chat-title>span:last-child {
  color: rgba(255, 255, 255, .75);
  font-size: .66rem;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.ai-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.ai-icon-button:hover {
  background: rgba(255, 255, 255, .14);
}

.ai-icon-button svg {
  width: 16px;
  height: 16px;
}

.ai-suggestions-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  margin-top: 8px;
}

.ai-welcome-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, .28);
}

.ai-welcome-icon svg {
  width: 25px;
  height: 25px;
}

.ai-suggestions-box h4 {
  font-size: .98rem;
  font-weight: 900;
}

.ai-suggestions-box p {
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.6;
}

.ai-prompt-list {
  display: grid;
  width: 100%;
  gap: 7px;
  margin-top: 8px;
}

.ai-prompt-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  color: var(--text-main);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  text-align: right;
  cursor: pointer;
  font-family: inherit;
  font-size: .73rem;
  font-weight: 800;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.ai-prompt-pill:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.ai-prompt-pill svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--primary);
}

.ai-input-shell {
  gap: 6px;
  padding: 4px 5px 4px 12px;
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  background: var(--bg-glass-heavy);
}

.ai-input-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: .8rem;
}

.ai-input-shell button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
}

.ai-input-shell button:hover {
  transform: scale(1.05);
}

.ai-input-shell button svg {
  width: 15px;
  height: 15px;
}

.ai-security-note {
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 700;
}

.ai-security-note svg {
  width: 13px;
  height: 13px;
  color: var(--success);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .app-main-content {
    padding: 20px 22px;
  }

  .header-shortcut span,
  .header-theme-button span {
    display: none;
  }

  .header-shortcut,
  .header-theme-button {
    padding: 9px;
  }

  .profile-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 270px;
  }

  .app-sidebar {
    transform: translateX(110%);
    transition: transform 220ms cubic-bezier(.2, 0, 0, 1);
    box-shadow: var(--shadow-floating);
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, .28);
    backdrop-filter: blur(2px);
  }

  .app-main-content {
    margin-right: 0;
    padding: 15px;
  }

  .header-menu-toggle {
    display: inline-flex;
  }

  .app-header {
    padding: 0 15px;
    margin-bottom: 20px;
  }

  .header-identity span {
    display: none;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-summary {
    position: static;
  }

  .settings-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .settings-hero {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .app-main-content {
    padding: 10px;
  }

  .app-header {
    height: 60px;
    border-radius: 15px;
  }

  .header-identity strong {
    font-size: .78rem;
  }

  .header-user-copy {
    display: none;
  }

  .header-user-badge {
    gap: 0;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
  }

  .settings-hero {
    display: grid;
    gap: 15px;
    padding-bottom: 20px;
  }

  .settings-hero h1 {
    font-size: 1.55rem;
  }

  .settings-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-hero-actions .apple-btn {
    width: 100%;
  }

  .settings-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-overview-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .readonly-chip,
  .documents-count {
    margin-inline-start: 54px;
  }

  .form-grid-3,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .photo-upload-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo-upload-copy {
    display: grid;
    width: 100%;
  }

  .document-upload-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-upload-actions .apple-btn {
    width: 100%;
  }

  .settings-actions {
    justify-content: stretch;
  }

  .settings-actions .apple-btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-transparency: reduce) {

  .apple-card,
  .liquid-glass,
  .app-header,
  .app-sidebar {
    background: var(--bg-app);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Narrow-screen hardening: prevent RTL shell overflow and keep touch targets visible. */
@media (max-width: 600px) {

  html,
  body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .app-main-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-right: 0;
    padding: 10px;
    overflow: hidden;
  }

  .app-header {
    width: 100%;
    min-width: 0;
    gap: 8px;
    padding: 0 10px;
  }

  .header-leading,
  .header-actions {
    min-width: 0;
    gap: 6px;
  }

  .header-leading {
    flex: 1 1 auto;
  }

  .header-actions {
    flex: 0 0 auto;
  }

  .header-identity {
    min-width: 0;
    flex: 1 1 auto;
    gap: 6px;
  }

  .header-identity-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
  }

  .header-identity strong {
    display: block;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .72rem;
  }

  .header-menu-toggle {
    display: inline-flex !important;
    flex: 0 0 auto;
  }

  .header-shortcut,
  .header-theme-button {
    flex: 0 0 auto;
    padding: 7px;
  }

  .header-user-badge {
    flex: 0 0 auto;
  }

  .profile-settings-page,
  .settings-layout,
  .settings-content-column,
  .settings-card,
  .settings-hero {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .settings-hero-copy,
  .settings-hero-copy h1,
  .settings-hero-copy p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .settings-card {
    padding: 16px;
  }

  .section-heading,
  .section-heading>div {
    min-width: 0;
    max-width: 100%;
  }

  .section-heading h2,
  .section-heading p {
    overflow-wrap: anywhere;
  }

  .form-grid,
  .form-grid label,
  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    min-width: 0;
    max-width: 100%;
  }

  .settings-nav a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .header-identity>div {
    display: none;
  }

  .header-identity {
    flex: 0 0 auto;
  }

  .header-identity-icon {
    width: 32px;
    height: 32px;
  }
}

/* Enterprise control centers: AI, devices, attendance and presence */
.enterprise-page {
  position: relative;
  z-index: 1
}

.enterprise-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 190px;
  padding: 32px 36px;
  border-radius: 30px;
  color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 18px 55px rgba(30, 41, 59, .14)
}

.enterprise-hero:after {
  content: "";
  position: absolute;
  inset: auto -12% -70% 35%;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 66%);
  pointer-events: none
}

.hero-indigo {
  background: linear-gradient(135deg, #14284e, #214c88 54%, #176d80)
}

.hero-purple {
  background: linear-gradient(135deg, #261348, #5b2c85 56%, #1e6b84)
}

.hero-slate {
  background: linear-gradient(135deg, #102238, #1c4b63 58%, #116e70)
}

.enterprise-hero>div {
  position: relative;
  z-index: 1
}

.enterprise-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 900;
  letter-spacing: -.04em
}

.enterprise-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  line-height: 1.8
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .8);
  font-size: .78rem;
  font-weight: 800
}

.eyebrow svg {
  width: 17px;
  height: 17px
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 160px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .12);
  border-radius: 20px;
  font-weight: 800;
  line-height: 1.7;
  backdrop-filter: blur(12px)
}

.hero-badge svg {
  width: 31px;
  height: 31px
}

.hero-badge small {
  font-size: .72rem;
  color: rgba(255, 255, 255, .7)
}

.enterprise-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px
}

.compact-kpis .enterprise-kpi {
  min-height: 105px
}

.enterprise-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 19px;
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(148, 163, 184, .17);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06)
}

.enterprise-kpi small {
  display: block;
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 700
}

.enterprise-kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
  color: var(--text-main);
  font-weight: 900
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px
}

.kpi-icon svg {
  width: 21px;
  height: 21px
}

.kpi-icon.teal {
  color: #087f83;
  background: #dbf7f4
}

.kpi-icon.green {
  color: #16844b;
  background: #ddf8e8
}

.kpi-icon.blue {
  color: #2366c7;
  background: #e2eeff
}

.kpi-icon.amber {
  color: #a36100;
  background: #fff0cc
}

.kpi-icon.purple {
  color: #7542bb;
  background: #f0e5ff
}

.kpi-icon.red {
  color: #b72d4e;
  background: #ffe4e8
}

.info-callout {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 24px;
  padding: 15px 18px;
  border: 1px solid #cfe3f3;
  background: #f4faff;
  border-radius: 18px;
  color: #21445d
}

.info-callout>svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: #2e83b5;
  margin-top: 2px
}

.info-callout strong,
.info-callout span {
  display: block
}

.info-callout strong {
  font-size: .88rem
}

.info-callout span {
  margin-top: 3px;
  font-size: .79rem;
  line-height: 1.75;
  color: #597287
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .75fr);
  gap: 22px
}

.settings-main,
.settings-side,
.ai-side-stack {
  display: grid;
  gap: 20px;
  align-content: start
}

.surface-card {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 24px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, .06)
}

.policy-card,
.guidance-card,
.ai-config-card {
  padding: 24px
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px
}

.card-heading h2 {
  margin: 4px 0 0;
  color: var(--text-main);
  font-size: 1.12rem;
  font-weight: 900
}

.card-heading>svg {
  width: 24px;
  height: 24px;
  color: #5e64c7
}

.section-kicker {
  display: block;
  color: #78849b;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em
}

.form-grid {
  display: grid;
  gap: 14px
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr))
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #42536c;
  font-size: .76rem;
  font-weight: 800
}

.field-full {
  grid-column: 1/-1
}

.field input,
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dce4ee;
  border-radius: 13px;
  background: #fbfdff;
  color: #172b45;
  padding: 11px 12px;
  font: inherit;
  font-weight: 600;
  outline: none;
  transition: border-color .2s, box-shadow .2s
}

.field textarea {
  resize: vertical;
  line-height: 1.75
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #7886da;
  box-shadow: 0 0 0 4px rgba(100, 116, 220, .12)
}

.field small {
  font-size: .67rem;
  color: #8793a5;
  font-weight: 600
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 17px
}

.setting-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  background: #f7f9fc;
  border: 1px solid #e7edf4;
  border-radius: 15px;
  cursor: pointer
}

.setting-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none
}

.switch-ui {
  position: relative;
  width: 39px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: #cbd5e1;
  transition: .2s
}

.switch-ui:after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .17);
  transition: .2s
}

.setting-switch input:checked+.switch-ui {
  background: #38b779
}

.setting-switch input:checked+.switch-ui:after {
  right: 19px
}

.setting-switch strong,
.setting-switch small {
  display: block
}

.setting-switch strong {
  font-size: .77rem;
  color: #33445d
}

.setting-switch small {
  margin-top: 2px;
  color: #8591a3;
  font-size: .66rem
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-size: .77rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s
}

.btn:hover {
  transform: translateY(-1px)
}

.btn:disabled {
  opacity: .6;
  cursor: wait;
  transform: none
}

.btn svg {
  width: 17px;
  height: 17px
}

.btn-primary {
  background: linear-gradient(135deg, #5269d9, #7457c9);
  color: #fff;
  box-shadow: 0 8px 17px rgba(82, 105, 217, .22)
}

.btn-secondary {
  background: #f2f5fa;
  color: #53627a;
  border-color: #e0e7f0
}

.inline-status {
  font-size: .75rem;
  font-weight: 800
}

.inline-status.pending {
  color: #a16a00
}

.inline-status.success {
  color: #17824c
}

.inline-status.error {
  color: #bb3254
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 900;
  white-space: nowrap
}

.status-chip svg {
  width: 13px;
  height: 13px
}

.status-chip.success {
  color: #17804d;
  background: #ddf8e8
}

.status-chip.warning {
  color: #a36800;
  background: #fff0cf
}

.status-chip.muted {
  color: #637189;
  background: #eef2f7
}

.status-chip.danger {
  color: #b32d4c;
  background: #ffe4e9
}

.guidance-card h2 {
  margin: 12px 0 7px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 900
}

.guidance-card p {
  margin: 0;
  color: #728098;
  font-size: .78rem;
  line-height: 1.8
}

.guidance-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #5c68cf;
  background: #eeeefe;
  border-radius: 15px
}

.guidance-icon svg {
  width: 22px;
  height: 22px
}

.check-list {
  display: grid;
  gap: 10px;
  margin-top: 16px
}

.check-list span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5a6c80;
  font-size: .74rem;
  font-weight: 700
}

.check-list svg {
  width: 15px;
  height: 15px;
  color: #1d9d63
}

.branch-coordinate-list {
  display: grid;
  gap: 8px;
  margin-top: 16px
}

.coordinate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f7f9fc;
  font-size: .73rem;
  font-weight: 800;
  color: #40516a
}

.coordinate-row small {
  color: #8591a3;
  font-size: .65rem;
  font-weight: 700
}

.presence-table-card,
.ai-audit-card {
  padding: 22px
}

.table-responsive {
  overflow-x: auto
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px
}

.data-table th {
  padding: 11px 12px;
  text-align: right;
  color: #7b8799;
  background: #f7f9fc;
  border-bottom: 1px solid #e8edf4;
  font-size: .7rem;
  font-weight: 900
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #edf1f5;
  color: #45556c;
  font-size: .75rem;
  font-weight: 700;
  vertical-align: middle
}

.data-table tbody tr:last-child td {
  border-bottom: 0
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 9px
}

.person-cell img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 11px;
  background: #eef2f7
}

.person-cell strong,
.person-cell small {
  display: block
}

.person-cell strong {
  color: #283b55
}

.person-cell small {
  margin-top: 2px;
  color: #8b96a6;
  font-size: .64rem
}

.truncate-cell {
  max-width: 290px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.empty-state {
  text-align: center !important;
  padding: 35px !important;
  color: #8793a5 !important
}

.ai-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .72fr);
  gap: 22px;
  margin-bottom: 22px
}

.ai-config-card .field {
  margin-top: 15px
}

.ai-config-card .form-grid .field {
  margin-top: 0
}

.ai-audit-card {
  margin-bottom: 24px
}

.new-policy-card {
  border: 1px dashed #bfc9dc
}

.hero-slate~.enterprise-kpi-grid .kpi-icon {
  border-radius: 13px
}

@media(max-width:1050px) {
  .enterprise-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .settings-layout,
  .ai-admin-grid {
    grid-template-columns: 1fr
  }
}

@media(max-width:680px) {
  .enterprise-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 25px 21px;
    border-radius: 23px
  }

  .hero-badge {
    min-width: 0
  }

  .form-grid-2,
  .form-grid-3,
  .switch-grid {
    grid-template-columns: 1fr
  }

  .enterprise-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px
  }

  .enterprise-kpi {
    padding: 14px;
    gap: 9px
  }

  .enterprise-kpi strong {
    font-size: 1.05rem
  }

  .enterprise-kpi small {
    font-size: .65rem
  }

  .policy-card,
  .guidance-card,
  .ai-config-card,
  .presence-table-card,
  .ai-audit-card {
    padding: 17px
  }

  .card-actions {
    align-items: stretch;
    flex-direction: column
  }

  .btn {
    width: 100%
  }
}

/* Attendance automation and notification center */
.notification-shortcut {
  position: relative
}

.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: #d64562;
  font-size: .62rem;
  line-height: 1;
  font-weight: 900
}

.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  margin-bottom: 16px
}

.notification-toolbar strong,
.notification-toolbar span {
  display: block
}

.notification-toolbar strong {
  color: var(--text-main);
  font-size: .9rem;
  font-weight: 900
}

.notification-toolbar span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700
}

.notification-list {
  display: grid;
  gap: 12px
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 19px;
  transition: border-color .2s, transform .2s
}

.notification-item.is-unread {
  border-color: rgba(84, 104, 218, .44);
  box-shadow: 0 12px 34px rgba(82, 105, 217, .11)
}

.notification-item:hover {
  transform: translateY(-1px)
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  flex: 0 0 auto;
  color: #596bd2;
  background: #edf0ff;
  border-radius: 14px
}

.notification-icon svg {
  width: 20px;
  height: 20px
}

.notification-content {
  min-width: 0;
  flex: 1
}

.notification-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px
}

.notification-heading h2 {
  margin: 0;
  color: var(--text-main);
  font-size: .9rem;
  font-weight: 900
}

.notification-heading time {
  color: var(--text-muted);
  font-size: .67rem;
  font-weight: 700;
  white-space: nowrap
}

.notification-content p {
  margin: 7px 0 4px;
  color: #5e6e83;
  font-size: .78rem;
  line-height: 1.75
}

.notification-content small {
  color: #8995a7;
  font-size: .66rem;
  font-weight: 700
}

.notification-read-form {
  margin-inline-start: auto
}

.btn-ghost {
  min-width: 38px;
  padding: 8px;
  background: transparent;
  color: #6b7890;
  border-color: #e2e8f0
}

.btn-ghost:hover {
  background: #f0f3fa
}

.setting-switch-danger {
  border-color: #f3c8d0;
  background: #fff8f9
}

.setting-switch-danger input:checked+.switch-ui {
  background: #d64562
}

.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px
}

.device-actions form {
  display: inline-flex
}

.device-actions .apple-btn {
  min-height: 36px;
  padding: 8px 11px;
  font-size: .7rem
}

.device-meta {
  flex-wrap: wrap
}

.empty-state {
  padding: 42px 20px;
  text-align: center
}

.empty-state>svg {
  width: 38px;
  height: 38px;
  color: #8491a4
}

.empty-state h2,
.empty-state h3 {
  margin: 12px 0 5px;
  color: var(--text-main);
  font-weight: 900
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
  font-size: .78rem
}

@media (max-width:900px) {
  .enterprise-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .notification-toolbar {
    align-items: flex-start;
    flex-direction: column
  }

  .notification-toolbar .btn {
    width: 100%
  }
}

@media (max-width:600px) {
  .enterprise-kpi-grid {
    grid-template-columns: 1fr
  }

  .notification-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px
  }

  .notification-item {
    padding: 14px
  }

  .device-actions form {
    flex: 1 1 calc(50% - 8px)
  }

  .device-actions .apple-btn {
    width: 100%
  }
}

.device-edit-details {
  flex: 1 1 100%;
  margin-bottom: 2px
}

.device-edit-details>summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer
}

.device-edit-details>summary::-webkit-details-marker {
  display: none
}

.device-edit-form {
  width: 100%;
  padding: 15px;
  margin-top: 10px;
  background: #f7f9fc;
  border: 1px solid #e4eaf2;
  border-radius: 16px
}

.device-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #53627a;
  font-size: .7rem;
  font-weight: 800
}

.device-edit-form input,
.device-edit-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #dce4ee;
  border-radius: 10px;
  background: #fff;
  color: var(--text-main);
  font: inherit;
  font-size: .74rem
}

.device-edit-form .check-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap
}

.device-edit-form .check-row label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px
}

.device-edit-form summary svg {
  width: 15px;
  height: 15px
}


/* --------------------------------------------------------------------------
   TC-HRMS professional visual refresh: tokenized contrast and calm motion
   -------------------------------------------------------------------------- */
:root {
  --surface-0: #f4f7fb;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f8;
  --line-strong: #d7e0ea;
  --text-main: #172033;
  --text-muted: #5d6b80;
  --text-sub: #8190a4;
  --shadow-card: 0 10px 28px rgba(23, 32, 51, .07), 0 1px 2px rgba(23, 32, 51, .04);
  --shadow-card-hover: 0 16px 34px rgba(23, 32, 51, .12), 0 2px 4px rgba(23, 32, 51, .05);
}

[data-theme="dark"] {
  --surface-0: #0b1220;
  --surface-1: #121c2d;
  --surface-2: #182438;
  --surface-3: #202f46;
  --line-strong: #304159;
  --text-main: #f3f7fc;
  --text-muted: #b5c1d2;
  --text-sub: #8c9ab0;
  --bg-app: #0b1220;
  --bg-glass: rgba(18, 28, 45, .88);
  --bg-glass-heavy: rgba(18, 28, 45, .97);
  --border-glass: rgba(148, 163, 184, .18);
  --border-subtle: #304159;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-card-hover: 0 18px 42px rgba(0, 0, 0, .38), 0 2px 4px rgba(0, 0, 0, .25);
}

[data-theme="semi-dark"] {
  --surface-0: #eef3f8;
  --surface-1: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #e8eef5;
  --line-strong: #cfd9e5;
  --text-main: #182338;
  --text-muted: #53627a;
  --text-sub: #718198;
  --bg-app: #eef3f8;
  --bg-glass: rgba(255, 255, 255, .9);
  --bg-glass-heavy: rgba(255, 255, 255, .98);
}

/* Compatibility aliases for views still built on the previous token names.
   These resolve old references (--surface, --line, --text, --text-subtle)
   to the current tokenized system in every theme. */
:root,
[data-theme="dark"],
[data-theme="semi-dark"] {
  --surface: var(--surface-1);
  --line: var(--line-strong);
  --text: var(--text-main);
  --text-subtle: var(--text-sub);
}

body {
  background: var(--surface-0);
  color: var(--text-main);
}

body,
button,
input,
select,
textarea {
  color: var(--text-main);
}

::selection {
  background: var(--primary-light);
  color: var(--text-main);
}

/* Calm animated background with explicit user-controlled variants. */
.dynamic-particles-bg {
  z-index: 0;
  opacity: 1;
  overflow: hidden;
  background: var(--surface-0);
  transition: opacity .35s ease, background .35s ease;
}

.dynamic-particles-bg::before,
.dynamic-particles-bg::after {
  content: '';
  position: absolute;
  width: 52vw;
  height: 52vw;
  min-width: 360px;
  min-height: 360px;
  border-radius: 50%;
  filter: blur(16px);
  opacity: .32;
  pointer-events: none;
  animation: tcAuroraFloat 22s ease-in-out infinite alternate;
}

.dynamic-particles-bg::before {
  top: -18%;
  right: -10%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), transparent 68%);
}

.dynamic-particles-bg::after {
  bottom: -24%;
  left: -12%;
  background: radial-gradient(circle, rgba(124, 58, 237, .14), transparent 68%);
  animation-delay: -8s;
}

.dynamic-particles-bg[data-background="mesh"] {
  background-image: linear-gradient(rgba(148, 163, 184, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .055) 1px, transparent 1px);
  background-size: 34px 34px;
}

.dynamic-particles-bg[data-background="mesh"]::before {
  opacity: .18;
}

.dynamic-particles-bg[data-background="solid_gray"] {
  background: var(--surface-0);
}

.dynamic-particles-bg[data-background="solid_gray"]::before,
.dynamic-particles-bg[data-background="solid_gray"]::after,
.dynamic-particles-bg[data-background="pure_white"]::before,
.dynamic-particles-bg[data-background="pure_white"]::after {
  display: none;
}

.dynamic-particles-bg[data-background="pure_white"] {
  background: var(--surface-1);
}

html[data-motion="off"] .dynamic-particles-bg::before,
html[data-motion="off"] .dynamic-particles-bg::after {
  animation: none;
}

@keyframes tcAuroraFloat {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(.94);
  }

  50% {
    transform: translate3d(5%, 4%, 0) scale(1.06);
  }

  100% {
    transform: translate3d(-3%, 6%, 0) scale(.98);
  }
}

/* Keep the application content above the decorative layer. */
.app-sidebar,
.app-main-content {
  position: relative;
  z-index: 1;
}

.app-sidebar {
  position: fixed;
  z-index: 100;
}

.theme-drawer,
.ai-modal,
.ai-chat-window {
  position: fixed;
  z-index: 1100;
}

/* Tokenized surfaces: these overrides repair the older hard-coded light layer. */
.apple-card,
.liquid-glass,
.surface-card,
.enterprise-kpi,
.data-table-wrap,
.device-card,
.notification-item,
.ai-config-card,
.ai-audit-card,
.new-policy-card,
.info-callout,
.settings-card,
.overview-item,
.document-row,
.document-upload-form,
.profile-settings-page .settings-summary {
  background: var(--surface-1);
  color: var(--text-main);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

.apple-card:hover,
.surface-card:hover,
.enterprise-kpi:hover,
.device-card:hover,
.notification-item:hover {
  box-shadow: var(--shadow-card-hover);
}

.enterprise-kpi h2,
.enterprise-kpi h3,
.enterprise-kpi strong,
.surface-card h2,
.surface-card h3,
.surface-card strong,
.device-card h2,
.device-card h3,
.device-card strong,
.notification-heading h2,
.settings-card h2,
.settings-card h3,
.overview-item strong,
.document-row-copy strong {
  color: var(--text-main);
}

.enterprise-kpi p,
.surface-card p,
.device-card p,
.device-card small,
.enterprise-kpi small,
.field-help,
.form-help,
.data-table caption {
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea,
.form-grid input,
.form-grid select,
.form-grid textarea,
.device-edit-form input,
.device-edit-form select,
.device-edit-form textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
select,
textarea {
  background: var(--surface-2);
  color: var(--text-main);
  border-color: var(--line-strong);
}

.field label,
.field>label,
.form-grid label,
.device-edit-form label,
.setting-switch label,
.setting-switch span,
.switch-grid label {
  color: var(--text-muted);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-sub);
  opacity: 1;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-3);
  color: var(--text-sub);
}

.data-table {
  color: var(--text-main);
}

.data-table thead th,
.data-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  border-color: var(--line-strong);
}

.data-table td,
.data-table tbody td {
  color: var(--text-main);
  border-color: var(--line-strong);
}

.data-table tbody tr:hover {
  background: var(--primary-light);
}

.surface-card hr,
.settings-card hr,
.notification-toolbar,
.section-heading {
  border-color: var(--line-strong);
}

.notice-line,
.info-callout {
  color: var(--text-muted);
}

.apple-btn-secondary,
.btn-secondary,
.btn-ghost {
  background: var(--surface-2);
  color: var(--text-main);
  border-color: var(--line-strong);
}

.apple-btn-secondary:hover,
.btn-secondary:hover,
.btn-ghost:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.apple-btn-primary,
.btn-primary {
  color: #fff;
}

.status-chip,
.readonly-chip,
.documents-count {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

/* Focus and keyboard affordances. */
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 3px;
}

button:disabled,
.apple-btn:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: none;
}

/* Professional appearance drawer. */
.theme-drawer {
  width: min(390px, calc(100vw - 22px));
  padding: 24px 20px;
  background: var(--surface-1);
  border-right-color: var(--line-strong);
  color: var(--text-main);
}

.theme-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-strong);
}

.theme-drawer-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
}

.theme-drawer h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.18rem;
  font-weight: 900;
}

.theme-drawer-head p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.6;
}

.theme-close {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}

.theme-close:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.theme-close svg {
  width: 17px;
  height: 17px;
}

.theme-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line-strong);
}

.theme-section:last-of-type {
  border-bottom: 0;
}

.theme-section-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.theme-section-title>svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--primary);
}

.theme-section-title strong,
.theme-section-title small {
  display: block;
}

.theme-section-title strong {
  color: var(--text-main);
  font-size: .82rem;
  font-weight: 900;
}

.theme-section-title small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.5;
}

.theme-choice-grid {
  display: grid;
  gap: 8px;
}

.theme-choice-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.theme-choice {
  position: relative;
  cursor: pointer;
}

.theme-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-choice span {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.theme-choice:hover span,
.theme-choice input:focus-visible+span {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.theme-choice input:checked+span {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.theme-choice svg {
  width: 18px;
  height: 18px;
}

.theme-choice b {
  color: var(--text-main);
  font-size: .71rem;
  font-weight: 900;
}

.theme-choice small {
  color: var(--text-muted);
  font-size: .6rem;
  font-weight: 700;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 9px;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid transparent;
  border-radius: 11px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24), 0 4px 10px rgba(15, 23, 42, .12);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}

.color-swatch:hover {
  transform: translateY(-2px);
}

.color-swatch.active {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--swatch);
}

.theme-background-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.theme-bg-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  padding: 9px;
  text-align: right;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
}

.theme-bg-card:hover,
.theme-bg-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.theme-bg-card.active {
  box-shadow: 0 0 0 2px var(--primary-light);
}

.theme-bg-preview {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
}

.theme-bg-aurora {
  background: radial-gradient(circle at 30% 25%, #8b5cf6, transparent 45%), linear-gradient(135deg, #dbeafe, #fef3c7);
}

.theme-bg-mesh {
  background-image: linear-gradient(#cbd5e1 1px, transparent 1px), linear-gradient(90deg, #cbd5e1 1px, transparent 1px);
  background-size: 9px 9px;
  background-color: #f8fafc;
}

.theme-bg-solid {
  background: #eef3f8;
}

.theme-bg-white {
  background: #fff;
}

.theme-bg-card b {
  font-size: .68rem;
  font-weight: 900;
}

.theme-bg-card small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.4;
}

.theme-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
  cursor: pointer;
}

.theme-switch-row>span:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}

.theme-switch-row>span:first-child>svg {
  width: 17px;
  color: var(--primary);
}

.theme-switch-row b,
.theme-switch-row small {
  display: block;
}

.theme-switch-row b {
  font-size: .7rem;
  font-weight: 900;
}

.theme-switch-row small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: .6rem;
  font-weight: 700;
}

.theme-switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-switch-ui {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: var(--line-strong);
  transition: background .18s ease;
}

.theme-switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .22);
  transition: transform .18s ease;
}

.theme-switch-row input:checked+.theme-switch-ui {
  background: var(--primary);
}

.theme-switch-row input:checked+.theme-switch-ui::after {
  transform: translateX(-17px);
}

.theme-drawer-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 700;
  line-height: 1.7;
}

.theme-drawer-note svg {
  width: 16px;
  flex: 0 0 auto;
  color: var(--primary);
}

/* Video mode: translucent surfaces with a readable editorial contrast layer. */
.site-background-media~.app-sidebar,
.site-background-media~.app-main-content .app-header,
.site-background-media~.app-main-content .apple-card,
.site-background-media~.app-main-content .liquid-glass,
.site-background-media~.app-main-content .surface-card,
.site-background-media~.app-main-content .enterprise-kpi,
.site-background-media~.app-main-content .data-table-wrap,
.site-background-media~.app-main-content .device-card,
.site-background-media~.app-main-content .notification-item,
.site-background-media~.app-main-content .settings-card,
.site-background-media~.app-main-content .quick-link-card {
  background: rgba(248, 250, 252, .84);
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 45px rgba(2, 8, 23, .16), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  contain: paint;
}

.site-background-media~.app-sidebar {
  background: rgba(248, 250, 252, .84);
}

.site-background-media~.app-main-content .app-header {
  background: rgba(255, 255, 255, .72);
}

.site-background-media~.app-main-content .data-table th,
.site-background-media~.app-main-content .data-table thead th {
  background: rgba(226, 232, 240, .72);
}

.site-background-media~.app-main-content .data-table tbody tr:hover {
  background: rgba(219, 234, 254, .68);
}

.site-background-media~.app-sidebar .sidebar-link {
  background: rgba(255, 255, 255, .20);
  color: #23324d;
}

.site-background-media~.app-sidebar .sidebar-link:hover {
  background: rgba(255, 255, 255, .58);
  color: var(--primary);
}

.site-background-media~.app-sidebar .sidebar-link.active {
  background: linear-gradient(135deg, #431844 0%, #5d255d 70%, #6e2c6e 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(67, 24, 68, 0.32);
}

.site-background-media~.app-sidebar .sidebar-section-label,
.site-background-media~.app-sidebar .brand-text h2,
.site-background-media~.app-sidebar .brand-text span {
  color: #273650;
}

.site-background-media~.app-main-content .enterprise-kpi h2,
.site-background-media~.app-main-content .enterprise-kpi h3,
.site-background-media~.app-main-content .enterprise-kpi strong,
.site-background-media~.app-main-content .surface-card h2,
.site-background-media~.app-main-content .surface-card h3,
.site-background-media~.app-main-content .surface-card strong,
.site-background-media~.app-main-content .app-header strong {
  color: #172640;
}

.site-background-media~.app-main-content .enterprise-kpi p,
.site-background-media~.app-main-content .enterprise-kpi small,
.site-background-media~.app-main-content .surface-card p,
.site-background-media~.app-main-content .surface-card small {
  color: #52627a;
}

@media (max-width: 600px) {
  .theme-drawer {
    width: calc(100vw - 12px);
    padding: 20px 16px;
  }

  .theme-choice-grid-3 {
    grid-template-columns: 1fr;
  }

  .theme-choice span {
    min-height: 55px;
    display: grid;
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto;
    text-align: right;
    padding: 9px 12px;
  }

  .theme-choice svg {
    grid-row: 1 / span 2;
    align-self: center;
  }

  .theme-background-grid {
    grid-template-columns: 1fr;
  }

  .color-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {

  .dynamic-particles-bg::before,
  .dynamic-particles-bg::after {
    animation: none !important;
  }
}


/* Authentication surface refresh. */
.auth-body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #0b1224;
}

.auth-motion-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #0b1224;
  overflow: hidden;
  isolation: isolate;
}

.auth-background-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: .72;
  filter: saturate(.86) contrast(1.04) brightness(.68);
  pointer-events: none;
  transform: scale(1.015);
}

.auth-motion-bg::before,
.auth-motion-bg::after {
  content: '';
  position: absolute;
  width: 48vw;
  height: 48vw;
  min-width: 320px;
  min-height: 320px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: .34;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 24%, transparent), transparent 68%);
  animation: tcAuroraFloat 24s ease-in-out infinite alternate;
}

.auth-motion-bg::after {
  inset: 0;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  filter: none;
  opacity: 1;
  z-index: 1;
  background: linear-gradient(135deg, rgba(8, 20, 45, .58), rgba(30, 41, 59, .26) 48%, rgba(67, 35, 112, .48));
  animation: none;
}

.auth-motion-bg::before {
  top: -20%;
  right: -9%;
}

.auth-motion-bg::after {
  bottom: -22%;
  left: -12%;
  opacity: .22;
  animation-delay: -10s;
}

.auth-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 48px) 18px;
  box-sizing: border-box;
}

.auth-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 480px);
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, .34) 48%, rgba(224, 231, 255, .28));
  border: 1px solid rgba(255, 255, 255, .68);
  border-top-color: rgba(255, 255, 255, .9);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(2, 8, 23, .32), inset 0 1px 0 rgba(255, 255, 255, .72), inset 0 -1px 0 rgba(255, 255, 255, .16);
  backdrop-filter: blur(30px) saturate(155%);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle at 15% 0%, rgba(255, 255, 255, .58), transparent 34%), linear-gradient(115deg, rgba(255, 255, 255, .22), transparent 42%, rgba(147, 197, 253, .10));
  pointer-events: none;
}

.auth-card::after {
  content: '';
  position: absolute;
  top: -35%;
  left: -18%;
  width: 70%;
  height: 55%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .24);
  filter: blur(30px);
  transform: rotate(-18deg);
  pointer-events: none;
}

.auth-brand {
  margin-bottom: 27px;
  text-align: center;
}

.auth-brand h1,
.auth-field label,
.auth-label-row label {
  color: #fff;
  text-shadow: 0 2px 14px rgba(2, 8, 23, .42);
}

.auth-brand p {
  color: rgba(255, 255, 255, .86);
  text-shadow: 0 1px 10px rgba(2, 8, 23, .34);
}

.auth-eyebrow {
  color: #dbeafe;
  text-shadow: 0 1px 10px rgba(2, 8, 23, .36);
}

.auth-label-row span {
  color: rgba(255, 255, 255, .76);
}

.auth-logo-wrap {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
}

.auth-logo-wrap img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(15, 23, 42, .16));
}

.auth-eyebrow {
  display: block;
  color: var(--primary);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.auth-brand h1 {
  margin-top: 8px;
  color: var(--text-main);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -.03em;
}

.auth-brand p {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.7;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 18px;
  padding: 12px 13px;
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: 13px;
  background: rgba(239, 68, 68, .09);
  color: var(--danger);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.7;
}

.auth-alert svg {
  width: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field label,
.auth-label-row label {
  color: var(--text-main);
  font-size: .75rem;
  font-weight: 900;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-label-row span {
  color: var(--text-sub);
  font-size: .61rem;
  font-weight: 700;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 49px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 15px;
  background: rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58), 0 8px 22px rgba(30, 41, 59, .06);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

.auth-input-wrap:focus-within {
  border-color: rgba(99, 102, 241, .66);
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, .18), 0 12px 28px rgba(30, 41, 59, .10);
  transform: translateY(-1px);
}

.auth-input-wrap>svg {
  width: 17px;
  flex: 0 0 auto;
  color: var(--text-sub);
}

.auth-input-wrap:focus-within>svg {
  color: var(--primary);
}

.auth-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 45px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: .8rem;
}

.auth-input-wrap input::placeholder {
  color: var(--text-sub);
}

.auth-input-wrap input {
  color: #14213d;
  text-shadow: none;
}

.auth-password-toggle {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-password-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.auth-password-toggle svg {
  width: 16px;
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
  border-radius: 13px;
  font-size: .82rem;
}

.auth-demo {
  margin-top: 25px;
  padding-top: 19px;
  border-top: 1px solid var(--line-strong);
}

.auth-demo-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: .69rem;
  font-weight: 900;
}

.auth-demo-heading svg {
  width: 15px;
  color: var(--primary);
}

.auth-demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-demo-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-main);
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.auth-demo-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.auth-demo-btn b {
  font-size: .69rem;
  font-weight: 900;
}

.auth-demo-btn small {
  color: var(--text-muted);
  font-size: .6rem;
  font-weight: 700;
}

.auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 19px;
  color: var(--text-sub);
  font-size: .62rem;
  font-weight: 700;
  text-align: center;
}

.auth-footer-note {
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 8px rgba(2, 8, 23, .38);
}

.auth-footer-note svg {
  width: 14px;
  color: var(--success);
}

.auth-brand h1,
.auth-field label,
.auth-label-row label {
  color: #fff !important;
  text-shadow: 0 2px 14px rgba(2, 8, 23, .42);
}

.auth-brand p {
  color: rgba(255, 255, 255, .86) !important;
  text-shadow: 0 1px 10px rgba(2, 8, 23, .34);
}

.auth-eyebrow {
  color: #dbeafe !important;
  text-shadow: 0 1px 10px rgba(2, 8, 23, .36);
}

.auth-label-row span {
  color: rgba(255, 255, 255, .76) !important;
}

.auth-footer-note {
  color: rgba(255, 255, 255, .82) !important;
  text-shadow: 0 1px 8px rgba(2, 8, 23, .38);
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: 16px 10px;
  }

  .auth-card {
    padding: 24px 17px;
    border-radius: 22px;
  }

  .auth-demo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .auth-background-video {
    object-position: 58% center;
    opacity: .64;
  }

  .auth-motion-bg::after {
    background: linear-gradient(180deg, rgba(8, 20, 45, .48), rgba(8, 20, 45, .70));
  }
}

@media (min-width: 1600px) {
  .auth-background-video {
    object-position: center 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-background-video {
    display: none;
  }

  .auth-motion-bg::before,
  .auth-motion-bg::after {
    animation: none !important;
  }
}


.skip-link {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 900;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .18s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid rgba(255, 255, 255, .9);
  outline-offset: 2px;
}

.app-main-content:focus {
  outline: none;
}


/* Shared shell contrast for legacy pages. */
.app-sidebar {
  background: var(--surface-1);
  border-color: var(--line-strong);
  box-shadow: 8px 0 28px rgba(15, 23, 42, .06);
}

.sidebar-brand,
.sidebar-brand strong,
.sidebar-brand span,
.sidebar-section-label {
  color: var(--text-main);
}

.sidebar-section-label {
  opacity: .7;
}

.sidebar-link {
  color: var(--text-muted);
}

.sidebar-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.sidebar-link.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 24%, transparent);
}

.sidebar-link svg,
.sidebar-link i {
  color: currentColor;
}

.sidebar-account {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.sidebar-account strong,
.sidebar-account span {
  color: var(--text-main);
}

.app-header {
  background: color-mix(in srgb, var(--surface-1) 94%, transparent);
  border-color: var(--line-strong);
  box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
}

.header-identity strong,
.header-user-copy strong {
  color: var(--text-main);
}

.header-identity span,
.header-user-copy span {
  color: var(--text-muted);
}

.header-identity-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.header-shortcut {
  color: var(--text-muted);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.header-shortcut:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
}

.header-user-badge {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.kpi-card,
.quick-card,
.stat-card {
  background: var(--surface-1);
  border-color: var(--line-strong);
  color: var(--text-main);
  box-shadow: var(--shadow-card);
}

.kpi-card:hover,
.quick-card:hover,
.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.kpi-card h3,
.kpi-card strong,
.quick-card strong,
.stat-card strong {
  color: var(--text-main);
}

.kpi-card p,
.quick-card p,
.stat-card p {
  color: var(--text-muted);
}

@media (max-width: 992px) {
  .app-sidebar {
    box-shadow: -14px 0 32px rgba(15, 23, 42, .16);
  }
}


/* Unified page architecture and luxury executive components */
.module-exec-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, #431844 0%, #5d255d 65%, #6e2c6e 100%);
  border-radius: 20px;
  padding: 22px 28px;
  color: #ffffff;
  margin-bottom: 22px;
  box-shadow: 0 10px 25px rgba(93, 37, 93, 0.16);
  position: relative;
  overflow: hidden;
}

.module-exec-banner::after {
  content: '';
  position: absolute;
  top: -40px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.module-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1;
}

.module-banner-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
  backdrop-filter: blur(8px);
}

.module-banner-title {
  margin: 4px 0 2px;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.module-banner-desc {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  line-height: 1.6;
}

.module-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 1;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
  padding: 4px 0 0;
}

.page-heading-copy {
  min-width: 0;
}

.page-eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.page-eyebrow svg,
.section-kicker svg {
  width: 15px;
  height: 15px;
}

.page-heading h1 {
  margin: 7px 0 5px;
  color: var(--text-main);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.25;
  font-weight: 900;
}

.page-heading-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.7;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.page-heading-actions form {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.quick-link-card:focus-visible {
  outline: 3px solid rgba(93, 37, 93, 0.25);
  outline-offset: 3px;
}

.btn-primary {
  color: #fff !important;
  background: linear-gradient(135deg, #5d255d 0%, #431844 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(93, 37, 93, 0.25);
}

.btn-primary:hover {
  color: #fff !important;
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(93, 37, 93, 0.35);
}

.btn-secondary {
  color: #475569;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
  color: #5d255d;
  border-color: #5d255d;
  background: rgba(93, 37, 93, 0.04);
}

.btn-soft {
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(93, 37, 93, 0.12);
}

.btn-soft:hover {
  color: #fff;
  background: var(--primary);
}

.surface-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

.dashboard-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-bottom: 28px;
  padding: 12px 16px;
}

.context-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: .8rem;
  font-weight: 750;
}

.context-item svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.context-item-muted {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-weight: 650;
}

.context-item-muted svg {
  color: var(--text-muted);
}

.context-separator {
  width: 1px;
  height: 19px;
  background: var(--line-strong);
}

.section-block {
  margin: 0 0 30px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 13px;
}

.section-heading h2 {
  margin: 4px 0 0;
  color: var(--text-main);
  font-size: 1.08rem;
  font-weight: 900;
}

.section-meta {
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 750;
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.metric-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-1);
  box-shadow: var(--shadow-card);
}

.metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  color: var(--text-muted);
  font-size: .77rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--metric-tint, var(--primary-light));
  color: var(--metric-color, var(--primary));
}

.metric-icon svg {
  width: 16px;
  height: 16px;
}

.metric-card>strong {
  display: block;
  margin: 12px 0 4px;
  color: var(--metric-color, var(--text-main));
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.04em;
}

.metric-card>strong small {
  color: var(--text-muted);
  font-size: .78rem;
  letter-spacing: 0;
}

.metric-note {
  display: block;
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-success {
  --metric-color: #059669;
  --metric-tint: rgba(16, 185, 129, .14);
}

.metric-warning {
  --metric-color: #d97706;
  --metric-tint: rgba(245, 158, 11, .15);
}

.metric-danger {
  --metric-color: #dc2626;
  --metric-tint: rgba(239, 68, 68, .14);
}

.metric-primary {
  --metric-color: var(--primary);
  --metric-tint: var(--primary-light);
}

.metric-neutral {
  --metric-color: #64748b;
  --metric-tint: rgba(100, 116, 139, .14);
}

.metric-info {
  --metric-color: #2563eb;
  --metric-tint: rgba(59, 130, 246, .14);
}

.metric-violet {
  --metric-color: #7c3aed;
  --metric-tint: rgba(139, 92, 246, .14);
}

.metric-cyan {
  --metric-color: #0369a1;
  --metric-tint: rgba(14, 165, 233, .14);
}

.metric-green {
  --metric-color: #15803d;
  --metric-tint: rgba(34, 197, 94, .14);
}

.metric-orange {
  --metric-color: #c2410c;
  --metric-tint: rgba(249, 115, 22, .14);
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr);
  gap: 15px;
}

.chart-card {
  min-width: 0;
  padding: 18px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.card-heading h3 {
  margin: 0;
  color: var(--text-main);
  font-size: .94rem;
  font-weight: 850;
}

.card-heading p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: .75rem;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-light);
}

.card-icon svg {
  width: 17px;
  height: 17px;
}

.chart-stage {
  position: relative;
  height: 250px;
  margin-top: 12px;
}

.chart-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-stage-donut {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-stage-donut canvas {
  max-width: 220px;
  max-height: 220px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-link-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-1);
  color: var(--text-main);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.quick-link-card:hover {
  color: var(--text-main);
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-card-hover);
}

.quick-link-card>span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-link-card strong {
  color: var(--text-main);
  font-size: .81rem;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-link-card small {
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
}

.quick-link-icon svg {
  width: 18px;
  height: 18px;
}

.quick-icon-green {
  color: #059669;
  background: rgba(16, 185, 129, .14);
}

.quick-icon-violet {
  color: #7c3aed;
  background: rgba(139, 92, 246, .14);
}

.quick-icon-orange {
  color: #d97706;
  background: rgba(245, 158, 11, .15);
}

.quick-icon-blue {
  color: #2563eb;
  background: rgba(59, 130, 246, .14);
}

.quick-icon-teal {
  color: #0f766e;
  background: rgba(20, 184, 166, .14);
}

.quick-icon-indigo {
  color: #4f46e5;
  background: rgba(99, 102, 241, .14);
}

.quick-arrow {
  width: 15px;
  height: 15px;
  margin-inline-start: auto;
  flex: 0 0 auto;
  color: var(--text-subtle);
}

.quick-link-card:hover .quick-arrow {
  color: var(--primary);
}

@media (max-width:1200px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width:900px) {
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:640px) {
  .page-heading-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .page-heading-actions form,
  .page-heading-actions .btn {
    width: 100%;
  }

  .page-heading-actions .btn {
    padding-inline: 9px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .context-item-muted {
    margin-inline-start: 0;
  }

  .context-separator {
    display: none;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }
}


/* Shared data views: filters, tables, states. */
.filter-panel {
  margin-bottom: 18px;
  padding: 18px 22px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.02);
}

.filter-panel-heading,
.data-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.filter-panel-heading h2,
.data-section-heading h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 900;
}

.filter-panel-heading p,
.data-section-heading p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: .76rem;
}

.filter-panel-heading>svg {
  width: 20px;
  height: 20px;
  color: #5d255d;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(170px, .7fr) minmax(150px, .6fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field>span {
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 800;
}

.field-control {
  position: relative;
}

.field-control>svg {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.field-control input {
  padding-inline-start: 40px !important;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  font: inherit;
  font-size: .82rem;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.field input::placeholder {
  color: var(--text-sub);
}

.field input:focus,
.field select:focus {
  border-color: #5d255d;
  box-shadow: 0 0 0 3px rgba(93, 37, 93, 0.12);
}

.filter-submit {
  min-height: 42px;
}

.data-section {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

.data-section-heading {
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.data-section-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: .74rem;
  font-weight: 750;
  background: rgba(93, 37, 93, 0.06);
  padding: 4px 12px;
  border-radius: 999px;
}

.data-section-status svg {
  width: 14px;
  height: 14px;
  color: #5d255d;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  color: var(--text-main);
  font-size: .8rem;
}

.data-table th {
  padding: 13px 18px;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: .72rem;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background .16s ease;
}

.data-table tbody tr:hover {
  background: rgba(93, 37, 93, 0.025);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.employee-cell img,
.employee-cell .employee-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  object-fit: cover;
}

.employee-cell>span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.employee-cell strong {
  color: var(--text-main);
  font-size: .82rem;
  font-weight: 850;
  white-space: nowrap;
}

.employee-cell small,
.currency {
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 600;
}

.data-table code {
  color: #5d255d;
  background: rgba(93, 37, 93, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem;
  font-weight: 850;
}

.masked-value {
  color: var(--text-subtle);
  letter-spacing: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-success {
  color: #047857;
  background: #e6f6f4;
  border: 1px solid #c4ede8;
}

.status-warning {
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.status-danger {
  color: #b91c1c;
  background: #ffe4e6;
  border: 1px solid #fecdd3;
}

.status-info {
  color: #0284c7;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

.status-purple {
  color: #7e22ce;
  background: #f3e8ff;
  border: 1px solid #e9d5ff;
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5d255d;
  background: rgba(93, 37, 93, 0.06);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: all .18s ease;
}

.table-action:hover {
  color: #ffffff;
  background: #5d255d;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(93, 37, 93, 0.2);
}

.table-action svg {
  width: 15px;
  height: 15px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  flex-direction: column;
  gap: 7px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  margin-bottom: 5px;
  color: var(--text-subtle);
}

.empty-state strong {
  color: var(--text-main);
  font-size: .85rem;
}

.empty-state span {
  font-size: .75rem;
}

@media (max-width:800px) {
  .filter-form {
    grid-template-columns: 1fr 1fr;
  }

  .field-search {
    grid-column: 1 / -1;
  }

  .filter-submit {
    width: 100%;
  }
}

@media (max-width:520px) {
  .filter-form {
    grid-template-columns: 1fr;
  }

  .field-search {
    grid-column: auto;
  }

  .filter-panel,
  .data-section-heading {
    padding-inline: 13px;
  }
}


.attendance-filter-form {
  grid-template-columns: minmax(180px, .7fr) minmax(180px, .8fr) auto;
}

.time-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
}

.time-success,
.value-success {
  color: #059669;
}

.time-blue {
  color: #2563eb;
}

.value-danger {
  color: #dc2626;
}

.value-violet {
  color: #7c3aed;
}

.muted-value,
.unit-label {
  color: var(--text-subtle);
}

.status-info {
  color: #0369a1;
  background: rgba(14, 165, 233, .13);
}

@media (max-width:640px) {
  .attendance-filter-form {
    grid-template-columns: 1fr;
  }
}


.date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: .72rem;
  white-space: nowrap;
}

.date-range svg {
  width: 13px;
  height: 13px;
  color: var(--primary);
}

.net-value {
  font-size: .95rem;
}

.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-action-secondary {
  color: var(--text-muted);
}

.table-action-secondary:hover {
  color: var(--primary);
}

@media (max-width:720px) {
  .table-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}


.balance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.balance-card {
  min-width: 0;
  padding: 15px;
}

.balance-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 800;
}

.balance-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-light);
}

.balance-icon svg {
  width: 15px;
  height: 15px;
}

.balance-card>strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 14px 0 10px;
  color: var(--text-main);
  font-size: 1.65rem;
  font-weight: 900;
}

.balance-card>strong small {
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 750;
}

.balance-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: .68rem;
}

.balance-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.balance-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #8b5cf6));
}

.leave-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(0, 1.7fr);
  align-items: start;
  gap: 15px;
}

.form-card {
  padding: 18px;
}

.form-card .card-heading {
  margin-bottom: 18px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.field b {
  color: #dc2626;
}

.field textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--text-main);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  font-size: .78rem;
  resize: vertical;
  outline: none;
}

.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.form-submit {
  width: 100%;
  margin-top: 3px;
}

.inline-form {
  margin: 0;
}

.cell-subtext {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: .68rem;
}

@media (max-width:1050px) {
  .balance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leave-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width:520px) {
  .balance-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .balance-card {
    padding: 12px;
  }

  .form-two-columns {
    grid-template-columns: 1fr;
  }
}


/* Compatibility layer for legacy views. */
.apple-card {
  background: var(--surface-1) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 18px !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--text-main);
}

.apple-card h2,
.apple-card h3,
.apple-card h4 {
  color: var(--text-main) !important;
}

.apple-table-wrap {
  overflow-x: auto;
}

.apple-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--text-main);
}

.apple-table th {
  padding: 12px 14px !important;
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--line-strong) !important;
  font-size: .7rem !important;
  font-weight: 850 !important;
  white-space: nowrap;
  text-align: right;
}

.apple-table td {
  padding: 12px 14px !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--line) !important;
  font-size: .78rem;
  vertical-align: middle;
}

.apple-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 4%, var(--surface-1));
}

.apple-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px !important;
  font-weight: 800 !important;
  text-decoration: none;
  transition: transform .18s ease, filter .18s ease, background .18s ease;
}

.apple-btn:hover {
  transform: translateY(-1px);
}

.apple-btn-primary {
  color: #fff !important;
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.apple-btn-secondary {
  color: var(--text-main) !important;
  background: var(--surface-2) !important;
  border: 1px solid var(--line-strong) !important;
}

.apple-btn-secondary:hover {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.apple-btn-ai {
  color: #fff !important;
  background: linear-gradient(135deg, #6366f1, #7c3aed) !important;
}

.apple-btn-danger {
  color: #fff !important;
  background: linear-gradient(135deg, #f43f5e, #dc2626) !important;
  border-color: #dc2626 !important;
}

.apple-btn-danger:hover {
  filter: brightness(1.08);
}

.btn-light {
  color: var(--text-main);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.btn-light:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: .72rem;
  border-radius: 9px;
}

.form-input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--text-main);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  font-size: .78rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge-success {
  color: #047857 !important;
  background: rgba(16, 185, 129, .13) !important;
}

.badge-warning {
  color: #a16207 !important;
  background: rgba(245, 158, 11, .16) !important;
}

.badge-danger {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, .13) !important;
}

.badge-primary {
  color: #0369a1 !important;
  background: rgba(14, 165, 233, .13) !important;
}

input,
select,
textarea {
  color: var(--text-main);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-subtle);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

@media (max-width:700px) {
  .apple-table {
    min-width: 680px;
  }

  .apple-card {
    border-radius: 14px !important;
  }
}

/* AI action approval card */
.ai-action-approval {
  padding: 0 16px 14px;
}

.ai-action-card {
  padding: 16px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 18px;
  background: var(--bg-glass-heavy);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  display: flex;
  flex-direction: column;
}

.ai-action-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding-bottom: 10px;
}

.ai-action-card-title svg {
  width: 20px;
  height: 20px;
  color: #6366f1;
}

.ai-action-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.ai-action-summary {
  margin: 10px 0 6px 0;
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.6;
  font-weight: 600;
}

.ai-action-changes-scroll {
  max-height: 260px;
  overflow-y: auto;
  margin: 8px 0;
  padding: 4px 6px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.ai-action-changes-scroll::-webkit-scrollbar {
  width: 5px;
}

.ai-action-changes-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 10px;
}

.ai-action-changes {
  display: grid;
  gap: 6px;
}

.ai-action-change {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-action-change .change-label {
  font-weight: 700;
  color: var(--text-main);
}

.ai-action-change .change-old {
  color: var(--text-muted);
  opacity: 0.75;
  margin-left: 8px;
  text-decoration: line-through;
}

.ai-action-change .change-new {
  color: #10b981;
  font-weight: 800;
}

.ai-action-footer-bar {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.ai-action-footer-bar small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-bottom: 8px;
}

.ai-action-footer-bar small svg {
  width: 14px;
  height: 14px;
}

.ai-action-actions {
  display: flex;
  gap: 10px;
}

.ai-action-actions button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.ai-action-confirm {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.ai-action-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.ai-action-reject {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
}

.ai-action-reject:hover {
  background: rgba(244, 63, 94, 0.2);
}

.ai-action-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 560px) {
  .ai-action-change {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Enterprise Liquid Glass system: one coherent material across every page. */
.app-sidebar,
.app-header,
.apple-card,
.liquid-glass,
.surface-card,
.enterprise-kpi,
.kpi-card,
.quick-card,
.quick-link-card,
.stat-card,
.data-table-wrap,
.device-card,
.notification-item,
.settings-card,
.settings-summary,
.document-row,
.document-upload-form,
.ai-config-card,
.ai-audit-card,
.new-policy-card,
.info-callout,
.theme-drawer,
.ai-modal,
.ai-chat-window,
.apple-modal,
.dropdown-menu {
  background: color-mix(in srgb, var(--surface-1) 76%, transparent);
  border-color: color-mix(in srgb, var(--line-strong) 72%, transparent);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .54);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.app-sidebar {
  background: color-mix(in srgb, var(--surface-1) 72%, transparent);
}

.app-header {
  background: color-mix(in srgb, var(--surface-1) 68%, transparent);
}

.sidebar-link,
.settings-nav a,
.header-shortcut {
  background: transparent;
}

.sidebar-link:hover,
.settings-nav a:hover,
.header-shortcut:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.sidebar-account,
.header-user-badge,
.header-identity-icon,
.nav-icon,
.theme-choice span,
.theme-bg-card,
.theme-switch-row,
.completion-block,
.field input,
.field select,
.field textarea,
.form-grid input,
.form-grid select,
.form-grid textarea,
.device-edit-form input,
.device-edit-form select,
.device-edit-form textarea,
.auth-demo-btn {
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
  border-color: color-mix(in srgb, var(--line-strong) 76%, transparent);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.app-sidebar *,
.app-header *,
.apple-card *,
.liquid-glass *,
.surface-card *,
.enterprise-kpi *,
.data-table-wrap *,
.device-card *,
.settings-card *,
.notification-item *,
.quick-link-card * {
  line-height: 1.55;
}

.app-sidebar .sidebar-link,
.app-sidebar .sidebar-section-label,
.app-header,
.app-header strong,
.app-header span {
  color: var(--text-main);
}

.surface-card h1,
.surface-card h2,
.surface-card h3,
.apple-card h1,
.apple-card h2,
.apple-card h3,
.enterprise-kpi strong,
.enterprise-kpi h2,
.enterprise-kpi h3,
.quick-link-card strong,
.data-table th {
  color: var(--text-main);
}

.surface-card p,
.surface-card small,
.apple-card p,
.apple-card small,
.enterprise-kpi p,
.enterprise-kpi small,
.quick-link-card small,
.field small,
.field-help,
.form-help {
  color: var(--text-muted);
}

.data-table td,
.data-table tbody td {
  color: var(--text-main);
}

.data-table thead th,
.data-table th {
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.site-background-media~.app-main-content .apple-card,
.site-background-media~.app-main-content .surface-card,
.site-background-media~.app-main-content .enterprise-kpi,
.site-background-media~.app-sidebar {
  background: color-mix(in srgb, var(--surface-1) 78%, transparent);
}

@media (prefers-reduced-motion: reduce) {

  .app-sidebar,
  .app-header,
  .apple-card,
  .liquid-glass,
  .surface-card,
  .enterprise-kpi,
  .data-table-wrap {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Dark mode contrast contract: no light surfaces or muted text leak into dark UI. */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: #0b1220;
  color: #f3f7fc;
}

html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .apple-card,
html[data-theme="dark"] .liquid-glass,
html[data-theme="dark"] .surface-card,
html[data-theme="dark"] .enterprise-kpi,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .quick-card,
html[data-theme="dark"] .quick-link-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .data-table-wrap,
html[data-theme="dark"] .device-card,
html[data-theme="dark"] .notification-item,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .settings-summary,
html[data-theme="dark"] .document-row,
html[data-theme="dark"] .document-upload-form,
html[data-theme="dark"] .ai-config-card,
html[data-theme="dark"] .ai-audit-card,
html[data-theme="dark"] .new-policy-card,
html[data-theme="dark"] .info-callout,
html[data-theme="dark"] .theme-drawer,
html[data-theme="dark"] .ai-modal,
html[data-theme="dark"] .ai-chat-window,
html[data-theme="dark"] .apple-modal,
html[data-theme="dark"] .dropdown-menu {
  background: rgba(18, 28, 45, .82) !important;
  color: #f3f7fc !important;
  border-color: rgba(148, 163, 184, .24) !important;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

html[data-theme="dark"] .app-sidebar {
  background: rgba(9, 16, 29, .90) !important;
}

html[data-theme="dark"] .app-header {
  background: rgba(18, 28, 45, .72) !important;
}

html[data-theme="dark"] .sidebar-link {
  color: #cbd5e1 !important;
  background: transparent !important;
}

html[data-theme="dark"] .sidebar-link:hover {
  color: #fff !important;
  background: rgba(192, 132, 252, 0.15) !important;
}

html[data-theme="dark"] .sidebar-link.active {
  color: #fff !important;
  background: linear-gradient(135deg, #5d255d 0%, #7e22ce 60%, #9333ea 100%) !important;
  box-shadow: 0 6px 20px rgba(126, 34, 206, 0.5) !important;
}

html[data-theme="dark"] .sidebar-brand,
html[data-theme="dark"] .sidebar-section-label,
html[data-theme="dark"] .brand-text h2,
html[data-theme="dark"] .brand-text span,
html[data-theme="dark"] .sidebar-account strong,
html[data-theme="dark"] .sidebar-account span,
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .app-header strong,
html[data-theme="dark"] .app-header span {
  color: #f3f7fc !important;
}

html[data-theme="dark"] .sidebar-section-label,
html[data-theme="dark"] .header-identity span,
html[data-theme="dark"] .header-user-copy span {
  color: #9fb0c6 !important;
}

html[data-theme="dark"] .sidebar-account,
html[data-theme="dark"] .header-user-badge,
html[data-theme="dark"] .header-shortcut,
html[data-theme="dark"] .header-identity-icon,
html[data-theme="dark"] .nav-icon,
html[data-theme="dark"] .theme-choice span,
html[data-theme="dark"] .theme-bg-card,
html[data-theme="dark"] .theme-switch-row,
html[data-theme="dark"] .completion-block,
html[data-theme="dark"] .setting-switch,
html[data-theme="dark"] .device-edit-form,
html[data-theme="dark"] .overview-item,
html[data-theme="dark"] .document-upload-form input {
  background: rgba(24, 36, 56, .78) !important;
  color: #f3f7fc !important;
  border-color: rgba(148, 163, 184, .24) !important;
}

html[data-theme="dark"] .header-shortcut {
  color: #d5dfec !important;
}

html[data-theme="dark"] .header-shortcut:hover {
  color: #7dd3fc !important;
  background: rgba(56, 189, 248, .14) !important;
}

html[data-theme="dark"] .surface-card h1,
html[data-theme="dark"] .surface-card h2,
html[data-theme="dark"] .surface-card h3,
html[data-theme="dark"] .apple-card h1,
html[data-theme="dark"] .apple-card h2,
html[data-theme="dark"] .apple-card h3,
html[data-theme="dark"] .apple-card h4,
html[data-theme="dark"] .enterprise-kpi strong,
html[data-theme="dark"] .enterprise-kpi h2,
html[data-theme="dark"] .enterprise-kpi h3,
html[data-theme="dark"] .quick-link-card strong,
html[data-theme="dark"] .page-heading h1,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .card-heading h2,
html[data-theme="dark"] .empty-state strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .surface-card p,
html[data-theme="dark"] .surface-card small,
html[data-theme="dark"] .apple-card p,
html[data-theme="dark"] .apple-card small,
html[data-theme="dark"] .enterprise-kpi p,
html[data-theme="dark"] .enterprise-kpi small,
html[data-theme="dark"] .quick-link-card small,
html[data-theme="dark"] .field small,
html[data-theme="dark"] .field-help,
html[data-theme="dark"] .form-help,
html[data-theme="dark"] .page-heading-copy p,
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .notification-content p {
  color: #b4c1d2 !important;
}

html[data-theme="dark"] .field label,
html[data-theme="dark"] .form-grid label,
html[data-theme="dark"] .device-edit-form label,
html[data-theme="dark"] .setting-switch span,
html[data-theme="dark"] .setting-switch strong {
  color: #dbe7f4 !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .device-edit-form input,
html[data-theme="dark"] .device-edit-form select {
  background: #182438 !important;
  color: #f8fafc !important;
  border-color: #3b4d68 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #93a4ba !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .18) !important;
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .data-table thead th,
html[data-theme="dark"] .apple-table th {
  background: #182438 !important;
  color: #dbe7f4 !important;
  border-color: #3b4d68 !important;
}

html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .data-table tbody td,
html[data-theme="dark"] .apple-table td {
  color: #e5edf7 !important;
  border-color: #2b3b53 !important;
}

html[data-theme="dark"] .data-table tbody tr:hover,
html[data-theme="dark"] .apple-table tbody tr:hover {
  background: rgba(56, 189, 248, .10) !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .apple-btn-secondary,
html[data-theme="dark"] .btn-ghost {
  background: #1a2940 !important;
  color: #e5edf7 !important;
  border-color: #40536e !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .apple-btn-secondary:hover,
html[data-theme="dark"] .btn-ghost:hover {
  background: rgba(56, 189, 248, .16) !important;
  color: #7dd3fc !important;
}

html[data-theme="dark"] .kpi-icon.teal {
  color: #5eead4;
  background: rgba(20, 184, 166, .18);
}

html[data-theme="dark"] .kpi-icon.green {
  color: #86efac;
  background: rgba(34, 197, 94, .18);
}

html[data-theme="dark"] .kpi-icon.blue {
  color: #93c5fd;
  background: rgba(59, 130, 246, .18);
}

html[data-theme="dark"] .kpi-icon.amber {
  color: #fcd34d;
  background: rgba(245, 158, 11, .18);
}

html[data-theme="dark"] .kpi-icon.purple {
  color: #c4b5fd;
  background: rgba(139, 92, 246, .18);
}

html[data-theme="dark"] .kpi-icon.red {
  color: #fda4af;
  background: rgba(244, 63, 94, .18);
}

html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .status-success {
  color: #86efac !important;
  background: rgba(34, 197, 94, .16) !important;
}

html[data-theme="dark"] .badge-warning,
html[data-theme="dark"] .status-warning {
  color: #fcd34d !important;
  background: rgba(245, 158, 11, .16) !important;
}

html[data-theme="dark"] .badge-danger,
html[data-theme="dark"] .status-danger {
  color: #fda4af !important;
  background: rgba(244, 63, 94, .16) !important;
}

html[data-theme="dark"] .badge-primary,
html[data-theme="dark"] .status-info {
  color: #93c5fd !important;
  background: rgba(59, 130, 246, .18) !important;
}

html[data-theme="dark"] .metric-success {
  --metric-color: #34d399;
  --metric-tint: rgba(16, 185, 129, .15);
}

html[data-theme="dark"] .metric-warning {
  --metric-color: #fbbf24;
  --metric-tint: rgba(245, 158, 11, .16);
}

html[data-theme="dark"] .metric-danger {
  --metric-color: #fb7185;
  --metric-tint: rgba(239, 68, 68, .15);
}

html[data-theme="dark"] .metric-neutral {
  --metric-color: #94a3b8;
  --metric-tint: rgba(100, 116, 139, .16);
}

html[data-theme="dark"] .metric-info {
  --metric-color: #60a5fa;
  --metric-tint: rgba(59, 130, 246, .16);
}

html[data-theme="dark"] .metric-violet {
  --metric-color: #a78bfa;
  --metric-tint: rgba(139, 92, 246, .16);
}

html[data-theme="dark"] .metric-cyan {
  --metric-color: #22d3ee;
  --metric-tint: rgba(14, 165, 233, .16);
}

html[data-theme="dark"] .metric-green {
  --metric-color: #4ade80;
  --metric-tint: rgba(34, 197, 94, .16);
}

html[data-theme="dark"] .metric-orange {
  --metric-color: #fb923c;
  --metric-tint: rgba(249, 115, 22, .16);
}

html[data-theme="dark"] .info-callout {
  color: #dbe7f4 !important;
  background: rgba(30, 64, 175, .20) !important;
  border-color: rgba(96, 165, 250, .36) !important;
}

html[data-theme="dark"] .notification-content small,
html[data-theme="dark"] .notification-heading time,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .empty-state p {
  color: #9fb0c6 !important;
}

html[data-theme="dark"] .site-background-media~.app-sidebar,
html[data-theme="dark"] .site-background-media~.app-main-content .apple-card,
html[data-theme="dark"] .site-background-media~.app-main-content .surface-card,
html[data-theme="dark"] .site-background-media~.app-main-content .enterprise-kpi {
  background: rgba(18, 28, 45, .84) !important;
}

/* ============================================================
   DEF-UI-01 & DEF-UI-04: Mobile Viewport & Action Button Optimization
   ============================================================ */
@media (max-width: 480px) {

  .dashboard-welcome .header-actions,
  .page-heading .page-actions,
  .card-heading .card-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .dashboard-welcome .header-actions .apple-btn,
  .dashboard-welcome .header-actions .btn,
  .page-heading .page-actions .apple-btn,
  .page-heading .page-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
}

/* ============================================================
   Luxury Action Flash Notification Banner (Add/Update/Delete)
   ============================================================ */
@keyframes slideDownNotice {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.flash-enterprise-banner {
  transition: opacity 220ms ease, transform 220ms ease;
}

html[data-theme="dark"] .flash-enterprise-banner {
  background: rgba(18, 28, 45, 0.92) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .flash-enterprise-banner strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .flash-enterprise-banner p {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .flash-enterprise-banner .alert-close {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .flash-enterprise-banner .alert-close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

/* ============================================================
   Executive Command Header Bar (الشريط العلوي التنفيذي الفاخر)
   ============================================================ */

.executive-header-bar {
  min-height: 74px;
  height: auto;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(251, 247, 252, 0.88) 100%);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border: 1.5px solid rgba(93, 37, 93, 0.12);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  box-shadow: 0 12px 34px -6px rgba(67, 24, 68, 0.07), 0 2px 8px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  position: relative;
  z-index: 50;
  transition: all 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. القسم الأيمن: الهوية ومسار التنقل */
.header-leading-area {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 0;
}

.header-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(93, 37, 93, 0.05), rgba(67, 24, 68, 0.08));
  border: 1.5px solid rgba(93, 37, 93, 0.14);
  color: #431844;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(67, 24, 68, 0.04);
}

.header-menu-toggle:hover {
  background: linear-gradient(135deg, #431844 0%, #5d255d 100%);
  color: #ffffff;
  border-color: #431844;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(67, 24, 68, 0.25);
}

.header-menu-toggle i {
  width: 19px;
  height: 19px;
}

.header-emblem-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(93, 37, 93, 0.12) 0%, rgba(67, 24, 68, 0.22) 100%);
  color: #5d255d;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(93, 37, 93, 0.25);
  box-shadow: 0 6px 18px rgba(67, 24, 68, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease, background 220ms ease;
  cursor: default;
}

.header-emblem-badge:hover {
  transform: scale(1.06) rotate(-2deg);
  background: linear-gradient(135deg, #431844 0%, #5d255d 100%);
  color: #ffffff;
  border-color: #431844;
  box-shadow: 0 10px 26px rgba(67, 24, 68, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.header-emblem-badge i {
  width: 22px;
  height: 22px;
}

.header-breadcrumbs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.breadcrumb-module {
  font-size: 0.74rem;
  font-weight: 800;
  color: #5d255d;
  letter-spacing: -0.1px;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(93, 37, 93, 0.07);
  border: 1px solid rgba(93, 37, 93, 0.12);
  line-height: 1.2;
}

.breadcrumb-separator {
  width: 14px;
  height: 14px;
  color: rgba(93, 37, 93, 0.35);
}

.breadcrumb-current {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #1e1022;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.header-submeta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 2px;
}

.header-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(93, 37, 93, 0.04);
  border: 1px solid rgba(93, 37, 93, 0.11);
  padding: 2px 10px;
  border-radius: 8px;
  font-weight: 700;
  color: #431844;
  line-height: 1.3;
}

.header-branch-pill i {
  width: 13px;
  height: 13px;
  color: #5d255d;
}

.header-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  display: inline-block;
  animation: pulseBeacon 2.2s infinite;
}

.header-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.header-date-badge i {
  width: 12px;
  height: 12px;
}

/* 2. القسم الأوسط: شريط البحث الشامل والامتثال والمؤشرات اللحظية */
.header-center-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  max-width: 480px;
  margin: 0 10px;
}

.header-search-bar {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(93, 37, 93, 0.12);
  border-radius: 12px;
  padding: 0 12px;
  height: 42px;
  transition: all 200ms ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.header-search-bar:focus-within {
  background: #ffffff;
  border-color: #5d255d;
  box-shadow: 0 0 0 3px rgba(93, 37, 93, 0.15), 0 4px 14px rgba(67, 24, 68, 0.06);
}

.header-search-bar .search-icon {
  width: 17px;
  height: 17px;
  color: #5d255d;
  margin-left: 8px;
  flex-shrink: 0;
}

.header-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.84rem;
  font-family: inherit;
  color: #1e1022;
  min-width: 0;
}

.header-search-bar input::placeholder {
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.search-kbd-chip {
  background: rgba(93, 37, 93, 0.08);
  border: 1px solid rgba(93, 37, 93, 0.14);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.70rem;
  font-weight: 800;
  color: #5d255d;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.header-compliance-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #047857;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 6px 14px;
  border-radius: 30px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pulse-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulseBeacon 2s infinite;
}

@keyframes pulseBeacon {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* 3. القسم الأيسر: الأدوات والبحث والتحكم */
.header-actions-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-ai-btn {
  background: linear-gradient(135deg, #431844, #5d255d);
  color: #ffffff !important;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(67, 24, 68, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}

.header-ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(67, 24, 68, 0.38);
}

.header-ai-btn i {
  width: 16px;
  height: 16px;
  color: #fde047;
}

.header-tool-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(93, 37, 93, 0.12);
  color: #431844;
  position: relative;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.header-tool-btn:hover {
  background: #ffffff;
  border-color: rgba(93, 37, 93, 0.30);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(67, 24, 68, 0.12);
  color: #5d255d;
}

.header-tool-btn:active {
  transform: translateY(0);
}

.header-tool-btn i {
  width: 19px;
  height: 19px;
}

.header-search-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 44px;
  padding: 0 14px;
  height: 42px;
  background: linear-gradient(135deg, rgba(93, 37, 93, 0.07) 0%, rgba(67, 24, 68, 0.12) 100%);
  border: 1.5px solid rgba(93, 37, 93, 0.22);
  color: #5d255d;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(67, 24, 68, 0.05);
}

.header-search-tool-btn:hover {
  background: linear-gradient(135deg, #431844 0%, #5d255d 100%);
  color: #ffffff;
  border-color: #431844;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(67, 24, 68, 0.25);
}

.search-tool-kbd {
  font-size: 0.70rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(93, 37, 93, 0.12);
  color: #5d255d;
  letter-spacing: 0.5px;
  transition: all 160ms ease;
  border: 1px solid rgba(93, 37, 93, 0.16);
}

.header-search-tool-btn:hover .search-tool-kbd {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.notification-badge-pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  border: 2px solid #ffffff;
}

.header-v-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle, rgba(0, 0, 0, 0.09));
  margin: 0 4px;
}

/* بطاقة المستخدم التنفيذية الفاخرة */
.header-user-menu-wrap {
  position: relative;
}

.header-user-card-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 12px 5px 6px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: 14px;
  cursor: pointer;
  transition: all 180ms ease;
  outline: none;
}

.header-user-card-btn:hover,
.header-user-menu-wrap.active .header-user-card-btn {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.user-avatar-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.user-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-online-beacon {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
}

.user-meta-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  gap: 1px;
}

.user-meta-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  line-height: 1.2;
}

.user-role-badge {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  line-height: 1.3;
}

.user-role-badge.badge-super {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.user-role-badge.badge-staff {
  background: rgba(37, 99, 235, 0.09);
  color: var(--primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.user-dropdown-arrow {
  width: 15px;
  height: 15px;
  color: var(--text-muted, #94a3b8);
  transition: transform 200ms ease;
}

.header-user-menu-wrap.active .user-dropdown-arrow {
  transform: rotate(180deg);
}

/* القائمة المنسدلة الذكية */
.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 40px -6px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.03);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  animation: dropdownPop 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.header-user-menu-wrap.active .header-user-dropdown {
  display: flex;
}

.dropdown-user-header {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
}

.dropdown-user-header strong {
  font-size: 0.92rem;
  color: var(--text-main, #0f172a);
}

.dropdown-user-header span {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.dropdown-user-header small {
  font-size: 0.72rem;
  color: var(--primary, #2563eb);
  font-weight: 700;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main, #334155);
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  transition: all 140ms ease;
}

.dropdown-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary, #2563eb);
}

.dropdown-item i {
  width: 16px;
  height: 16px;
  color: var(--text-muted, #64748b);
}

.dropdown-item:hover i {
  color: var(--primary, #2563eb);
}

.dropdown-logout-form {
  margin: 0;
  padding: 0;
}

.dropdown-logout-btn {
  color: #ef4444 !important;
}

.dropdown-logout-btn i {
  color: #ef4444 !important;
}

.dropdown-logout-btn:hover {
  background: rgba(239, 68, 68, 0.09) !important;
}

/* Dark Mode Overrides */
html[data-theme="dark"] .executive-header-bar {
  background: linear-gradient(180deg, rgba(28, 18, 33, 0.94) 0%, rgba(18, 12, 22, 0.90) 100%) !important;
  border-color: rgba(168, 85, 247, 0.24) !important;
  box-shadow: 0 16px 42px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .header-menu-toggle {
  background: rgba(168, 85, 247, 0.10) !important;
  border-color: rgba(168, 85, 247, 0.24) !important;
  color: #e9d5ff !important;
}

html[data-theme="dark"] .header-menu-toggle:hover {
  background: linear-gradient(135deg, #5d255d 0%, #7e22ce 100%) !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3) !important;
}

html[data-theme="dark"] .header-emblem-badge {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18) 0%, rgba(93, 37, 93, 0.35) 100%) !important;
  color: #e9d5ff !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] .header-emblem-badge:hover {
  background: linear-gradient(135deg, #5d255d 0%, #7e22ce 100%) !important;
  color: #ffffff !important;
  border-color: #a855f7 !important;
  box-shadow: 0 8px 24px rgba(126, 34, 206, 0.45) !important;
}

html[data-theme="dark"] .breadcrumb-module {
  background: rgba(168, 85, 247, 0.14) !important;
  color: #c084fc !important;
  border-color: rgba(168, 85, 247, 0.22) !important;
}

html[data-theme="dark"] .breadcrumb-separator {
  color: rgba(192, 132, 252, 0.4) !important;
}

html[data-theme="dark"] .breadcrumb-current {
  color: #fdf4ff !important;
}

html[data-theme="dark"] .header-search-bar {
  background: rgba(30, 18, 38, 0.7) !important;
  border-color: rgba(168, 85, 247, 0.22) !important;
}

html[data-theme="dark"] .header-search-bar input {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .search-kbd-chip {
  background: rgba(168, 85, 247, 0.15) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
  color: #e9d5ff !important;
}

html[data-theme="dark"] .header-tool-btn,
html[data-theme="dark"] .header-user-card-btn {
  background: rgba(30, 18, 38, 0.85) !important;
  border-color: rgba(168, 85, 247, 0.20) !important;
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .header-tool-btn:hover,
html[data-theme="dark"] .header-user-card-btn:hover {
  background: rgba(58, 30, 72, 0.95) !important;
  border-color: rgba(168, 85, 247, 0.45) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .header-search-tool-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14) 0%, rgba(93, 37, 93, 0.26) 100%) !important;
  border-color: rgba(168, 85, 247, 0.32) !important;
  color: #d8b4fe !important;
}

html[data-theme="dark"] .header-search-tool-btn:hover {
  background: linear-gradient(135deg, #5d255d 0%, #7e22ce 100%) !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(126, 34, 206, 0.45) !important;
}

html[data-theme="dark"] .header-search-tool-btn:hover .search-tool-kbd {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .search-tool-kbd {
  background: rgba(168, 85, 247, 0.20) !important;
  border-color: rgba(168, 85, 247, 0.30) !important;
  color: #e9d5ff !important;
}

html[data-theme="dark"] .user-meta-name {
  color: #f8fafc !important;
}

html[data-theme="dark"] .header-user-dropdown {
  background: rgba(22, 14, 28, 0.96) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .dropdown-user-header {
  background: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] .dropdown-user-header strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .dropdown-divider {
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .dropdown-item {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .dropdown-item:hover {
  background: rgba(168, 85, 247, 0.18) !important;
  color: #e9d5ff !important;
}

html[data-theme="dark"] .dropdown-item:hover i {
  color: #c084fc !important;
}

html[data-theme="dark"] .header-branch-pill {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.20) !important;
  color: #e9d5ff !important;
}

html[data-theme="dark"] .header-branch-pill i {
  color: #c084fc !important;
}

/* Responsiveness */
@media (max-width: 1080px) {
  .header-compliance-pill {
    display: none;
  }
}

@media (max-width: 900px) {
  .header-center-area {
    display: none;
  }
}

@media (max-width: 640px) {
  .executive-header-bar {
    padding: 8px 14px;
    min-height: 62px;
  }

  .header-ai-btn span,
  .user-meta-column,
  .user-dropdown-arrow,
  .header-submeta {
    display: none;
  }

  .header-user-card-btn {
    padding: 4px;
  }

  .breadcrumb-current {
    font-size: 0.95rem;
  }
}

/* ============================================================
   Micro-KPIs, Live Clock & Flyout Menus in Executive Header
   ============================================================ */

.header-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(93, 37, 93, 0.08);
  color: #5d255d;
  padding: 2px 9px;
  border-radius: 7px;
  font-weight: 700;
  font-family: monospace, system-ui, sans-serif;
  letter-spacing: 0.5px;
  border: 1px solid rgba(93, 37, 93, 0.14);
}

.header-clock-pill i {
  width: 12px;
  height: 12px;
}

.header-micro-kpi-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-micro-kpi {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.header-micro-kpi:hover {
  transform: translateY(-1px);
}

.kpi-attendance {
  background: rgba(16, 185, 129, 0.09);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.kpi-attendance:hover {
  background: rgba(16, 185, 129, 0.16);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.kpi-attendance i {
  width: 14px;
  height: 14px;
  color: #10b981;
}

.kpi-approvals {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.18) 100%);
  color: #9a3412;
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

.kpi-approvals:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.28) 100%);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.22);
}

.kpi-approvals i {
  width: 15px;
  height: 15px;
  color: #d97706;
}

html[data-theme="dark"] .kpi-approvals {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.26) 100%) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.40) !important;
}

.micro-kpi-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-emerald {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulseBeacon 2s infinite;
}

.pulse-amber {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
  animation: pulseBeacon 2.2s infinite;
}

.search-fake-placeholder {
  color: var(--text-muted, #94a3b8);
  font-size: 0.84rem;
  font-weight: 500;
  user-select: none;
}

/* Flyout Menus (Notifications) */
.header-flyout-wrap {
  position: relative;
}

.header-flyout-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 320px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 48px -8px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.03);
  display: none;
  flex-direction: column;
  z-index: 120;
  animation: dropdownPop 180ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.header-flyout-wrap.active .header-flyout-menu {
  display: flex;
}

.flyout-head {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
}

.flyout-head strong {
  font-size: 0.90rem;
  color: var(--text-main, #0f172a);
  display: block;
}

.flyout-head small {
  font-size: 0.72rem;
  color: var(--primary, #2563eb);
  font-weight: 700;
}

.flyout-head-link {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-weight: 600;
}

.flyout-head-link i {
  width: 13px;
  height: 13px;
}

.flyout-head-link:hover {
  color: var(--primary);
}

.flyout-body {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.flyout-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.flyout-empty i {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

.flyout-item {
  padding: 11px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 140ms ease;
}

.flyout-item:hover {
  background: rgba(37, 99, 235, 0.06);
}

.flyout-item.unread {
  background: rgba(37, 99, 235, 0.03);
}

.flyout-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.flyout-item-icon i {
  width: 15px;
  height: 15px;
}

.flyout-item-text {
  flex: 1;
  min-width: 0;
}

.flyout-item-text strong {
  font-size: 0.82rem;
  color: var(--text-main, #0f172a);
  display: block;
  line-height: 1.3;
}

.flyout-item-text p {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--text-sub, #475569);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flyout-item-text small {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  display: block;
}

.flyout-foot {
  padding: 9px 14px;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
}

.flyout-foot a {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.flyout-foot a:hover {
  text-decoration: underline;
}

/* ============================================================
   Spotlight Command Palette Modal (Ctrl + K)
   ============================================================ */

.spotlight-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  z-index: 99999;
  animation: fadeInModal 180ms ease forwards;
}

.spotlight-backdrop.open {
  display: flex;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.spotlight-dialog {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  animation: spotlightPop 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spotlightPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-14px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.spotlight-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.spotlight-search-ico {
  width: 22px;
  height: 22px;
  color: var(--primary, #2563eb);
  flex-shrink: 0;
}

.spotlight-input-row input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text-main, #0f172a);
}

.spotlight-input-row input::placeholder {
  color: var(--text-muted, #94a3b8);
}

.spotlight-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5d255d;
  flex-shrink: 0;
}

.spin-icon {
  width: 18px;
  height: 18px;
  animation: spinSlow 1s linear infinite;
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.spotlight-clear-btn {
  background: rgba(93, 37, 93, 0.08);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  transition: all 140ms ease;
  flex-shrink: 0;
}

.spotlight-clear-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger, #ef4444);
}

.spotlight-clear-btn i {
  width: 14px;
  height: 14px;
}

.spotlight-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(93, 37, 93, 0.03);
  border-bottom: 1px solid rgba(93, 37, 93, 0.08);
  flex-shrink: 0;
  overflow-x: auto;
}

.spotlight-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.spotlight-tab:hover {
  background: rgba(93, 37, 93, 0.06);
  color: #431844;
}

.spotlight-tab.active {
  background: linear-gradient(135deg, #431844 0%, #5d255d 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(67, 24, 68, 0.25);
}

.spotlight-tab i {
  width: 14px;
  height: 14px;
}

.spotlight-tab-badge {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.3);
  padding: 1px 6px;
  border-radius: 10px;
}

.spotlight-esc-chip {
  background: rgba(93, 37, 93, 0.06);
  border: 1px solid rgba(93, 37, 93, 0.12);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #5d255d;
  cursor: pointer;
  flex-shrink: 0;
}

.spotlight-results-scroll {
  flex: 1;
  max-height: 480px;
  overflow-y: auto;
  padding: 16px;
}

.spotlight-group-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #5d255d;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  padding: 0 6px;
}

.spotlight-items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.spotlight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 140ms ease;
}

.spotlight-item:hover {
  background: rgba(93, 37, 93, 0.07);
  border-color: rgba(93, 37, 93, 0.18);
  transform: translateY(-1px);
}

.spotlight-item-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spotlight-item-ico i {
  width: 18px;
  height: 18px;
}

.ico-primary {
  background: rgba(93, 37, 93, 0.12);
  color: #5d255d;
}

.ico-blue {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
}

.ico-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.ico-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.ico-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.ico-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
}

.spotlight-item-text {
  flex: 1;
  min-width: 0;
}

.spotlight-item-text strong {
  font-size: 0.86rem;
  color: var(--text-main, #0f172a);
  display: block;
  line-height: 1.3;
}

.spotlight-item-text small {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-item-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
}

.spotlight-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spotlight-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: var(--primary, #2563eb);
  font-size: 0.80rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 140ms ease;
}

.spotlight-action-pill:hover {
  background: var(--primary, #2563eb);
  color: #ffffff;
  transform: translateY(-1px);
}

.spotlight-action-pill i {
  width: 14px;
  height: 14px;
}

.spotlight-emp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.spotlight-emp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 140ms ease;
}

.spotlight-emp-item:hover,
.spotlight-emp-item.spotlight-active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.emp-search-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(37, 99, 235, 0.2);
  flex-shrink: 0;
}

.emp-search-info {
  flex: 1;
  min-width: 0;
}

.emp-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.emp-name-row strong {
  font-size: 0.88rem;
  color: var(--text-main, #0f172a);
}

.emp-num-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
}

.emp-meta-row {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

.emp-arrow-badge {
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
}

.emp-arrow-badge i {
  width: 16px;
  height: 16px;
}

.spotlight-count-muted {
  font-size: 0.70rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  margin-right: 6px;
}

.spotlight-active {
  border-color: var(--primary, #2563eb) !important;
  background: rgba(37, 99, 235, 0.12) !important;
  box-shadow: 0 0 0 1px var(--primary, #2563eb);
}

.spotlight-empty-card {
  text-align: center;
  padding: 36px 20px;
}

.spotlight-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger, #ef4444);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.spotlight-empty-icon i {
  width: 26px;
  height: 26px;
}

.spotlight-empty-card strong {
  display: block;
  font-size: 0.98rem;
  color: var(--text-main, #0f172a);
  margin-bottom: 6px;
}

.spotlight-empty-card p {
  margin: 0 0 16px 0;
  font-size: 0.84rem;
  color: var(--text-muted, #64748b);
}

.spotlight-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spotlight-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  color: var(--text-main, #0f172a);
  transition: all 140ms ease;
}

.spotlight-empty-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.spotlight-empty-btn.primary {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border-color: transparent;
}

.spotlight-empty-btn.primary:hover {
  background: #1d4ed8;
}

.footer-hint-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spotlight-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary, #2563eb);
  font-weight: 700;
}

.spotlight-brand-tag i {
  width: 13px;
  height: 13px;
}

.spotlight-footer-hint {
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
  flex-shrink: 0;
}

.spotlight-footer-hint kbd {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Dark Mode Overrides for Flyout & Spotlight */
html[data-theme="dark"] .header-flyout-menu,
html[data-theme="dark"] .spotlight-dialog {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .flyout-head,
html[data-theme="dark"] .flyout-foot,
html[data-theme="dark"] .spotlight-input-row,
html[data-theme="dark"] .spotlight-footer-hint {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .flyout-head strong,
html[data-theme="dark"] .flyout-item-text strong,
html[data-theme="dark"] .spotlight-item-text strong,
html[data-theme="dark"] .spotlight-input-row input {
  color: #f8fafc !important;
}

html[data-theme="dark"] .flyout-item {
  border-color: rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] .flyout-item:hover,
html[data-theme="dark"] .spotlight-item:hover {
  background: rgba(37, 99, 235, 0.18) !important;
}

html[data-theme="dark"] .spotlight-item {
  background: rgba(255, 255, 255, 0.03) !important;
}

html[data-theme="dark"] .header-clock-pill {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #60a5fa !important;
}

html[data-theme="dark"] .header-search-tool-btn {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
  color: #60a5fa !important;
}

html[data-theme="dark"] .spotlight-filter-tabs {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
}

html[data-theme="dark"] .spotlight-tab:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .spotlight-emp-item {
  background: rgba(255, 255, 255, 0.03) !important;
}

html[data-theme="dark"] .spotlight-emp-item:hover,
html[data-theme="dark"] .spotlight-emp-item.spotlight-active {
  background: rgba(37, 99, 235, 0.22) !important;
  border-color: rgba(37, 99, 235, 0.4) !important;
}

html[data-theme="dark"] .emp-name-row strong,
html[data-theme="dark"] .spotlight-empty-card strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .spotlight-empty-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

@media (max-width: 640px) {
  .spotlight-items-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   الشريط السفلي الاحترافي الفاخر (Executive Bottom Dock Bar)
   Liquid Glass Materials + Smart Positioning + Responsive Elegance
   -------------------------------------------------------------------------- */
.app-bottom-dock {
  position: fixed;
  bottom: 0;
  right: var(--sidebar-w, 270px);
  left: 0;
  height: 58px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 95;
  box-shadow: 0 -4px 25px rgba(15, 23, 42, 0.05);
  transition: right 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* في وضع الشريط الجانبي المصغر */
body.sidebar-compact .app-bottom-dock,
body.sidebar-collapsed .app-bottom-dock {
  right: var(--sidebar-compact-w, 74px) !important;
}

.bottom-dock-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 1. قسم المستخدم في الشريط السفلي */
.dock-user-section {
  position: relative;
}

.bottom-user-dropdown-wrap {
  position: relative;
}

.bottom-user-trigger {
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(248, 250, 252, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 180ms ease;
  color: var(--text-main, #0f172a);
}

.bottom-user-trigger:hover,
.bottom-user-dropdown-wrap.active .bottom-user-trigger {
  background: #ffffff;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.dock-avatar-frame {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dock-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary, #2563eb);
}

.dock-user-status-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.dock-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-user-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  white-space: nowrap;
}

.dock-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.70rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 20px;
}

.dock-role-badge.role-super {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.dock-role-badge.role-standard {
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.dock-role-badge svg {
  width: 12px;
  height: 12px;
}

.dock-chevron-icon {
  width: 15px;
  height: 15px;
  color: var(--text-sub, #94a3b8);
  transition: transform 180ms ease;
  margin-right: 2px;
}

.bottom-user-dropdown-wrap.active .dock-chevron-icon {
  transform: rotate(180deg);
}

/* النافذة المنبثقة لأعلى لقائمة المستخدم في الشريط السفلي */
.bottom-user-flyout {
  display: none;
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 250px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
  z-index: 110;
  animation: flyoutSlideUp 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes flyoutSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bottom-user-dropdown-wrap.active .bottom-user-flyout {
  display: block;
}

.flyout-user-banner {
  padding: 10px 12px;
  background: rgba(241, 245, 249, 0.65);
  border-radius: 10px;
}

.flyout-user-banner strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.flyout-user-banner span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-sub, #64748b);
  margin-top: 1px;
}

.flyout-user-banner small {
  display: block;
  font-size: 0.68rem;
  color: var(--primary, #2563eb);
  font-weight: 700;
  margin-top: 3px;
}

.flyout-divider {
  height: 1px;
  background: rgba(226, 232, 240, 0.8);
  margin: 6px 0;
}

.flyout-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  text-decoration: none;
  transition: all 140ms ease;
}

.flyout-link:hover {
  background: rgba(241, 245, 249, 0.9);
  color: var(--primary, #2563eb);
  transform: translateX(-3px);
}

.flyout-link svg {
  width: 16px;
  height: 16px;
  color: var(--text-sub, #64748b);
}

.flyout-link:hover svg {
  color: var(--primary, #2563eb);
}

.flyout-logout-form {
  margin: 0;
  padding: 0;
}

.flyout-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.80rem;
  font-weight: 700;
  color: #ef4444;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 140ms ease;
}

.flyout-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.flyout-logout-btn svg {
  width: 16px;
  height: 16px;
}

/* 2. قسم الوقت والتاريخ المباشر في الوسط */
.dock-time-capsule {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(241, 245, 249, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.dock-clock-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Pro Rounded", "Cairo", monospace;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary, #1e3a8a);
  direction: ltr;
}

.dock-clock-live svg {
  width: 15px;
  height: 15px;
  color: var(--primary, #2563eb);
}

.dock-capsule-divider {
  width: 1px;
  height: 15px;
  background: rgba(203, 213, 225, 0.9);
}

.dock-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main, #334155);
}

.dock-date-badge svg {
  width: 14px;
  height: 14px;
  color: var(--text-sub, #64748b);
}

.dock-timezone-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-sub, #64748b);
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1px 8px;
  border-radius: 20px;
}

/* 3. قسم البيانات والمطابقة في اليسار */
.dock-compliance-pill,
.dock-speed-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}

.dock-compliance-pill {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.dock-compliance-pill svg {
  width: 14px;
  height: 14px;
}

.dock-speed-pill {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.dock-speed-pill svg {
  width: 13px;
  height: 13px;
}

.dock-copyright-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-sub, #64748b);
  font-weight: 600;
}

.dock-version-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-sub, #64748b);
  padding: 1px 6px;
  border-radius: 6px;
}

/* شارة الحالة المتصلة في الشريط العلوي */
.header-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 3px 9px;
  border-radius: 999px;
}

.header-beacon-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.9);
}

/* --------------------------------------------------------------------------
   أنماط الوضع الليلي للشريط السفلي (Dark Mode Bottom Dock)
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .app-bottom-dock {
  background: rgba(11, 18, 32, 0.92) !important;
  border-top-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .bottom-user-trigger {
  background: rgba(24, 36, 56, 0.75) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .bottom-user-trigger:hover,
html[data-theme="dark"] .bottom-user-dropdown-wrap.active .bottom-user-trigger {
  background: rgba(30, 46, 72, 0.95) !important;
  border-color: #38bdf8 !important;
}

html[data-theme="dark"] .dock-user-name {
  color: #f8fafc !important;
}

html[data-theme="dark"] .bottom-user-flyout {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .flyout-user-banner {
  background: rgba(24, 36, 56, 0.8) !important;
}

html[data-theme="dark"] .flyout-user-banner strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .flyout-link {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .flyout-link:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .flyout-divider {
  background: rgba(148, 163, 184, 0.15) !important;
}

html[data-theme="dark"] .dock-time-capsule {
  background: rgba(24, 36, 56, 0.75) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] .dock-clock-live {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .dock-clock-live svg {
  color: #38bdf8 !important;
}

html[data-theme="dark"] .dock-date-badge {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .dock-timezone-tag {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .dock-capsule-divider {
  background: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="dark"] .dock-copyright-copy {
  color: #94a3b8 !important;
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 991px) {
  .app-bottom-dock {
    right: 0 !important;
    padding: 0 16px;
    height: 54px;
  }

  .dock-meta-section {
    display: none;
  }
}

@media (max-width: 640px) {
  .dock-time-section .dock-timezone-tag {
    display: none;
  }

  .dock-role-badge {
    display: none;
  }
}

/* ==========================================================================
   مركز القيادة واللوحة التنفيذية الفاخرة (Executive Command Cockpit 4.0)
   Apple Liquid Glass Design + Hardware Sentinel + Ultra Responsive Grid
   ========================================================================== */

.cockpit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  animation: cockpitFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cockpitFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 1. رأس مركز القيادة (Cockpit Header) */
.cockpit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  padding: 22px 28px;
  box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.cockpit-header::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 100%;
  background: radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.cockpit-heading-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.cockpit-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
  letter-spacing: 0.2px;
}

.cockpit-title {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text, #0f172a);
  margin: 0;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.cockpit-desc {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  margin: 0;
  line-height: 1.5;
}

.cockpit-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  z-index: 1;
}

.cockpit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cockpit-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.cockpit-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38);
}

.cockpit-btn-glass {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: var(--text, #0f172a);
  backdrop-filter: blur(12px);
}

.cockpit-btn-glass:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--primary, #2563eb);
  transform: translateY(-1px);
}

/* 2. شريط النبض الحي للأجهزة والعمليات (Live Operations Sentinel) */
.cockpit-sentinel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
}

.sentinel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 3px 16px -2px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.sentinel-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.3);
}

.sentinel-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.sentinel-ping-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px #ffffff;
}

.sentinel-ping-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.5;
  animation: sentinelPulse 1.8s infinite cubic-bezier(0.24, 0, 0.38, 1);
}

@keyframes sentinelPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.sentinel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.sentinel-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.sentinel-val-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sentinel-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text, #0f172a);
  line-height: 1.15;
}

.sentinel-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

/* 3. كبسولات المؤشرات الـ 8 الإستراتيجية (Strategic 8 KPIs Grid) */
.cockpit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.cockpit-kpi-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.cockpit-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(37, 99, 235, 0.35);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-card-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.1px;
}

.kpi-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.cockpit-kpi-card:hover .kpi-card-icon {
  transform: scale(1.08) rotate(3deg);
}

.kpi-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-main-number {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text, #0f172a);
}

.kpi-main-number small {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  margin-right: 4px;
}

.kpi-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(203, 213, 225, 0.7);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.kpi-badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.kpi-badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.kpi-badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.kpi-badge-primary {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.kpi-badge-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.kpi-mini-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.8);
  overflow: hidden;
  margin-top: 4px;
}

.kpi-mini-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 4. التقسيم التنفيذي الأوسط (AI Risk Sentinel + Decision Hub) */
.cockpit-split-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  width: 100%;
}

.cockpit-glass-card {
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-top-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-main-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  margin: 0;
}

.card-subtext {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  margin: 0;
}

/* عناصر رادار الذكاء الاصطناعي (AI Risk Alerts) */
.ai-risk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-risk-item {
  padding: 14px 16px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.ai-risk-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.ai-risk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-risk-title {
  font-size: 0.88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-risk-desc {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
  color: var(--text, #0f172a);
}

.ai-risk-recom {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

/* كبسولات المشتريات المالية الذكية */
.cockpit-finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.finance-mini-box {
  padding: 14px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* مركز الموافقات والقرارات (Decision Hub) */
.decision-hub-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.decision-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 14px;
  transition: all 0.2s ease;
}

.decision-item:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateX(-2px);
}

.decision-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.decision-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid rgba(226, 232, 240, 0.9);
  flex-shrink: 0;
}

.decision-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.decision-emp-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text, #0f172a);
}

.decision-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.decision-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* 5. استوديو الرسوم البيانية التفاعلية (Analytics Studio) */
.cockpit-analytics-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  width: 100%;
}

.chart-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-stage-wrap {
  width: 100%;
  position: relative;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-stage-wrap canvas {
  width: 100% !important;
  max-width: 100%;
  display: block;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(203, 213, 225, 0.7);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* شريط النبض العملياتي أسفل المخططات */
.analytics-pulse-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 10px;
}

.pulse-footer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
}

.pulse-footer-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 6. شريط الأوامر التنفيذية السريعة (CEO Speed-Dial) */
.cockpit-speed-dial {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.speed-dial-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.02);
}

.speed-dial-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 24px -2px rgba(37, 99, 235, 0.12);
}

.speed-dial-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.speed-dial-card:hover .speed-dial-icon {
  transform: scale(1.1);
}

.speed-dial-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.speed-dial-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text, #0f172a);
}

.speed-dial-desc {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
}

/* ==========================================================================
   دعم النمط الليلي الفاخر (Dark Mode Contract for Executive Cockpit)
   ========================================================================== */

html[data-theme="dark"] .cockpit-header {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .cockpit-title {
  color: #f8fafc;
}

html[data-theme="dark"] .cockpit-desc {
  color: #94a3b8;
}

html[data-theme="dark"] .cockpit-btn-glass {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(71, 85, 105, 0.6);
  color: #f1f5f9;
}

html[data-theme="dark"] .cockpit-btn-glass:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #60a5fa;
}

html[data-theme="dark"] .sentinel-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(51, 65, 85, 0.65);
}

html[data-theme="dark"] .sentinel-val {
  color: #f8fafc;
}

html[data-theme="dark"] .sentinel-label,
html[data-theme="dark"] .sentinel-sub {
  color: #94a3b8;
}

html[data-theme="dark"] .cockpit-kpi-card {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .cockpit-kpi-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .kpi-main-number {
  color: #f8fafc;
}

html[data-theme="dark"] .kpi-card-label {
  color: #cbd5e1;
}

html[data-theme="dark"] .kpi-card-footer {
  border-top-color: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
}

html[data-theme="dark"] .kpi-mini-track {
  background: rgba(51, 65, 85, 0.6);
}

html[data-theme="dark"] .cockpit-glass-card {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .card-main-title {
  color: #f8fafc;
}

html[data-theme="dark"] .card-subtext {
  color: #94a3b8;
}

html[data-theme="dark"] .decision-item {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(51, 65, 85, 0.6);
}

html[data-theme="dark"] .decision-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(59, 130, 246, 0.4);
}

html[data-theme="dark"] .decision-emp-name {
  color: #f8fafc;
}

html[data-theme="dark"] .decision-meta-row {
  color: #94a3b8;
}

html[data-theme="dark"] .pulse-footer-card {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(51, 65, 85, 0.6);
}

html[data-theme="dark"] .speed-dial-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(51, 65, 85, 0.65);
}

html[data-theme="dark"] .speed-dial-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(59, 130, 246, 0.4);
}

html[data-theme="dark"] .speed-dial-title {
  color: #f8fafc;
}

html[data-theme="dark"] .speed-dial-desc {
  color: #94a3b8;
}

html[data-theme="dark"] .ai-risk-desc {
  color: #e2e8f0;
}

html[data-theme="dark"] .donut-legend-row {
  border-top-color: rgba(51, 65, 85, 0.6);
}

/* ==========================================================================
   تصميم الواجهة التنفيذية المتطابقة مع الهوية المرفقة (Modern Executive Cockpit UI)
   ========================================================================== */

/* 1. الحاوية التنفيذية والخلفية العامة */
.modern-cockpit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

/* 2. الشريط الترحيبي العنابي/البنفسجي الملكي الرشيق (Slim Plum Executive Ribbon) */
.plum-welcome-banner {
  background: linear-gradient(135deg, #46184a 0%, #5d255d 55%, #732f73 100%);
  border-radius: 14px;
  padding: 9px 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  box-shadow: 0 4px 18px rgba(74, 30, 78, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.plum-welcome-banner::before {
  content: '';
  position: absolute;
  top: -35px;
  left: 15%;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.banner-right-info {
  display: flex;
  align-items: center;
}

.banner-welcome-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-greeting-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.banner-greeting-sub {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.1;
}

.banner-user-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.banner-wave-hand {
  font-size: 1.02rem;
  line-height: 1;
}

.banner-pipe-divider {
  color: rgba(255, 255, 255, 0.30);
  font-size: 0.85rem;
  margin: 0 2px;
}

.banner-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.banner-date-badge svg,
.banner-date-icon {
  width: 13px;
  height: 13px;
  opacity: 0.85;
}

.banner-left-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-btn-white {
  background: #ffffff;
  color: #4a194e;
  border: none;
  border-radius: 9px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
}

.banner-btn-white:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  color: #3b113f;
}

.banner-btn-glass {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 9px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.banner-btn-glass:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

.banner-btn-icon {
  width: 14px;
  height: 14px;
}

/* 3. شريط الفلاتر والتحكم (Subheader Overview Bar) */
.overview-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 4px;
}

.overview-right-title {
  display: flex;
  flex-direction: column;
}

.overview-heading {
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--text, #0f172a);
  margin: 0;
}

.overview-date-text {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.overview-left-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.capsule-filter-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.capsule-filter-pill {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.capsule-filter-pill:hover {
  color: #5d255d;
}

.capsule-filter-pill.active {
  background: rgba(93, 37, 93, 0.1);
  color: #5d255d;
  font-weight: 800;
}

.overview-refresh-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.overview-refresh-btn:hover {
  color: #5d255d;
  border-color: #5d255d;
}

/* 4. شبكة البطاقات الثمانية المتطابقة (Modern KPI Grid: 4x2) */
.reference-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.reference-kpi-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

.reference-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
}

/* مؤشر الخط الجانبي الملون على الحافة اليمنى */
.reference-kpi-card::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  right: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--card-accent, #2563eb);
}

.card-metric-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}

.card-metric-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--card-accent, var(--text, #0f172a));
  line-height: 1.15;
  letter-spacing: -0.2px;
}

.card-metric-val small {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--card-accent, var(--text-muted, #64748b));
}

.card-metric-lbl {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  margin-top: 3px;
}

.card-metric-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-icon-bg, rgba(37, 99, 235, 0.1));
  color: var(--card-accent, #2563eb);
  flex-shrink: 0;
}

.card-corner-arrow {
  position: absolute;
  top: 10px;
  left: 10px;
  color: var(--text-muted, #94a3b8);
  opacity: 0.5;
  transition: all 0.2s ease;
}

.reference-kpi-card:hover .card-corner-arrow {
  opacity: 1;
  color: var(--card-accent, #2563eb);
  transform: translate(-2px, -2px);
}

/* 5. قسم الرسوم البيانية التوأم (Charts Twin Grid: 60% / 40%) */
.reference-charts-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  width: 100%;
}

.reference-chart-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.reference-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.reference-chart-title {
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--text, #0f172a);
  margin: 0;
}

.chart-legend-dots {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.legend-dot-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.donut-bottom-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

/* 6. شريط بوابات الأقسام الخمس السفلية (5 Pastel Category Launchpad) */
.pastel-category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  width: 100%;
}

.pastel-category-card {
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  border: 1px solid transparent;
}

.pastel-category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}

.pastel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pastel-card-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: #0f172a;
}

.pastel-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.pastel-card-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pastel-card-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  transition: color 0.15s ease;
}

.pastel-card-link-item:hover {
  color: #0f172a;
}

/* ألوان بطاقات الباستيل الخمس */
.pastel-card-home {
  background: #e6f6f4;
  border-color: #c4ede8;
}

.pastel-card-home .pastel-card-icon {
  background: #0d9488;
}

.pastel-card-requests {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.pastel-card-requests .pastel-card-icon {
  background: #64748b;
}

.pastel-card-employees {
  background: #f3e8ff;
  border-color: #e9d5ff;
}

.pastel-card-employees .pastel-card-icon {
  background: #7e22ce;
}

.pastel-card-control {
  background: #e0f2fe;
  border-color: #bae6fd;
}

.pastel-card-control .pastel-card-icon {
  background: #0284c7;
}

.pastel-card-finance {
  background: #ffe4e6;
  border-color: #fecdd3;
}

.pastel-card-finance .pastel-card-icon {
  background: #e11d48;
}

/* ==========================================================================
   دعم النمط الليلي للواجهة الجديدة (Dark Mode Support)
   ========================================================================== */
html[data-theme="dark"] .plum-welcome-banner,
html[data-theme="dark"] .module-exec-banner {
  background: linear-gradient(135deg, #2b0f2e 0%, #3e163e 55%, #4f1e4f 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .filter-panel,
html[data-theme="dark"] .data-section,
html[data-theme="dark"] .surface-card {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(51, 65, 85, 0.7);
}

html[data-theme="dark"] .data-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border-bottom-color: rgba(51, 65, 85, 0.8);
}

html[data-theme="dark"] .data-table td {
  border-bottom-color: rgba(51, 65, 85, 0.5);
  color: #f8fafc;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.7);
  color: #f8fafc;
}

html[data-theme="dark"] .btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(51, 65, 85, 0.8);
  color: #cbd5e1;
}

html[data-theme="dark"] .btn-secondary:hover {
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border-color: #c084fc;
}

html[data-theme="dark"] .capsule-filter-group {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.7);
}

html[data-theme="dark"] .capsule-filter-pill {
  color: #94a3b8;
}

html[data-theme="dark"] .capsule-filter-pill.active {
  background: rgba(147, 51, 234, 0.25);
  color: #c084fc;
}

html[data-theme="dark"] .overview-refresh-btn {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.7);
  color: #94a3b8;
}

html[data-theme="dark"] .reference-kpi-card,
html[data-theme="dark"] .reference-chart-card {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .overview-heading,
html[data-theme="dark"] .reference-chart-title {
  color: #f8fafc;
}

html[data-theme="dark"] .pastel-category-card {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(51, 65, 85, 0.6);
}

html[data-theme="dark"] .pastel-card-title {
  color: #f8fafc;
}

html[data-theme="dark"] .pastel-card-link-item {
  color: #94a3b8;
}

html[data-theme="dark"] .pastel-card-link-item:hover {
  color: #f8fafc;
}

/* ==========================================================================
   التجاوب مع الشاشات والأجهزة اللوحية والمحمولة (Responsive Design)
   ========================================================================== */
@media (max-width: 1200px) {
  .pastel-category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .reference-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reference-charts-grid {
    grid-template-columns: 1fr;
  }

  .pastel-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .plum-welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .banner-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .overview-subbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 576px) {
  .reference-kpi-grid {
    grid-template-columns: 1fr;
  }

  .pastel-category-grid {
    grid-template-columns: 1fr;
  }

  .capsule-filter-group {
    width: 100%;
    overflow-x: auto;
    justify-content: space-between;
  }

  .banner-title {
    font-size: 1.25rem;
  }

  .card-metric-val {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   التحسينات التفاعلية الفاخرة لمركز القيادة (Cockpit Interactive Enhancements)
   ========================================================================== */

/* أزرار وشريط الفترات الزمنية التفاعلي */
.cockpit-period-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.cockpit-period-btn {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.cockpit-period-btn:hover {
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
}

.cockpit-period-btn.active {
  background: var(--primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* شارة النبض المباشر */
.cockpit-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
}

.cockpit-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: liveDotPulse 1.8s infinite;
}

@keyframes liveDotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* زر التحديث مع دوران الأيقونة */
.cockpit-refresh-spinning i {
  animation: cockpitSpin 0.75s linear infinite;
}

@keyframes cockpitSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

/* كبسولات المؤشرات التفاعلية وقابلية النقر */
.cockpit-kpi-card.interactive {
  cursor: pointer;
  user-select: none;
}

.cockpit-kpi-card.interactive:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 16px 36px -6px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.cockpit-kpi-card.interactive:active {
  transform: translateY(-1px) scale(0.99);
}

.kpi-drilldown-cue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  opacity: 0.85;
  transition: all 0.2s ease;
}

.cockpit-kpi-card:hover .kpi-drilldown-cue {
  opacity: 1;
  transform: translateX(-3px);
}

/* فلاتر مصفوفة القرارات */
.decision-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.decision-filter-pill {
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-muted, #64748b);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.decision-filter-pill:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

.decision-filter-pill.active {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border-color: var(--primary, #2563eb);
}

/* أزرار الإجراء السريع في مصفوفة القرارات */
.decision-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.decision-quick-approve {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  padding: 6px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.decision-quick-approve:hover {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.decision-quick-approve:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* أدوات التحكم في المخططات البيانية */
.chart-controls-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-type-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.chart-type-btn {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.chart-type-btn:hover {
  color: var(--primary, #2563eb);
}

.chart-type-btn.active {
  background: #ffffff;
  color: var(--primary, #2563eb);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* نافذة التحليل التنفيذي المعمق (Drilldown Modal) */
.cockpit-modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
}

.cockpit-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.cockpit-modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: 0 24px 64px -12px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cockpit-modal-backdrop.active .cockpit-modal-card {
  transform: scale(1) translateY(0);
}

.modal-header-luxury {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-title-text {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text, #0f172a);
  margin: 0;
}

.modal-close-btn {
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.8);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.18s ease;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.modal-body-luxury {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drilldown-pills-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.drilldown-pill {
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drilldown-pill-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.drilldown-pill-val {
  font-size: 1.25rem;
  font-weight: 900;
}

.drilldown-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drilldown-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drilldown-row {
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drilldown-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
}

.drilldown-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.7);
  overflow: hidden;
}

.drilldown-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-footer-luxury {
  padding: 16px 24px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(248, 250, 252, 0.5);
  border-radius: 0 0 24px 24px;
}

/* Dark Mode Styles for Interactive Enhancements */
html[data-theme="dark"] .cockpit-period-switcher {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.7);
}

html[data-theme="dark"] .cockpit-period-btn {
  color: #94a3b8;
}

html[data-theme="dark"] .cockpit-period-btn:hover {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
}

html[data-theme="dark"] .cockpit-period-btn.active {
  background: #2563eb;
  color: #ffffff;
}

html[data-theme="dark"] .chart-type-toggle {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.7);
}

html[data-theme="dark"] .chart-type-btn.active {
  background: rgba(51, 65, 85, 0.95);
  color: #60a5fa;
}

html[data-theme="dark"] .cockpit-modal-card {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(51, 65, 85, 0.8);
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .modal-header-luxury,
html[data-theme="dark"] .modal-footer-luxury {
  border-color: rgba(51, 65, 85, 0.7);
  background: rgba(30, 41, 59, 0.5);
}

html[data-theme="dark"] .modal-title-text,
html[data-theme="dark"] .drilldown-section-title {
  color: #f8fafc;
}

html[data-theme="dark"] .drilldown-pill,
html[data-theme="dark"] .drilldown-row {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(51, 65, 85, 0.65);
}

html[data-theme="dark"] .drilldown-pill-label,
html[data-theme="dark"] .drilldown-row-header {
  color: #cbd5e1;
}

html[data-theme="dark"] .decision-filter-pill {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.65);
  color: #94a3b8;
}

html[data-theme="dark"] .decision-filter-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}


/* ==========================================================================
   التجاوب الشامل مع كافة أحجام الشاشات (Full Responsive Design Matrix)
   ========================================================================== */

/* 1. شاشات الحواسيب المحمولة والأجهزة اللوحية الأفقية (1024px - 1280px) */
@media (max-width: 1280px) {
  .cockpit-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .cockpit-sentinel {
    grid-template-columns: repeat(2, 1fr);
  }

  .cockpit-analytics-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-speed-dial {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 2. شاشات الآيباد والأجهزة اللوحية الرأسية (768px - 1023px) */
@media (max-width: 1023px) {
  .cockpit-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }

  .cockpit-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .cockpit-btn {
    flex: 1;
    justify-content: center;
  }

  .cockpit-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cockpit-split-row {
    grid-template-columns: 1fr;
  }

  .cockpit-analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-pulse-footer {
    grid-template-columns: 1fr;
  }

  .cockpit-speed-dial {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3. شاشات الهواتف الذكية (أقل من 768px) */
@media (max-width: 767px) {
  .cockpit-wrapper {
    gap: 16px;
  }

  .cockpit-header {
    padding: 16px;
    border-radius: 16px;
  }

  .cockpit-title {
    font-size: 1.35rem;
  }

  .cockpit-desc {
    font-size: 0.8rem;
  }

  .cockpit-header-actions {
    flex-direction: column;
    width: 100%;
  }

  .cockpit-btn {
    width: 100%;
    text-align: center;
  }

  .cockpit-sentinel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cockpit-kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cockpit-finance-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-speed-dial {
    grid-template-columns: 1fr;
  }

  .decision-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .decision-action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* 4. شاشات الهواتف الصغيرة جداً (أقل من 480px) */
@media (max-width: 480px) {
  .kpi-main-number {
    font-size: 1.55rem;
  }

  .sentinel-val {
    font-size: 1.2rem;
  }

  .cockpit-glass-card {
    padding: 16px;
  }
}

/* ==========================================================================
   القائمة الجانبية التنفيذية الفاخرة (Executive Liquid-Glass Sidebar 4.0)
   Squircle Capsules + Dynamic Badges + Floating Tooltips + Mobile Drawer
   ========================================================================== */

/* وسم الإصدار المصغر للشعار */
.brand-subtag {
  font-size: 0.67rem;
  font-weight: 800;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  padding: 1px 7px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 2px;
  width: fit-content;
  letter-spacing: 0.1px;
}

/* زر إغلاق القائمة في الهواتف الذكية */
.sidebar-close-btn {
  display: none;
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-sub, #64748b);
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  transform: scale(1.05);
}

.sidebar-close-btn svg {
  width: 16px;
  height: 16px;
}

/* تلميح اختصار التصفية */
.sidebar-filter-hint {
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--text-sub, #94a3b8);
  background: rgba(226, 232, 240, 0.7);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  line-height: 1.4;
}

/* كبسولات الأيقونات الملونة بالتصنيف (Duo-tone Squircle Capsules) */
.nav-icon-plum {
  background: rgba(93, 37, 93, 0.12) !important;
  color: #5d255d !important;
}

.nav-icon-blue {
  background: rgba(37, 99, 235, 0.12) !important;
  color: #2563eb !important;
}

.nav-icon-amber {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}

.nav-icon-purple {
  background: rgba(168, 85, 247, 0.12) !important;
  color: #9333ea !important;
}

.nav-icon-cyan {
  background: rgba(6, 182, 212, 0.12) !important;
  color: #0891b2 !important;
}

.nav-icon-emerald {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}

.nav-icon-indigo {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4f46e5 !important;
}

.nav-icon-teal {
  background: rgba(20, 184, 166, 0.12) !important;
  color: #0d9488 !important;
}

.nav-icon-violet {
  background: rgba(139, 92, 246, 0.12) !important;
  color: #7c3aed !important;
}

.nav-icon-rose {
  background: rgba(244, 63, 94, 0.12) !important;
  color: #e11d48 !important;
}

.nav-icon-slate {
  background: rgba(100, 116, 139, 0.12) !important;
  color: #475569 !important;
}

/* تأثير العنصر النشط الفخم بهوية النظام العنابية الملكية */
.sidebar-link.active {
  background: linear-gradient(135deg, #431844 0%, #5d255d 65%, #7e2d7e 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(67, 24, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}

.sidebar-link.active .nav-icon {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.sidebar-link.active .sidebar-active-indicator {
  display: block;
  background: linear-gradient(180deg, #f59e0b, #ec4899);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.85);
}

/* شريط حالة النظام في أسفل القائمة الجانبية (System Sentinel Dock) */
.sidebar-footer-dock {
  padding: 14px 18px;
  border-top: 1px solid rgba(226, 232, 240, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(248, 250, 252, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.sidebar-system-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-sub, #64748b);
  cursor: default;
}

.sys-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  position: relative;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.sys-pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.6;
  animation: sysBeacon 2s infinite;
}

@keyframes sysBeacon {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.sidebar-ver-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-sub, #94a3b8);
  background: rgba(226, 232, 240, 0.7);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

/* طبقة التعتيم الخلفية للشاشات الصغيرة عند فتح القائمة */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* استجابة الشاشات الصغيرة (Mobile Drawer) */
@media (max-width: 991px) {
  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 290px !important;
    max-width: 85vw !important;
    transform: translateX(105%) !important;
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: -12px 0 44px rgba(15, 23, 42, 0.25) !important;
    z-index: 101 !important;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0) !important;
  }

  .sidebar-brand-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .sidebar-close-btn {
    display: flex !important;
  }
}

/* دعم الوضع المصغر للشاشات المكتبية */
body.sidebar-compact .sidebar-footer-dock {
  justify-content: center;
  padding: 12px 0;
}

body.sidebar-compact .sys-pulse-label,
body.sidebar-compact .sidebar-ver-tag {
  display: none !important;
}

/* دعم النمط الليلي للترقيات الجديدة */
html[data-theme="dark"] .brand-subtag {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

html[data-theme="dark"] .sidebar-close-btn {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(51, 65, 85, 0.7);
  color: #94a3b8;
}

html[data-theme="dark"] .sidebar-filter-hint {
  background: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
}

html[data-theme="dark"] .sidebar-footer-dock {
  background: rgba(15, 23, 42, 0.75);
  border-top-color: rgba(51, 65, 85, 0.65);
}

html[data-theme="dark"] .sidebar-system-pill {
  color: #94a3b8;
}

html[data-theme="dark"] .sidebar-ver-tag {
  background: rgba(51, 65, 85, 0.6);
  color: #cbd5e1;
}

/* ==========================================================================
   بوابة تسجيل الدخول التنفيذية الفاخرة (Executive Authentication Suite)
   ========================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  padding: 38px 34px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10), 0 0 1px rgba(255, 255, 255, 0.8) inset;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #431844, #5d255d, #a855f7, #5d255d);
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo-wrap {
  margin-bottom: 12px;
}

.auth-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #5d255d;
  background: rgba(93, 37, 93, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.auth-brand h1 {
  font-size: 1.42rem;
  font-weight: 900;
  color: #0f172a;
  margin: 6px 0 4px;
  letter-spacing: -0.3px;
}

.auth-brand p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-field label,
.auth-label-row label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-label-row span {
  font-size: 0.7rem;
  color: #64748b;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  padding: 2px 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.auth-input-wrap svg {
  color: #94a3b8;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-input-wrap input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  padding: 12px 10px !important;
  font-size: 0.88rem;
  color: #0f172a;
  outline: none;
}

.auth-input-wrap:focus-within {
  border-color: #5d255d;
  box-shadow: 0 0 0 3px rgba(93, 37, 93, 0.14);
}

.auth-input-wrap:focus-within svg {
  color: #5d255d;
}

.auth-password-toggle {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.auth-password-toggle:hover {
  color: #5d255d;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #5d255d 0%, #431844 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 999px !important;
  padding: 13px !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 8px 22px rgba(93, 37, 93, 0.25) !important;
  transition: all 0.2s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(93, 37, 93, 0.35) !important;
}

.auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 700;
}

.auth-footer-note svg {
  width: 15px;
  height: 15px;
  color: #10b981;
}

html[data-theme="dark"] .auth-card {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .auth-brand h1 {
  color: #f8fafc;
}

html[data-theme="dark"] .auth-field label,
html[data-theme="dark"] .auth-label-row label {
  color: #e2e8f0;
}

html[data-theme="dark"] .auth-input-wrap {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.7);
}

html[data-theme="dark"] .auth-input-wrap input {
  color: #f8fafc;
}

/* ==========================================================================
   قوائم وبوابات الوصول السريع المستقلة (Quick Access Section)
   مطابقة تماماً للمرجع البصري (media_1789574154751.jpg)
   ========================================================================== */
.quick-access-section {
  margin-top: 28px;
  margin-bottom: 24px;
  width: 100%;
}

.quick-access-topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.quick-access-actions-wrap {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.qa-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #8b3d88 !important;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.qa-action-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.qa-action-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2px;
  color: #8b3d88 !important;
}

/* الشبكة: 5 أعمدة متساوية مطابقة تماماً للمرجع */
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  width: 100%;
}

/* تصميم البطاقة العامة */
.quick-access-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 16px 16px 14px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-access-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* الألوان الخاصة بكل بطاقة (الخط العلوي والخلفية المتدرجة الناعمة) */
.qa-card-home {
  border-top: 4px solid #14b8a6;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 55%);
}
.qa-card-home .qa-card-icon-badge {
  background: #14b8a6;
}

.qa-card-requests {
  border-top: 4px solid #94a3b8;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 55%);
}
.qa-card-requests .qa-card-icon-badge {
  background: #94a3b8;
}

.qa-card-employees {
  border-top: 4px solid #8b5cf6;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 55%);
}
.qa-card-employees .qa-card-icon-badge {
  background: #8b5cf6;
}

.qa-card-control {
  border-top: 4px solid #0ea5e9;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 55%);
}
.qa-card-control .qa-card-icon-badge {
  background: #0ea5e9;
}

.qa-card-finance {
  border-top: 4px solid #f87171;
  background: linear-gradient(180deg, #fff1f2 0%, #ffffff 55%);
}
.qa-card-finance .qa-card-icon-badge {
  background: #f87171;
}

.qa-card-settings {
  border-top: 4px solid #475569;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 55%);
}
.qa-card-settings .qa-card-icon-badge {
  background: #475569;
}

.qa-card-muqeem {
  border-top: 4px solid #10b981;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 55%);
}
.qa-card-muqeem .qa-card-icon-badge {
  background: #10b981;
}

.qa-card-appraisal {
  border-top: 4px solid #14b8a6;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 55%);
}
.qa-card-appraisal .qa-card-icon-badge {
  background: #14b8a6;
}

/* رأس البطاقة */
.qa-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.qa-card-icon-badge {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.qa-card-icon-badge svg,
.qa-card-icon-badge i {
  width: 20px;
  height: 20px;
  stroke-width: 2.2px;
  color: #ffffff !important;
}

.qa-badge-muqeem {
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.muqeem-badge-text {
  font-size: 0.72rem;
  letter-spacing: -0.2px;
}

.muqeem-badge-text small {
  font-size: 0.58rem;
  font-weight: 600;
  display: block;
}

.qa-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

/* الروابط داخل البطاقة */
.qa-card-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
  flex: 1;
}

.qa-link-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: #334155 !important;
  text-decoration: none !important;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 3px 0;
  transition: color 0.15s ease, transform 0.15s ease;
  width: fit-content;
}

.qa-link-item:hover {
  color: #0f172a !important;
  transform: translateX(-4px);
  text-decoration: none !important;
}

.qa-link-text {
  color: #334155 !important;
  text-decoration: none !important;
}

.qa-link-item:hover .qa-link-text {
  color: #0f172a !important;
  font-weight: 600;
}

.qa-link-chevron {
  width: 14px;
  height: 14px;
  min-width: 14px;
  color: #94a3b8 !important;
  stroke-width: 2.2px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.qa-link-item:hover .qa-link-chevron {
  color: #475569 !important;
  transform: translateX(-2px);
}

/* تذييل حقوق النظام */
.dashboard-copyright-footer {
  text-align: center;
  margin-top: 36px;
  margin-bottom: 20px;
  color: #8b3d88;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* استجابة الشاشات الصغيرة والمتوسطة */
@media (max-width: 1280px) {
  .quick-access-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .quick-access-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .quick-access-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   GLOBAL ENTERPRISE PRINT ENGINE (@media print)
   Converts ANY screen into clean, official paper document layout (A4 / Official Sheets)
   Completely removes the web application interface shell (Sidebar, Navbar, Banners, Buttons, Filters)
   ========================================================================== */
@media print {
  /* 1. Global Print Color & Reset */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 10mm 12mm 10mm 12mm;
  }

  /* 2. Absolute Removal of Application Shell & Interactive UI Elements */
  .app-sidebar,
  .sidebar,
  .main-sidebar,
  .sidebar-wrapper,
  #sidebar,
  .app-header,
  .top-navbar,
  .navbar,
  header:not(.print-header),
  .site-background-media,
  .dynamic-particles-bg,
  .theme-drawer,
  #themeDrawer,
  .drawer-backdrop,
  .ai-chat-modal,
  #aiModal,
  .ai-fab-container,
  .flash-enterprise-banner,
  .alert-dismissible,
  .skip-link,
  .no-print,
  .no-print-toolbar,
  .print-screen-toolbar,
  .btn,
  button:not(.allow-print),
  .banner-btn-white,
  .banner-btn-glass,
  .req-tool-btn,
  .pr-btn-pill,
  .att-tab-btn,
  .att-filter-pill,
  .btn-action,
  .action-btn,
  .pr-action-buttons,
  .pr-top-bar,
  .pr-view-actions-pills,
  .pr-workflow-stepper-card,
  .pr-table-toolbar,
  .pr-toolbar-row,
  .att-tabs-strip,
  .att-filter-group,
  .search-box,
  .search-input,
  .pagination,
  .dataTables_filter,
  .dataTables_paginate,
  .pr-search-box,
  .filter-box,
  .footer,
  .app-footer,
  .dashboard-copyright-footer,
  .pr-modal-backdrop:not(.is-active) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 3. Paper Canvas & Geometry Reset */
  html,
  body,
  body.sidebar-compact,
  body.sidebar-collapsed,
  .app-main-content,
  #main-content,
  main,
  .payslip-page-wrapper,
  .payroll-exact-wrapper,
  .att-report-container,
  .requests-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    position: static !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
    float: none !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 8.5pt !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
  }

  /* 4. Transform Dark/Gradient Banners into Official Clean Letterhead on Paper */
  .module-exec-banner,
  .att-hero-section {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 2px solid #0f172a !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    margin-bottom: 14px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  .module-exec-banner h1,
  .module-exec-banner h2,
  .module-exec-banner h3,
  .att-hero-main-title {
    color: #0f172a !important;
    font-size: 14pt !important;
    font-weight: 800 !important;
    margin-bottom: 4px !important;
  }

  .module-exec-banner p,
  .module-exec-banner span,
  .att-hero-subtitle {
    color: #475569 !important;
    font-size: 8pt !important;
  }

  /* 5. Transform Cards and Surface Grids into Clean Paper Blocks */
  .apple-card,
  .surface-card,
  .stat-card,
  .matrix-card,
  .table-card,
  .pr-panel-card,
  .pr-table-wrapper-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
    page-break-inside: avoid !important;
  }

  /* 6. Clean High-Legibility Paper Tables */
  table,
  .table,
  .data-table,
  .pr-detailed-table,
  .att-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8pt !important;
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
  }

  table thead,
  .pr-detailed-table thead,
  .att-table thead {
    display: table-header-group !important;
  }

  table tfoot,
  .pr-detailed-table tfoot {
    display: table-footer-group !important;
  }

  table tr,
  .pr-detailed-table tr,
  .att-table tr {
    page-break-inside: avoid !important;
  }

  table th,
  table td,
  .pr-detailed-table th,
  .pr-detailed-table td,
  .att-table th,
  .att-table td {
    border: 1px solid #cbd5e1 !important;
    padding: 4px 6px !important;
    text-align: center !important;
    vertical-align: middle !important;
    color: #000000 !important;
  }

  table th,
  .pr-detailed-table th,
  .att-table th {
    background: #f1f5f9 !important;
    font-weight: 800 !important;
    color: #0f172a !important;
  }

  /* 7. Status Badges on Paper */
  .badge,
  .status-badge,
  .pr-status-badge,
  .pr-net-pill,
  .pr-deduct-pill,
  .pr-allowance-pill {
    background: transparent !important;
    border: 1px solid #94a3b8 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-size: 7.5pt !important;
  }

  /* 8. Page Break Utilities */
  .page-break {
    page-break-before: always !important;
  }

  .no-break {
    page-break-inside: avoid !important;
  }
}

/* ==========================================================================
   TC-HRMS Compatibility Layer & Exact Design Subsystem Bundles
   ========================================================================== */

/* Aliases for Unified Requests and Workflow Matrix */
.req-category-strip { display: flex; gap: 8px; overflow-x: auto; }
.req-kpi-strip { display: flex; gap: 12px; margin-bottom: 16px; }
.wft-kpi-strip { display: flex; gap: 12px; margin-bottom: 16px; }
.wft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.wft-card { border-radius: 16px; border: 1px solid var(--line, #e2e8f0); }
.wft-steps-list { display: flex; flex-direction: column; gap: 8px; }
.import-visual-header { margin-bottom: 18px; }
.alerts-page-head { margin-bottom: 18px; }


/* --- requests-exact.css --- */
/**
 * منظومة أوامر HR الذكية — الواجهة المرجعية لطلبات الموظفين
 * تطابق بصري دقيق مع الصورة المرجعية (طلبات المظفين.jpeg و طلبات الموظفين.jpeg)
 */

:root {
    --req-primary: var(--primary, #5d255d);
    --req-primary-light: var(--primary-light, rgba(93, 37, 93, 0.08));
    --req-primary-hover: var(--primary-hover, #431844);
    --req-bg: var(--bg-app, #f5f6fa);
    --req-card-bg: var(--surface, #ffffff);
    --req-border: var(--border-subtle, #eef0f6);
    --req-text-main: var(--text-main, #1e293b);
    --req-text-muted: var(--text-muted, #64748b);
    --req-text-subtle: #94a3b8;
    --req-success: #10b981;
    --req-success-bg: #ecfdf5;
    --req-danger: #ef4444;
    --req-danger-bg: #fee2e2;
    --req-orange: #ea580c;
    --req-orange-bg: #fff7ed;
    --req-orange-btn: #ffedd5;
    --req-font: var(--font-family-base, 'Cairo', sans-serif);
}

/* 1. الحاوية الرئيسية للصفحة */
.req-exact-container {
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 18px 24px 60px 24px;
    font-family: var(--req-font);
    direction: rtl;
    text-align: right;
    color: var(--req-text-main);
    box-sizing: border-box;
}

/* 2. شريط التنقل العلوي المرجعي (Floating Header) */
.req-header-card {
    background: var(--req-card-bg);
    border-radius: 20px;
    border: 1px solid var(--req-border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    padding: 10px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.req-header-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.req-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--req-text-main);
    margin: 0;
    line-height: 1.3;
}

.req-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--req-text-muted);
}

.req-crumb-company {
    font-weight: 500;
    color: var(--req-text-muted);
}

.req-crumb-sep {
    color: var(--req-text-subtle);
    font-size: 0.74rem;
}

.req-crumb-home {
    color: var(--req-primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.req-crumb-home:hover {
    text-decoration: underline;
}

.req-crumb-current {
    color: var(--req-text-subtle);
    font-weight: 500;
}

/* منتصف الشريط العلوي: البحث الصغير */
.req-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.req-header-search {
    position: relative;
    width: 340px;
    max-width: 100%;
}

.req-header-search input {
    width: 100%;
    height: 38px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 0 16px 0 38px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--req-text-main);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    box-sizing: border-box;
}

.req-header-search input:focus {
    border-color: var(--req-primary);
    box-shadow: 0 0 0 3px rgba(138, 59, 143, 0.12);
}

.req-header-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--req-text-subtle);
    width: 15px;
    height: 15px;
    pointer-events: none;
}

/* يسار الشريط العلوي: الأيقونات وحساب المستخدم */
.req-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.req-header-plus-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--req-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 150ms ease, background 150ms ease;
}

.req-header-plus-btn:hover {
    background: var(--req-primary-hover);
    transform: scale(1.04);
}

.req-header-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--req-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
}

.req-header-icon-btn:hover {
    background: #f1f5f9;
    color: var(--req-text-main);
}

.req-header-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.req-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background 150ms ease;
}

.req-header-user:hover {
    background: #f8fafc;
}

.req-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.84rem;
}

.req-header-user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.2;
}

.req-header-username {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--req-text-main);
}

.req-header-userrole {
    font-size: 0.70rem;
    color: var(--req-text-subtle);
    font-weight: 600;
}

.req-header-user-arrow {
    color: var(--req-text-subtle);
    width: 14px;
    height: 14px;
}

/* 3. بطاقة عنوان الصفحة التنفيذية الملكية (Page Subheader Executive Banner) */
.req-title-card {
    background: var(--primary-gradient, linear-gradient(135deg, #431844 0%, #5d255d 100%)) !important;
    border-radius: var(--radius-lg, 24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16) !important;
    padding: 24px 28px !important;
    margin-bottom: 20px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
}

.req-title-card::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.req-title-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.req-title-icon-box {
    width: 52px !important;
    height: 52px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px) !important;
}

.req-title-texts h1 {
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    margin: 0 0 4px 0 !important;
}

.req-title-texts p {
    font-size: 0.90rem !important;
    color: rgba(255, 255, 255, 0.90) !important;
    margin: 0 !important;
    font-weight: 500 !important;
}

.req-title-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.req-stat-box {
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 16px !important;
    padding: 8px 20px !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    min-width: 90px !important;
}

.req-stat-num {
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
}

.req-stat-label {
    font-size: 0.72rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 700 !important;
}

.req-changelog-btn {
    height: 42px !important;
    padding: 0 20px !important;
    border-radius: 999px !important;
    border: none !important;
    background: #ffffff !important;
    color: var(--primary, #5d255d) !important;
    font-size: 0.84rem !important;
    font-weight: 800 !important;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.req-changelog-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16) !important;
}

.req-changelog-btn svg {
    color: var(--primary, #5d255d) !important;
    transition: background 150ms ease,
        border-color 150ms ease;
}

.req-changelog-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--req-text-main);
}

/* 4. شريط أنواع الطلبات الأفقي المرجعي (15 عنصراً) مع أسهم وشريط تمرير احترافي */
.req-types-card {
    background: var(--req-card-bg);
    border-radius: 18px;
    border: 1px solid var(--req-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.02);
    padding: 12px 14px;
    margin-bottom: 16px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.req-types-slider {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 6px 4px 10px 4px;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
    user-select: none;
}

.req-types-slider.is-dragging {
    cursor: grabbing !important;
    user-select: none;
}

.req-types-slider::-webkit-scrollbar {
    height: 6px;
    display: block;
}

.req-types-slider::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.req-types-slider::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.req-types-slider::-webkit-scrollbar-thumb:hover {
    background: var(--req-primary);
}

.req-slider-arrow {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--req-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
}

.req-slider-arrow:hover {
    background: var(--req-primary-light);
    color: var(--req-primary);
    border-color: #d8b4e2;
    transform: scale(1.08);
}

.req-slider-arrow.is-disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

.req-type-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 68px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    font-family: inherit;
    text-decoration: none;
    transition: transform 150ms ease;
}

.req-type-pill:hover {
    transform: translateY(-2px);
}

.req-type-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f1f3f7;
    color: var(--req-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 180ms ease;
}

.req-type-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--req-text-muted);
    white-space: nowrap;
    text-align: center;
    transition: color 150ms ease;
}

/* حالة العنصر النشط (كل الطلبات) */
.req-type-pill.is-active .req-type-icon-box {
    background: var(--req-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(138, 59, 143, 0.32);
}

.req-type-pill.is-active .req-type-label {
    color: var(--req-primary);
    font-weight: 800;
}

/* حالة "نوع جديد (+)" */
.req-type-pill.is-new .req-type-icon-box {
    border: 2px dashed #d8b4e2;
    background: transparent;
    color: var(--req-primary);
}

.req-type-pill.is-new .req-type-label {
    color: var(--req-primary);
    font-weight: 800;
}

/* 5. بطاقة الفلاتر الأربعة المرجعية */
.req-filters-card {
    background: var(--req-card-bg);
    border-radius: 18px;
    border: 1px solid var(--req-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.02);
    padding: 18px 24px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 16px;
    align-items: flex-end;
}

.req-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.req-filter-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--req-text-muted);
}

.req-date-range-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.req-date-input-wrap {
    position: relative;
    flex: 1;
}

.req-date-input-wrap input {
    width: 100%;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 0 12px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--req-text-main);
    box-sizing: border-box;
    outline: none;
    transition: border-color 150ms ease;
}

.req-date-input-wrap input:focus {
    border-color: var(--req-primary);
}

.req-date-arrow {
    color: var(--req-text-subtle);
    font-size: 1.1rem;
    user-select: none;
}

.req-select-input {
    width: 100%;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 0 14px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--req-text-main);
    box-sizing: border-box;
    outline: none;
    cursor: pointer;
    transition: border-color 150ms ease;
}

.req-select-input:focus {
    border-color: var(--req-primary);
}

/* 6. بطاقة جدول طلبات الموظفين (Table Card) */
.req-table-card {
    background: var(--req-card-bg);
    border-radius: 18px;
    border: 1px solid var(--req-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.02);
    padding: 20px 24px;
}

.req-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.req-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.req-tool-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--req-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
    text-decoration: none;
}

.req-tool-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--req-text-main);
}

.req-toolbar-left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.req-toolbar-action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.req-table-search-box {
    position: relative;
    width: 200px;
}

.req-table-search-box input {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 0 12px 0 32px;
    font-size: 0.80rem;
    font-family: inherit;
    color: var(--req-text-main);
    box-sizing: border-box;
    outline: none;
    transition: border-color 150ms ease;
}

.req-table-search-box input:focus {
    border-color: var(--req-primary);
}

.req-table-search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--req-text-subtle);
    width: 14px;
    height: 14px;
    pointer-events: none;
}

/* 7. الجدول والأعمدة الثمانية المرجعية */
.req-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.req-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
    text-align: right;
}

.req-table thead th {
    background: transparent;
    padding: 14px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--req-text-subtle);
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.req-table thead th.th-ctrl {
    text-align: center;
}

.req-table tbody tr {
    transition: background 120ms ease;
}

.req-table tbody tr:hover {
    background: #fbfcfe;
}

.req-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--req-text-main);
}

.req-emp-name {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

/* شارات نوع الطلب مع النقطة الملونة (•) */
.req-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.req-chip::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.req-chip-pink {
    background: #fff1f2;
    color: #e11d48;
}

.req-chip-pink::before {
    background: #e11d48;
}

.req-chip-purple {
    background: #faf5ff;
    color: #9333ea;
}

.req-chip-purple::before {
    background: #9333ea;
}

.req-chip-slate {
    background: #f1f5f9;
    color: #64748b;
}

.req-chip-slate::before {
    background: #64748b;
}

.req-chip-amber {
    background: #fffbeb;
    color: #d97706;
}

.req-chip-amber::before {
    background: #d97706;
}

.req-detail-text {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}

.req-message-text {
    font-size: 0.80rem;
    color: #475569;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.req-date-text {
    font-size: 0.82rem;
    color: var(--req-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* شارات الحالة المرجعية (• تمت الموافقة / • مرفوض) */
.req-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.req-status-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.req-status-approved {
    background: var(--req-success-bg);
    color: var(--req-success);
}

.req-status-approved::before {
    background: var(--req-success);
}

.req-status-rejected {
    background: var(--req-orange-bg);
    color: var(--req-orange);
}

.req-status-rejected::before {
    background: var(--req-orange);
}

.req-status-pending {
    background: #fffbeb;
    color: #d97706;
}

.req-status-pending::before {
    background: #d97706;
}

/* أزرار التحكم في الصفوف (عمود التحكم) */
.req-actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

/* زر التبديل السريع للحالة: خوخي للرفض / أخضر للموافقة */
.req-btn-toggle-reject {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--req-orange-btn);
    color: var(--req-orange);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease;
}

.req-btn-toggle-approve {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #dcfce7;
    color: #16a34a;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease;
}

.req-btn-toggle-reject:hover,
.req-btn-toggle-approve:hover {
    transform: scale(1.06);
}

/* زر التفاصيل البنفسجي */
.req-btn-detail {
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--req-primary-light);
    color: var(--req-primary);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    transition: background 150ms ease;
}

.req-btn-detail:hover {
    background: #eedbfd;
}

/* زر الحذف الأحمر */
.req-btn-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--req-danger-bg);
    color: var(--req-danger);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease, background 150ms ease;
}

.req-btn-delete:hover {
    background: #fecaca;
    transform: scale(1.06);
}

/* 8. الحالة الفارغة (Empty State) المطابقة للصورة المرجعية */
.req-empty-state {
    padding: 50px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.req-empty-icon-box {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #faf5ff;
    color: var(--req-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.req-empty-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--req-text-main);
    margin: 0;
}

.req-empty-sub {
    font-size: 0.82rem;
    color: var(--req-text-subtle);
    margin: 0;
}

/* 9. شريط الترقيم المرجعي (Pagination) */
.req-pagination-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.req-page-size-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.80rem;
    color: var(--req-text-muted);
}

.req-page-size-select {
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 0.80rem;
    font-family: inherit;
    color: var(--req-text-main);
    outline: none;
    cursor: pointer;
}

.req-pages-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.req-page-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--req-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.80rem;
    font-family: inherit;
    transition: all 120ms ease;
}

.req-page-nav-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--req-text-main);
}

.req-page-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.req-page-nav-btn.is-active {
    background: var(--req-primary);
    color: #ffffff;
    border-color: var(--req-primary);
    font-weight: 800;
}

/* 10. النوافذ المنبثقة التفاعلية (Modals) */
.req-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.req-modal-box {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    animation: reqModalFadeIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.req-modal-box.modal-lg {
    max-width: 720px;
}

@keyframes reqModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.req-modal-head {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.req-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--req-text-main);
}

.req-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: var(--req-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease;
}

.req-modal-close:hover {
    background: #e2e8f0;
    color: var(--req-text-main);
}

.req-modal-body {
    padding: 22px 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.req-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.req-modal-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.req-modal-item.full-width {
    grid-column: 1 / -1;
}

.req-modal-item-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--req-text-subtle);
}

.req-modal-item-value {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--req-text-main);
}

.req-modal-foot {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: #fafbfc;
}

/* التجاوب مع مختلف الشاشات */
@media (max-width: 1024px) {
    .req-filters-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .req-header-search {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .req-exact-container {
        padding: 12px;
    }

    .req-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .req-header-center {
        width: 100%;
    }

    .req-header-search {
        width: 100%;
    }

    .req-header-left {
        width: 100%;
        justify-content: space-between;
    }

    .req-title-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .req-title-left {
        width: 100%;
        justify-content: space-between;
    }

    .req-filters-card {
        grid-template-columns: 1fr;
    }

    .req-modal-grid {
        grid-template-columns: 1fr;
    }

    .req-table-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .req-toolbar-left {
        width: 100%;
        align-items: flex-start;
    }
}

/* ════════════════════════════════════════════════════════════════
   11. أنماط التقرير الرسمي والطباعة المعتمدة (@media print)
   ════════════════════════════════════════════════════════════════ */
.req-print-only-header,
.req-print-only-signatures,
.req-print-only-footer {
    display: none;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        size: A4 landscape;
        margin: 8mm 10mm;
    }

    html,
    body {
        background: #ffffff !important;
        color: #0f172a !important;
        font-size: 8.5pt !important;
        line-height: 1.35 !important;
        padding: 0 !important;
        margin: 0 !important;
        direction: rtl !important;
    }

    /* إخفاء عناصر واجهة الويب والأزرار والشريط العلوي والجانبي والمودالات */
    .app-header,
    .app-sidebar,
    .sidebar,
    .navbar-container,
    .navbar-refined,
    .main-nav,
    .req-header-card,
    .req-title-card,
    .req-types-card,
    .req-filters-card,
    .req-table-toolbar,
    .req-pagination-card,
    .req-modal-overlay,
    .req-modal-backdrop,
    .th-ctrl,
    .td-ctrl,
    .btn,
    .req-tool-btn,
    .ai-floating-widget,
    .theme-drawer,
    #themeToggle,
    #soundToggle,
    #menuToggle,
    #top-header-wrapper,
    footer:not(.req-print-only-footer) {
        display: none !important;
    }

    .req-exact-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
    }

    /* إظهار كليشة التقرير الرسمي المعتمد */
    .req-print-only-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 2px solid #0f172a !important;
        padding-bottom: 8px !important;
        margin-bottom: 12px !important;
        page-break-inside: avoid !important;
    }

    .req-prt-col {
        flex: 1;
    }

    .req-prt-right {
        text-align: right;
    }

    .req-prt-org-ar {
        font-size: 13pt;
        font-weight: 900;
        color: #0f172a;
        margin: 0 0 2px 0;
    }

    .req-prt-sub-ar {
        font-size: 8.5pt;
        color: #475569;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .req-prt-meta-row {
        display: flex;
        gap: 12px;
        font-size: 7.5pt;
        color: #64748b;
    }

    .req-prt-meta-row strong {
        color: #0f172a;
    }

    .req-prt-center {
        text-align: center;
        flex: 1.4;
    }

    .req-prt-logo {
        height: 38px;
        max-width: 140px;
        object-fit: contain;
        margin-bottom: 4px;
    }

    .req-prt-main-title {
        font-size: 13pt;
        font-weight: 900;
        color: #0f172a;
        margin: 0 0 2px 0;
        letter-spacing: -0.3px;
    }

    .req-prt-sub-title {
        font-size: 6.5pt;
        color: #64748b;
        font-weight: 800;
        letter-spacing: 0.5px;
    }

    .req-prt-left {
        text-align: left;
        direction: ltr;
    }

    .req-prt-org-en {
        font-size: 10pt;
        font-weight: 800;
        color: #0f172a;
    }

    .req-prt-sub-en {
        font-size: 7.5pt;
        color: #64748b;
        margin-bottom: 4px;
    }

    .req-prt-meta-box {
        font-size: 7.5pt;
        color: #475569;
        line-height: 1.4;
    }

    .req-prt-meta-box strong {
        color: #0f172a;
    }

    /* جدول التقرير الرسمي */
    .req-table-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .req-table-scroll {
        overflow: visible !important;
    }

    .req-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 6px !important;
        border: 1px solid #94a3b8 !important;
        font-size: 8pt !important;
    }

    .req-table thead {
        display: table-header-group !important;
    }

    .req-table th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
        padding: 6px 8px !important;
        font-weight: 900 !important;
        font-size: 8pt !important;
        text-align: right !important;
    }

    .req-table td {
        border: 1px solid #e2e8f0 !important;
        padding: 6px 8px !important;
        color: #1e293b !important;
        font-size: 8pt !important;
        line-height: 1.3 !important;
        vertical-align: middle !important;
        background: #ffffff !important;
    }

    .req-table tr:nth-child(even) td {
        background: #f8fafc !important;
    }

    .req-emp-avatar {
        display: none !important;
    }

    .req-emp-name {
        font-weight: 800 !important;
        color: #0f172a !important;
        font-size: 8.5pt !important;
    }

    .req-emp-id {
        font-size: 7pt !important;
        color: #64748b !important;
    }

    .req-badge-type {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
        font-weight: 700 !important;
        font-size: 7.5pt !important;
    }

    .req-badge-status {
        padding: 2px 6px !important;
        border-radius: 4px !important;
        font-weight: 800 !important;
        font-size: 7.5pt !important;
        display: inline-block !important;
        border: 1px solid currentColor !important;
    }

    .req-badge-status.is-approved {
        background: #ecfdf5 !important;
        color: #065f46 !important;
        border-color: #a7f3d0 !important;
    }

    .req-badge-status.is-pending {
        background: #fffbeb !important;
        color: #92400e !important;
        border-color: #fde68a !important;
    }

    .req-badge-status.is-rejected {
        background: #fef2f2 !important;
        color: #991b1b !important;
        border-color: #fecaca !important;
    }

    /* قسم التوقيعات والختم المعتمد */
    .req-print-only-signatures {
        display: block !important;
        margin-top: 14px !important;
        page-break-inside: avoid !important;
    }

    .req-prt-audit-notes {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-right: 3px solid #0f172a !important;
        border-radius: 4px !important;
        padding: 6px 10px !important;
        font-size: 7pt !important;
        color: #475569 !important;
        margin-bottom: 12px !important;
        line-height: 1.4 !important;
    }

    .req-prt-sig-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr 110px !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    .req-prt-sig-block {
        border: 1px solid #cbd5e1 !important;
        border-radius: 4px !important;
        padding: 8px 10px !important;
        background: #ffffff !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        min-height: 72px !important;
        text-align: center !important;
    }

    .req-prt-sig-role {
        font-size: 7.5pt !important;
        font-weight: 800 !important;
        color: #0f172a !important;
    }

    .req-prt-sig-sub {
        font-size: 5.5pt !important;
        color: #64748b !important;
        text-transform: uppercase !important;
    }

    .req-prt-sig-line {
        border-bottom: 1px dashed #cbd5e1 !important;
        margin: 18px 12px 6px 12px !important;
    }

    .req-prt-sig-name {
        font-size: 7.5pt !important;
        font-weight: 700 !important;
        color: #334155 !important;
    }

    .req-prt-seal-box {
        border: 2px dashed #94a3b8 !important;
        border-radius: 4px !important;
        padding: 6px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 6.5pt !important;
        font-weight: 800 !important;
        color: #64748b !important;
        background: #fafbfc !important;
    }

    /* التذييل الرسمي */
    .req-print-only-footer {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px solid #cbd5e1 !important;
        padding-top: 6px !important;
        margin-top: 12px !important;
        font-size: 6.5pt !important;
        color: #64748b !important;
        page-break-inside: avoid !important;
    }
}

/* --- workflow-matrix-exact.css --- */
/**
 * نظام الأوامر التقنية لإدارة الموارد البشرية والرواتب (TC-HRMS Enterprise)
 * تصميم صفحة «تسلسل الموافقات / أنواع الطلبات» - مطابقة طبق الأصل للصورة المرجعية
 */

.workflow-matrix-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* 1. بانر الهيرو العلوي الأبيض المطابق للمرجع */
.wf-hero-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    padding: 20px 26px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.wf-hero-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wf-hero-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #7c3aed;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.wf-hero-icon-box i,
.wf-hero-icon-box svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

.wf-hero-titles h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.25;
}

.wf-hero-titles p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 4px 0 0;
    font-weight: 500;
}

.wf-hero-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    text-align: center;
}

.wf-hero-count {
    font-size: 2.1rem;
    font-weight: 900;
    color: #8b5cf6;
    line-height: 1;
    letter-spacing: -0.03em;
}

.wf-hero-label {
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 700;
    margin-top: 4px;
}

/* 2. شبكة البطاقات (5 أعمدة) */
.wf-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* 3. تصميم البطاقة الواحدة */
.wf-type-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.wf-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px -4px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

/* رأس البطاقة: اسم الطلب وبادج عدد الخطوات */
.wf-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
}

.wf-card-title {
    font-size: 0.94rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.wf-steps-badge {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fce7f3;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* جسم البطاقة: قائمة خطوات الاعتماد المرقمة */
.wf-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    flex-grow: 1;
}

.wf-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wf-step-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wf-step-role {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.25;
}

/* خطوة قبول الطلب الختامية */
.wf-step-final {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    font-weight: 800;
    font-size: 0.78rem;
    margin-top: 4px;
    padding-inline-start: 2px;
}

.wf-step-final i,
.wf-step-final svg {
    width: 15px;
    height: 15px;
    color: #10b981;
    flex-shrink: 0;
}

/* أسفل البطاقة: زر تعديل وزر إعادة تعيين */
.wf-card-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.wf-btn-edit {
    background: #7c3aed;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.wf-btn-edit:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.wf-btn-edit i,
.wf-btn-edit svg {
    width: 13px;
    height: 13px;
    color: #ffffff;
}

.wf-btn-reset {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wf-btn-reset:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.wf-btn-reset i,
.wf-btn-reset svg {
    width: 13px;
    height: 13px;
    color: #ef4444;
}

/* 4. النافذة المنبثقة للتعديل التفاعلي (Modal) */
.wf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 16px;
}

.wf-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wf-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: wfModalPop 0.25s ease-out;
}

@keyframes wfModalPop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.wf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
}

.wf-modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.wf-modal-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px;
}

.wf-modal-close-btn:hover {
    color: #0f172a;
}

.wf-modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.wf-modal-steps-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wf-edit-step-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
}

.wf-edit-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wf-edit-step-select {
    flex: 1;
    padding: 7px 10px;
    font-size: 0.82rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    outline: none;
}

.wf-edit-step-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wf-btn-add-step {
    border: 1px dashed #cbd5e1;
    background: #ffffff;
    color: #6366f1;
    padding: 9px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wf-btn-add-step:hover {
    background: #f8fafc;
    border-color: #6366f1;
}

.wf-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.wf-btn-cancel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.wf-btn-save {
    background: #7c3aed;
    border: none;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.wf-btn-save:hover {
    background: #6d28d9;
}

/* 5. تصميم النافذة الاحترافية لتأكيد إعادة التعيين */
.wf-confirm-modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    padding: 32px 28px 26px;
    text-align: center;
    position: relative;
    animation: wfConfirmPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #e2e8f0;
}

@keyframes wfConfirmPop {
    from {
        transform: scale(0.92) translateY(10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.wf-confirm-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.wf-confirm-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.wf-confirm-icon-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wf-confirm-icon-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    animation: wfPulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes wfPulseRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.3;
    }
}

.wf-confirm-icon-core {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fef2f2;
    border: 2px solid #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wf-confirm-icon-core i,
.wf-confirm-icon-core svg {
    width: 26px;
    height: 26px;
    color: #ef4444;
}

.wf-confirm-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    line-height: 1.3;
}

.wf-confirm-text {
    font-size: 0.86rem;
    color: #475569;
    margin: 0 0 16px;
    line-height: 1.6;
}

.wf-confirm-highlight {
    display: inline-block;
    background: #ede9fe;
    color: #6d28d9;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 800;
    margin: 2px 4px;
}

.wf-confirm-warning-box {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.78rem;
    color: #92400e;
    text-align: right;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 22px;
    line-height: 1.5;
}

.wf-confirm-warning-box i,
.wf-confirm-warning-box svg {
    width: 16px;
    height: 16px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 2px;
}

.wf-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.wf-btn-confirm-action {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.88rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.wf-btn-confirm-action:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.wf-btn-confirm-cancel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: 0.86rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wf-btn-confirm-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* 6. التجاوب (Responsive Breakpoints) */
@media (max-width: 1440px) {
    .wf-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .wf-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wf-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .wf-hero-card {
        padding: 16px 18px;
    }
}

@media (max-width: 500px) {
    .wf-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* وضع الطباعة */
@media print {
    .app-header,
    .app-sidebar,
    .wf-card-footer,
    .wf-modal-overlay {
        display: none !important;
    }
    .wf-hero-card,
    .wf-type-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}


/* --- import-exact.css --- */
/* ==========================================================================
   TC-HRMS Enterprise — استيراد الموظفين من ملفات Excel و CSV
   تنسيق مطابق طبق الأصل للصورة المرجعية (Reference Exact Design)
   ========================================================================== */

.import-exact-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 16px 40px;
    font-family: inherit;
    color: #1e293b;
    direction: rtl;
}

/* 1. المسار العلوي المرجعي (Top Breadcrumb Bar) */
.import-top-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.import-page-title {
    font-size: 1.55rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.import-nav-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 700;
}

.import-nav-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.import-nav-breadcrumbs a:hover {
    color: #7c3aed;
}

.import-nav-breadcrumbs .bc-home {
    color: #7c3aed;
}

.import-nav-breadcrumbs .bc-sep {
    color: #94a3b8;
    font-size: 0.85rem;
}

.import-nav-breadcrumbs .bc-current {
    color: #0f172a;
    font-weight: 800;
}

/* 2. بطاقة ترويسة الصفحة (Hero Title Row) */
.import-hero-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.import-hero-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed 0%, #5d255d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
    flex-shrink: 0;
}

.import-hero-text h2 {
    font-size: 1.28rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 3px 0;
}

.import-hero-text p {
    font-size: 0.84rem;
    color: #64748b;
    margin: 0;
    font-weight: 600;
}

/* 3. شريط المراحل الأربعة العلوي (4 Steps Capsule Bar) */
.import-main-steps-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #eef2f6;
    padding: 8px 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    gap: 10px;
}

.main-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-radius: 14px;
    transition: all 0.2s;
    user-select: none;
}

.main-step-item.active {
    background: #fbf7fc;
    border: 1px solid #f3e8ff;
}

.main-step-item .step-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.main-step-item.active .step-icon-badge {
    background: linear-gradient(135deg, #7c3aed 0%, #5d255d 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.25);
}

.main-step-item .step-text-wrap {
    display: flex;
    flex-direction: column;
}

.main-step-item .step-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #334155;
}

.main-step-item.active .step-title {
    color: #0f172a;
}

.main-step-item .step-subtitle {
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 600;
}

.main-step-item.active .step-subtitle {
    color: #64748b;
}

/* 4. كروت المراحل الفرعية الثلاث (3 Sub-steps Cards) */
.import-substeps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.substep-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: relative;
    transition: all 0.2s;
}

.substep-card.active {
    border: 1.5px solid #d8b4fe;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.06);
}

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

.substep-num {
    font-size: 1.3rem;
    font-weight: 900;
    color: #cbd5e1;
    font-family: inherit;
    line-height: 1;
}

.substep-card.active .substep-num {
    color: #7c3aed;
}

.substep-icon {
    width: 20px;
    height: 20px;
    color: #94a3b8;
}

.substep-card.active .substep-icon {
    color: #7c3aed;
}

.substep-title {
    font-size: 0.98rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.substep-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
    font-weight: 600;
}

/* 5. بطاقة اختيار الأعمدة الرئيسية (Choose Columns Card) */
.import-columns-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.02);
}

.columns-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.columns-card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.columns-card-icon {
    width: 22px;
    height: 22px;
    color: #7c3aed;
}

.columns-card-title-group h3 {
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 3px 0;
}

.columns-card-title-group p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    font-weight: 600;
}

/* شبكة المجموعات الست (6 Groups Grid - 3 columns, 2 rows) */
.columns-groups-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.group-container-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.01);
}

.group-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.group-title {
    font-size: 0.90rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}

.btn-group-toggle-all {
    background: none;
    border: none;
    color: #8b3d88;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-group-toggle-all:hover {
    background: #fbf7fc;
    color: #5d255d;
}

/* الكبسولات / الرقائق (Chips) */
.group-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.column-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 0.79rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    outline: none;
    user-select: none;
    font-family: inherit;
}

.column-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
}

.column-chip .chip-symbol {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
}

/* الكبسولة المحددة (Selected Chip) */
.column-chip.selected {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.column-chip.selected .chip-symbol {
    color: #6d28d9;
}

/* الكبسولة المقفلة / الإلزامية (Locked Chip: الاسم ورقم الجوال) */
.column-chip.locked {
    background: #ede9fe !important;
    border-color: #c4b5fd !important;
    color: #6d28d9 !important;
    cursor: default;
    box-shadow: 0 1px 4px rgba(109, 40, 217, 0.08);
}

.column-chip.locked .chip-symbol {
    color: #6d28d9;
}

/* 6. شريط التلخيص والتحميل السفلي (Summary & Download Bar) */
.columns-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 14px;
}

.summary-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ede9fe;
    color: #6d28d9;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.79rem;
    font-weight: 800;
}

.badge-dot {
    font-size: 0.6rem;
    color: #6d28d9;
}

.summary-text {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.summary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-download-template {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed 0%, #5d255d 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-download-template:hover {
    opacity: 0.94;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}

.btn-download-template-csv {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #5d255d;
    border: 1.5px solid #d8b4fe;
    border-radius: 12px;
    padding: 9px 16px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-download-template-csv:hover {
    background: #fbf7fc;
}

/* 7. بطاقة رفع الملف بعد تعبئته (Upload Section Card) */
.import-upload-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.02);
}

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

.upload-card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fbf7fc;
    border: 1px solid #f3e8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-card-title-group h3 {
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 3px 0;
}

.upload-card-title-group p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    font-weight: 600;
}

/* منطقة السحب والإفلات (Dropzone) */
.import-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 18px;
    background: #fafafa;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: #7c3aed;
    background: #fbf7fc;
}

.dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dropzone-cloud-squircle {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #ede9fe;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.dropzone-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #1e293b;
}

.dropzone-title .browse-link {
    color: #7c3aed;
    text-decoration: underline;
}

.dropzone-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
}

/* حالة الملف المرفوع داخل Dropzone */
.dropzone-file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.selected-file-left {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: right;
}

.selected-file-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f0fdf4;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.selected-file-name {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
}

.selected-file-meta {
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-remove-file {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #fee2e2;
    background: #fef2f2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-remove-file:hover {
    background: #fee2e2;
}

/* 8. شريط الإجراءات السفلي (Bottom Actions Row) */
.import-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 0 4px;
}

.btn-import-cancel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 10px 32px;
    text-decoration: none;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-import-cancel:hover {
    background: #f8fafc;
    color: #1e293b;
}

.import-submit-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.import-submit-hint {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 600;
}

.btn-import-continue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed 0%, #5d255d 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 11px 32px;
    font-size: 0.90rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.28);
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-import-continue:hover:not(:disabled) {
    opacity: 0.94;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-import-continue:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* لوحة المعاينة والمطابقة الحية (Live Mapping Table Panel) */
.import-preview-panel {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    padding: 24px;
    margin-top: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.02);
}

.preview-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.preview-stats-bar {
    display: flex;
    gap: 12px;
}

.preview-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.preview-stat-pill.success {
    background: #dcfce7;
    color: #15803d;
}

.preview-stat-pill.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.preview-stat-pill.neutral {
    background: #f1f5f9;
    color: #475569;
}

.preview-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.preview-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: right;
}

.preview-data-table th {
    background: #f8fafc;
    padding: 10px 14px;
    color: #475569;
    font-weight: 800;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.preview-data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    white-space: nowrap;
}

.preview-data-table tr:hover td {
    background: #fbf7fc;
}

/* شاشات الجوال والتابلت (Responsive) */
@media (max-width: 1024px) {
    .columns-groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .import-main-steps-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .columns-groups-grid {
        grid-template-columns: 1fr;
    }
    .import-substeps-row {
        grid-template-columns: 1fr;
    }
    .import-main-steps-bar {
        grid-template-columns: 1fr;
    }
    .columns-summary-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-download-template {
        justify-content: center;
    }
    .import-bottom-bar {
        flex-direction: column-reverse;
        gap: 14px;
        align-items: stretch;
    }
    .btn-import-cancel,
    .btn-import-continue {
        width: 100%;
        justify-content: center;
    }
    .import-submit-group {
        flex-direction: column;
        width: 100%;
    }
}


/* --- warnings-exact.css --- */
/**
 * واجهة التنبيهات والإنذارات — AwamerHR VIP Enterprise Edition 360°
 * تصميم تنفيذي فائق الفخامة، المرونة، والاحترافية
 */

:root {
    --warn-royal-purple: #431844;
    --warn-royal-purple-light: #5d255d;
    --warn-purple: #7c3aed;
    --warn-purple-hover: #6d28d9;
    --warn-purple-light: #f5f3ff;
    --warn-purple-subtle: rgba(124, 58, 237, 0.08);

    --warn-amber: #d97706;
    --warn-amber-dark: #b45309;
    --warn-amber-light: #fffbeb;
    --warn-amber-border: rgba(217, 119, 6, 0.25);

    --warn-red: #ef4444;
    --warn-red-dark: #b91c1c;
    --warn-red-light: #fef2f2;
    --warn-red-border: rgba(239, 68, 68, 0.25);

    --warn-blue: #0284c7;
    --warn-blue-light: #f0f9ff;

    --warn-emerald: #10b981;
    --warn-emerald-light: #ecfdf5;

    --warn-border: #e2e8f0;
    --warn-border-subtle: #f1f5f9;
    --warn-border-input: #cbd5e1;

    --warn-text-main: #0f172a;
    --warn-text-body: #334155;
    --warn-text-muted: #64748b;
    --warn-text-light: #94a3b8;

    --warn-card-bg: #ffffff;
    --warn-radius: 18px;
    --warn-radius-sm: 10px;
    --warn-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    --warn-shadow-hover: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.warn-container {
    width: 100%;
    margin: 0 auto;
    padding: 6px 0 40px;
    font-family: inherit;
    direction: rtl;
}

/* ==========================================================
   1. شريط التحليل والتوزيع الانضباطي السريع (Analytics Strip)
   ========================================================== */
.warn-analytics-card {
    background: #ffffff;
    border: 1px solid var(--warn-border);
    border-radius: 20px;
    padding: 18px 24px;
    margin-bottom: 24px;
    box-shadow: var(--warn-shadow);
}

.warn-analytics-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.warn-analytics-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--warn-text-main);
}

.warn-analytics-bar-wrap {
    width: 100%;
    height: 10px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    margin-bottom: 14px;
}

.warn-bar-seg {
    height: 100%;
    transition: width 0.4s ease;
}

.warn-bar-seg.seg-critical { background: #dc2626; }
.warn-bar-seg.seg-warning { background: #ea580c; }
.warn-bar-seg.seg-notice { background: #d97706; }
.warn-bar-seg.seg-guidance { background: #7c3aed; }

.warn-analytics-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--warn-text-muted);
}

.warn-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.warn-legend-item:hover {
    background: #f8fafc;
    color: var(--warn-text-main);
}

.warn-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

/* ==========================================================
   2. شريط التحكم والفلترة المتقدم والمرن (Smart Multi-Filter)
   ========================================================== */
.warn-toolbar-advanced {
    background: #ffffff;
    border: 1px solid var(--warn-border);
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--warn-shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.warn-toolbar-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.warn-toolbar-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* تبويبات التصفية الرئيسية */
.warn-filter-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.warn-filter-tab {
    border: none;
    background: transparent;
    padding: 7px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--warn-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.warn-filter-tab:hover {
    color: var(--warn-text-main);
    background: rgba(0,0,0,0.03);
}

.warn-filter-tab.active {
    background: #ffffff;
    color: var(--warn-royal-purple);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.warn-filter-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: #f1f5f9;
    color: #475569;
}

.warn-filter-tab.active .warn-filter-badge-count {
    background: var(--warn-purple-light);
    color: var(--warn-royal-purple);
}

/* محرك البحث السريع */
.warn-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 240px;
}

.warn-search-input {
    width: 100%;
    padding: 9px 38px 9px 14px;
    border-radius: 12px;
    border: 1px solid var(--warn-border-input);
    background: #f8fafc;
    font-size: 0.88rem;
    color: var(--warn-text-main);
    outline: none;
    transition: all 0.2s ease;
}

.warn-search-input:focus {
    background: #ffffff;
    border-color: var(--warn-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.warn-search-icon {
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.warn-search-clear {
    position: absolute;
    left: 10px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warn-search-clear:hover {
    color: #475569;
}

/* قوائم التصفية الإضافية (Dropdowns) */
.warn-dropdown-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.warn-select-filter {
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--warn-border-input);
    background: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--warn-text-body);
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warn-select-filter:focus {
    border-color: var(--warn-purple);
}

/* أزرار الإجراءات والتحكم */
.warn-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    border: 1px solid var(--warn-border-input);
    color: #475569;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.warn-action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--warn-text-main);
    transform: translateY(-1px);
}

.warn-action-btn i,
.warn-action-btn svg {
    width: 15px;
    height: 15px;
    color: var(--warn-purple);
}

/* مبدل طرق العرض الثلاثي (Grid / List / Table) */
.warn-view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.warn-view-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warn-view-btn:hover:not(.active) {
    color: #0f172a;
    background: rgba(0,0,0,0.04);
}

.warn-view-btn.active {
    background: #ffffff;
    color: var(--warn-royal-purple);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.warn-view-btn i,
.warn-view-btn svg {
    width: 17px;
    height: 17px;
}

/* ==========================================================
   3. شريط الإجراءات المجمعة الذكي (Floating Bulk Action Bar)
   ========================================================== */
.warn-bulk-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 999px;
    box-shadow: 0 16px 36px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: none;
}

.warn-bulk-bar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.warn-bulk-count {
    font-size: 0.88rem;
    font-weight: 800;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.warn-bulk-count-pill {
    background: var(--warn-purple);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.warn-bulk-btn {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.warn-bulk-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-1px);
}

.warn-bulk-btn-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warn-bulk-btn-close:hover {
    color: #ffffff;
}

/* ==========================================================
   4. بطاقات الإجراءات (Cards Grid View)
   ========================================================== */
.warn-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1450px) {
    .warn-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

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

@media (max-width: 650px) {
    .warn-cards-grid { grid-template-columns: 1fr; }
}

/* بطاقة الإضافة الرئيسية */
.warn-add-card {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: var(--warn-radius);
    padding: 24px;
    min-height: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: var(--warn-shadow);
    color: inherit;
    width: 100%;
}

.warn-add-card:hover {
    border-color: var(--warn-purple);
    background: #faf9ff;
    transform: translateY(-3px);
    box-shadow: var(--warn-shadow-hover);
}

.warn-add-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(124, 58, 237, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: var(--warn-purple);
    transition: all 0.25s ease;
}

.warn-add-card:hover .warn-add-icon-box {
    background: var(--warn-purple);
    color: #ffffff;
    transform: scale(1.08);
}

.warn-add-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--warn-text-main);
    margin: 0 0 4px;
}

.warn-add-sub {
    font-size: 0.78rem;
    color: var(--warn-text-muted);
}

/* بطاقات التنبيهات والإنذارات الفردية */
.warn-card {
    background: var(--warn-card-bg);
    border: 1px solid var(--warn-border);
    border-radius: var(--warn-radius);
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 270px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--warn-shadow);
    position: relative;
    overflow: hidden;
}

.warn-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--warn-shadow-hover);
    border-color: #cbd5e1;
}

/* مؤشر اختيار البطاقة للـ Bulk Selection */
.warn-card-select-box {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.warn-card:hover .warn-card-select-box,
.warn-card.selected .warn-card-select-box {
    opacity: 1;
}

.warn-card.selected {
    border-color: var(--warn-purple) !important;
    background: #faf8ff;
    box-shadow: 0 0 0 2px var(--warn-purple);
}

.warn-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    cursor: pointer;
    accent-color: var(--warn-purple);
}

/* السمات اللونية للبطاقات */
.card-theme-critical {
    border-right: 5px solid #dc2626 !important;
}
.card-theme-warning {
    border-right: 5px solid #ea580c !important;
}
.card-theme-notice {
    border-right: 5px solid #d97706 !important;
}
.card-theme-guidance {
    border-right: 5px solid #7c3aed !important;
}

/* رأس البطاقة */
.warn-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-right: 24px; /* مساحة للتشيك بوكس */
}

.warn-creator-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.warn-creator-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.warn-creator-avatar i,
.warn-creator-avatar svg {
    width: 14px;
    height: 14px;
}

.warn-creator-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--warn-text-muted);
}

.warn-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 8px;
}

.warn-badge.badge-critical {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.warn-badge.badge-warning {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.2);
}

.warn-badge.badge-notice {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.warn-badge.badge-guidance {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* جسم البطاقة */
.warn-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.warn-card-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--warn-text-main);
    margin: 0 0 6px;
    line-height: 1.35;
}

.warn-card-desc {
    font-size: 0.83rem;
    color: var(--warn-text-body);
    line-height: 1.55;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 38px;
}

/* شرائح البيانات التكميلية (Meta Chips) */
.warn-card-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.warn-card-emp-chip,
.warn-card-date-chip,
.warn-penalty-chip,
.warn-dept-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.warn-card-emp-chip {
    background: #f1f5f9;
    color: #1e293b;
}

.warn-card-date-chip {
    background: #f8fafc;
    color: #64748b;
}

.warn-penalty-chip {
    background: #fef2f2;
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.2);
}

.warn-dept-chip {
    background: #f0f9ff;
    color: #0369a1;
    border-color: rgba(2, 132, 199, 0.2);
}

.warn-card-meta-row i,
.warn-card-meta-row svg {
    width: 12px;
    height: 12px;
}

/* أسفل البطاقة (الأزرار) */
.warn-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.warn-btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--warn-royal-purple);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(67, 24, 68, 0.2);
    text-decoration: none;
}

.warn-btn-view:hover {
    background: var(--warn-royal-purple-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(67, 24, 68, 0.3);
}

.warn-btn-print-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #ffffff;
    color: #475569;
    border: 1px solid var(--warn-border-input);
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warn-btn-print-card:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

.warn-btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warn-btn-delete:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #ef4444;
}

.warn-card-foot i,
.warn-card-foot svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================
   5. نمط القائمة التنفيذي المدمج (List View)
   ========================================================== */
.warn-cards-grid[data-view="list"] {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warn-cards-grid[data-view="list"] .warn-add-card {
    min-height: 60px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 20px;
    gap: 16px;
}

.warn-cards-grid[data-view="list"] .warn-add-icon-box {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
    border-radius: 10px;
}

.warn-cards-grid[data-view="list"] .warn-add-sub {
    margin-right: 12px;
}

.warn-cards-grid[data-view="list"] .warn-card {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    padding: 14px 20px;
    gap: 18px;
}

.warn-cards-grid[data-view="list"] .warn-card-select-box {
    position: static;
    opacity: 1;
}

.warn-cards-grid[data-view="list"] .warn-card-head {
    margin-bottom: 0;
    padding-right: 0;
    flex-shrink: 0;
    min-width: 160px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.warn-cards-grid[data-view="list"] .warn-card-body {
    margin-bottom: 0;
    flex: 1;
}

.warn-cards-grid[data-view="list"] .warn-card-title {
    margin-bottom: 2px;
}

.warn-cards-grid[data-view="list"] .warn-card-desc {
    margin-bottom: 6px;
    -webkit-line-clamp: 1;
    min-height: auto;
}

.warn-cards-grid[data-view="list"] .warn-card-foot {
    border-top: none;
    padding-top: 0;
    flex-shrink: 0;
}

/* ==========================================================
   6. نمط الجدول البياني الشامل (Table View)
   ========================================================== */
.warn-cards-grid[data-view="table"] {
    display: none;
}

.warn-table-container {
    background: #ffffff;
    border: 1px solid var(--warn-border);
    border-radius: 20px;
    box-shadow: var(--warn-shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.warn-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: right;
}

.warn-data-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 800;
    color: #475569;
    border-bottom: 1px solid var(--warn-border);
    white-space: nowrap;
}

.warn-data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--warn-text-main);
    vertical-align: middle;
}

.warn-data-table tr:hover td {
    background: #fbfbfe;
}

/* ==========================================================
   7. النوافذ المنبثقة التفاعلية ذات التبويبات (Tabbed Modals)
   ========================================================== */
.warn-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: warnFadeIn 0.2s ease-out;
}

.warn-modal-backdrop[hidden] {
    display: none !important;
}

@keyframes warnFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.warn-modal-box {
    background: #ffffff;
    border-radius: 22px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    height: auto;
    position: relative;
    animation: warnSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.warn-modal-box.modal-lg {
    max-width: 860px;
}

.warn-modal-box.modal-sm {
    max-width: 440px;
}

.warn-modal-box form,
.warn-modal-form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    gap: 0 !important;
}

@keyframes warnSlideUp {
    from { transform: translateY(18px) scale(0.98); }
    to { transform: translateY(0) scale(1); }
}

.warn-modal-head {
    flex-shrink: 0;
    padding: 16px 24px;
    border-bottom: 1px solid var(--warn-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}

.warn-modal-head-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.warn-modal-head-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(67, 24, 68, 0.08);
    color: var(--warn-royal-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.warn-modal-head-icon.icon-danger {
    background: #fef2f2;
    color: #ef4444;
}

.warn-modal-head-title h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--warn-text-main);
}

.warn-modal-head-title p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--warn-text-muted);
}

.warn-modal-close-btn {
    background: transparent;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.warn-modal-close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* تبويبات داخل المودال */
.warn-modal-nav-tabs {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px 0;
    background: #fafbfc;
    border-bottom: 1px solid var(--warn-border);
}

.warn-modal-tab-btn {
    border: none;
    background: transparent;
    padding: 9px 14px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--warn-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.warn-modal-tab-btn:hover {
    color: var(--warn-text-main);
}

.warn-modal-tab-btn.active {
    color: var(--warn-royal-purple);
    border-bottom-color: var(--warn-royal-purple);
}

.warn-modal-body {
    padding: 20px 24px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* تخصيص شريط التمرير */
.warn-modal-body::-webkit-scrollbar {
    width: 6px;
}
.warn-modal-body::-webkit-scrollbar-track {
    background: #f8fafc;
}
.warn-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
.warn-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.warn-modal-tab-pane {
    display: none;
}

.warn-modal-tab-pane.active {
    display: block;
}

.warn-modal-foot {
    flex-shrink: 0;
    padding: 14px 24px;
    border-top: 1px solid var(--warn-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: #fafbfc;
}


/* عناصر النماذج */
.warn-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .warn-form-grid { grid-template-columns: 1fr; }
}

.warn-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.warn-form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--warn-text-body);
}

.warn-form-group label b {
    color: #ef4444;
}

.warn-input,
.warn-select,
.warn-textarea {
    width: 100%;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--warn-border-input);
    font-size: 0.88rem;
    color: var(--warn-text-main);
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease;
}

.warn-input:focus,
.warn-select:focus,
.warn-textarea:focus {
    border-color: var(--warn-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.warn-btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 10px;
    padding: 9px 20px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.warn-btn-cancel:hover {
    background: #e2e8f0;
}

.warn-btn-submit {
    background: var(--warn-royal-purple);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 9px 24px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.warn-btn-submit:hover {
    background: var(--warn-royal-purple-light);
}

.warn-btn-danger-confirm {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 9px 24px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.warn-btn-danger-confirm:hover {
    background: #dc2626;
}

/* ==========================================================
   عناصر نموذج إصدار التنبيه / الإنذار فائق الاحترافية
   ========================================================== */
.warn-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--warn-royal-purple);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.warn-section-heading i,
.warn-section-heading svg {
    width: 16px;
    height: 16px;
    color: var(--warn-purple);
}

/* شريط القوالب الذكية الجاهزة */
.warn-presets-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

.warn-preset-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.warn-preset-chip:hover {
    background: var(--warn-purple-light);
    border-color: var(--warn-purple);
    color: var(--warn-purple);
    transform: translateY(-1px);
}

/* منتقي درجة الخطورة والتصنيف بالبطاقات البصرية */
.warn-severity-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .warn-severity-picker { grid-template-columns: repeat(2, 1fr); }
}

.warn-severity-card {
    position: relative;
    border: 1.5px solid var(--warn-border);
    border-radius: 14px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.warn-severity-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.warn-severity-card:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
    transform: translateY(-2px);
}

.warn-severity-card.active-critical {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.warn-severity-card.active-warning {
    border-color: #ea580c !important;
    background: #fff7ed !important;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
}

.warn-severity-card.active-notice {
    border-color: #d97706 !important;
    background: #fffbeb !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.warn-severity-card.active-guidance {
    border-color: #7c3aed !important;
    background: #f5f3ff !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
}

.warn-severity-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.warn-severity-card .warn-sev-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--warn-text-main);
    display: block;
}

.warn-severity-card .warn-sev-sub {
    font-size: 0.7rem;
    color: var(--warn-text-muted);
    margin-top: 2px;
    line-height: 1.25;
}

/* حبوب اختيار الجزاء المالي */
.warn-penalty-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.warn-penalty-pill {
    position: relative;
    flex: 1;
    min-width: 100px;
}

.warn-penalty-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.warn-penalty-pill label {
    display: block;
    text-align: center;
    padding: 8px 10px;
    border: 1px solid var(--warn-border);
    border-radius: 10px;
    background: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--warn-text-body);
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
}

.warn-penalty-pill input[type="radio"]:checked + label {
    background: var(--warn-royal-purple);
    color: #ffffff;
    border-color: var(--warn-royal-purple);
    box-shadow: 0 2px 8px rgba(67, 24, 68, 0.25);
}

/* قنوات التبليغ والتوزيع */
.warn-channel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}

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

.warn-channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.warn-channel-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.warn-channel-item input[type="checkbox"] {
    accent-color: var(--warn-purple);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* صندوق المعاينة الحية */
.warn-live-preview-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right: 4px solid var(--warn-purple);
    border-radius: 14px;
    padding: 14px 18px;
    margin-top: 18px;
}

.warn-live-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

/* الحالة الفارغة */
.warn-empty-state {
    grid-column: 1 / -1;
    background: #ffffff;
    border-radius: var(--warn-radius);
    border: 1px dashed #cbd5e1;
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.warn-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #94a3b8;
}

.warn-empty-icon i,
.warn-empty-icon svg {
    width: 28px;
    height: 28px;
}

/* ==========================================================
   8. طباعة السجل الرسمي العام
   ========================================================== */
.warn-print-only {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }

    #warnPrintReport,
    #warnPrintReport * {
        visibility: visible;
    }

    #warnPrintReport {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
        background: #ffffff;
        color: #0f172a;
        direction: rtl;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    .print-report-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #0f172a;
        padding-bottom: 14px;
        margin-bottom: 20px;
    }

    .print-data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
    }

    .print-data-table th,
    .print-data-table td {
        border: 1px solid #cbd5e1;
        padding: 8px 10px;
        text-align: right;
    }

    .print-data-table th {
        background-color: #f1f5f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* --- attendance-report-exact.css --- */
/**
 * منظومة أوامر HR الذكية — تنسيقات واجهة التقارير (الحضور والانصراف)
 * مطابقة تامة للصورة المرجعية تقرير الحضور والانصراف.jpeg والتقارير.jpeg
 */

:root {
  --rpt-primary: #822784;
  --rpt-primary-dark: #661868;
  --rpt-primary-light: rgba(130, 39, 132, 0.08);
  --rpt-hero-bg: linear-gradient(135deg, #091a28 0%, #0e2738 50%, #0b1f2d 100%);
  --rpt-card-bg: #ffffff;
  --rpt-border: rgba(226, 232, 240, 0.85);
  --rpt-border-dark: rgba(255, 255, 255, 0.10);
  --rpt-radius: 18px;
}

/* الحاوية العامة لتقرير الحضور والانصراف */
.att-report-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  margin: 0 auto;
  font-family: inherit;
}

/* ════════════════════════════════════════════════════════════════
   1. قسم التقرير الرئيسي الداكن (Hero Section)
════════════════════════════════════════════════════════════════ */
.att-hero-section {
  background: var(--rpt-hero-bg);
  border: 1px solid var(--rpt-border-dark);
  border-radius: var(--rpt-radius);
  padding: 24px 28px;
  color: #ffffff;
  position: relative;
  box-shadow: 0 8px 30px -6px rgba(10, 26, 40, 0.35);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* الرأس: العنوان ووقت آخر تحديث */
.att-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.att-hero-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.att-hero-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.att-hero-texts {
  display: flex;
  flex-direction: column;
}

.att-hero-category {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.att-hero-main-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.att-hero-subtitle {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 500;
  margin-top: 5px;
}

.att-hero-update-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  padding: 6px 14px;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  direction: ltr;
}

/* شريط أزرار التنقل بين التقارير */
.att-tabs-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.att-tabs-strip::-webkit-scrollbar { display: none; }

.att-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 0.81rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  cursor: pointer;
}

.att-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.att-tab-btn.active {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20);
}

.att-tab-btn .tab-badge-new {
  font-size: 0.60rem;
  font-weight: 800;
  background: #10b981;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 12px;
}

/* شبكة المؤشرات السبعة (KPIs) */
.att-kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.att-kpi-tile {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 13px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 86px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.att-kpi-tile:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.att-kpi-num-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.att-kpi-value {
  font-size: 1.32rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.att-kpi-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.att-kpi-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
}

.att-kpi-label {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-weight: 700;
  white-space: nowrap;
}

.att-kpi-trend {
  font-size: 0.68rem;
  font-weight: 800;
  direction: ltr;
  white-space: nowrap;
}

.att-kpi-trend.up { color: #34d399; }
.att-kpi-trend.down { color: #f87171; }
.att-kpi-trend.warn { color: #fbbf24; }
.att-kpi-trend.info { color: #38bdf8; }
.att-kpi-trend.danger { color: #fb7185; }

/* ════════════════════════════════════════════════════════════════
   2. قسم تصفية التقرير (Filter Section)
════════════════════════════════════════════════════════════════ */
.att-filter-card {
  background: var(--rpt-card-bg);
  border: 1px solid var(--rpt-border);
  border-radius: var(--rpt-radius);
  padding: 20px 24px;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* الصف العلوي للتصفية: العنوان، وحدات العرض، أزرار النطاق */
.att-filter-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.att-filter-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--rpt-primary);
}

.att-filter-controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.att-unit-toggle {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.att-unit-btn {
  border: none;
  background: transparent;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.16s ease;
}

.att-unit-btn.active {
  background: #ffffff;
  color: var(--rpt-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.att-presets-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.att-preset-pill {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease;
}

.att-preset-pill:hover {
  border-color: rgba(130, 39, 132, 0.3);
  color: var(--rpt-primary);
}

.att-preset-pill.active {
  background: var(--rpt-primary) !important;
  border-color: var(--rpt-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(130, 39, 132, 0.25);
}

/* صف الحقول الأربعة */
.att-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.att-field-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.att-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
}

.att-field-label i { width: 14px; height: 14px; color: #94a3b8; }

.att-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.att-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 0.83rem;
  font-weight: 600;
  color: #1e293b;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.att-input:focus {
  border-color: var(--rpt-primary);
  box-shadow: 0 0 0 3px rgba(130, 39, 132, 0.10);
}

select.att-input {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 28px;
  cursor: pointer;
}

.att-select-arrow {
  position: absolute;
  left: 10px;
  pointer-events: none;
  color: #94a3b8;
  width: 14px;
  height: 14px;
}

/* صف أزرار الإجراء: بحث عريض ومسح */
.att-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.att-search-btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #822784 0%, #691b6b 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(130, 39, 132, 0.28);
  transition: all 0.18s ease;
}

.att-search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(130, 39, 132, 0.35);
  background: linear-gradient(135deg, #8e2b90 0%, #751f78 100%);
}

.att-clear-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 0.83rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
}

.att-clear-btn:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

/* ════════════════════════════════════════════════════════════════
   3. قسم الرسم البياني «يوماً بيوم»
════════════════════════════════════════════════════════════════ */
.att-chart-card {
  background: var(--rpt-card-bg);
  border: 1px solid var(--rpt-border);
  border-radius: var(--rpt-radius);
  padding: 20px 24px;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.att-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.att-chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}

.att-chart-title i { color: var(--rpt-primary); }

.att-chart-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.att-chart-pill-btn {
  padding: 5px 14px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.att-chart-pill-btn.active {
  background: rgba(130, 39, 132, 0.10);
  border-color: rgba(130, 39, 132, 0.25);
  color: var(--rpt-primary);
}

.att-chart-tool-action {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.att-chart-tool-action:hover {
  background: #f8fafc;
  color: #1e293b;
}

.att-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 270px;
}

.att-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.att-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
}

.att-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* ════════════════════════════════════════════════════════════════
   4. جدول إحصائيات الأقسام والفروع
════════════════════════════════════════════════════════════════ */
.att-table-card {
  background: var(--rpt-card-bg);
  border: 1px solid var(--rpt-border);
  border-radius: var(--rpt-radius);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.03);
}

.att-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.att-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.82rem;
}

.att-data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  font-size: 0.76rem;
}

.att-data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-weight: 600;
  white-space: nowrap;
}

.att-data-table tbody tr:hover {
  background: #fafafa;
}

.att-dept-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.att-dept-title {
  font-weight: 800;
  color: #1e293b;
}

.att-dept-note {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

.att-rate-cell {
  font-weight: 900;
  color: #1e293b;
}

/* ════════════════════════════════════════════════════════════════
   5. البطاقات التحليلية السفلية الأربعة
════════════════════════════════════════════════════════════════ */
.att-rankings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.att-rank-card {
  background: var(--rpt-card-bg);
  border: 1px solid var(--rpt-border);
  border-radius: var(--rpt-radius);
  padding: 18px 16px;
  box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.att-rank-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.att-rank-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}

.att-rank-head i {
  color: var(--rpt-primary);
  width: 16px;
  height: 16px;
}

.att-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.att-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background 0.15s ease;
  gap: 10px;
}

.att-rank-row:hover {
  background: #f8fafc;
}

.att-rank-emp-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.att-rank-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}

.att-rank-badge.rank-1 { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.att-rank-badge.rank-2 { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.att-rank-badge.rank-3 { background: #ffedd5; color: #ea580c; border: 1px solid #fed7aa; }
.att-rank-badge.rank-other { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

.att-rank-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(130, 39, 132, 0.10);
  color: var(--rpt-primary);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.att-rank-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.att-rank-name {
  font-size: 0.77rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-rank-id {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
}

.att-rank-metric {
  font-size: 0.74rem;
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
  direction: ltr;
}

/* ════════════════════════════════════════════════════════════════
   التصميم المتجاوب (Responsive Design)
════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .att-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .att-rankings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  .att-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-hero-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .att-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-rankings-grid { grid-template-columns: 1fr; }
  .att-fields-grid { grid-template-columns: 1fr; }
  .att-hero-section { padding: 18px 16px; }
  .att-filter-card, .att-chart-card { padding: 16px; }
}

@media (max-width: 480px) {
  .att-kpi-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   الوضع الليلي (Dark Mode)
════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .att-filter-card,
[data-theme="dark"] .att-chart-card,
[data-theme="dark"] .att-table-card,
[data-theme="dark"] .att-rank-card {
  background: rgba(12, 18, 32, 0.95) !important;
  border-color: rgba(51, 65, 85, 0.6) !important;
}

[data-theme="dark"] .att-data-table th {
  background: rgba(22, 33, 58, 0.8) !important;
  color: #cbd5e1 !important;
  border-bottom-color: rgba(51, 65, 85, 0.6) !important;
}

[data-theme="dark"] .att-data-table td {
  border-bottom-color: rgba(51, 65, 85, 0.4) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .att-data-table tbody tr:hover {
  background: rgba(30, 46, 78, 0.5) !important;
}

[data-theme="dark"] .att-dept-title,
[data-theme="dark"] .att-chart-title,
[data-theme="dark"] .att-rank-title,
[data-theme="dark"] .att-rank-name,
[data-theme="dark"] .att-rate-cell {
  color: #f8fafc !important;
}

[data-theme="dark"] .att-input {
  background: rgba(22, 33, 58, 0.8) !important;
  border-color: rgba(51, 65, 85, 0.6) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .att-unit-toggle,
[data-theme="dark"] .att-clear-btn,
[data-theme="dark"] .att-chart-pill-btn,
[data-theme="dark"] .att-chart-tool-action {
  background: rgba(22, 33, 58, 0.8) !important;
  border-color: rgba(51, 65, 85, 0.6) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .att-preset-pill {
  background: rgba(22, 33, 58, 0.8) !important;
  border-color: rgba(51, 65, 85, 0.6) !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   قواعد طباعة تقرير الحضور والانصراف الرسمي على ورق A4
   ========================================================================== */
@media print {
  .att-hero-section {
    background: #ffffff !important;
    border: 2px solid #0f172a !important;
    border-radius: 6px !important;
    color: #000000 !important;
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
    box-shadow: none !important;
  }

  .att-hero-main-title {
    color: #0f172a !important;
    font-size: 14pt !important;
  }

  .att-hero-subtitle,
  .att-hero-category,
  .att-hero-update-badge {
    color: #475569 !important;
  }

  .att-hero-update-badge {
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
  }

  .att-tabs-strip,
  .att-chart-tools,
  .att-filter-section,
  .att-unit-toggle,
  .att-clear-btn {
    display: none !important;
  }

  .att-kpis-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    page-break-inside: avoid !important;
  }

  .att-kpi-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    padding: 8px 10px !important;
  }

  .att-kpi-val {
    color: #0f172a !important;
    font-size: 13pt !important;
  }

  .att-card-surface,
  .att-chart-card,
  .att-rankings-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    margin-bottom: 12px !important;
    page-break-inside: avoid !important;
  }
}
