/* ============================================================================
   INTEGRA NEXUS UI — PRECISION TYPOGRAPHY STYLESHEET
   font-family: 'Inter', system-ui, sans-serif;
   body: font-size: 0.85rem; font-weight: 400;
   label: font-size: 0.7rem; font-weight: 700;
   heading: font-size: 0.85rem; font-weight: 600;
   Brand Theme Blue: #0055a9
   ============================================================================ */

:root {
  /* ======================================================================== */
  /* INTEGRA GLOBAL DESIGN TOKENS (UNIFIED ENTERPRISE DESIGN SYSTEM)          */
  /* ======================================================================== */
  
  /* Brand Primary */
  --integra-primary: #0055a9;
  --integra-primary-hover: #00458a;
  --integra-primary-soft: rgba(0, 85, 169, 0.08);
  --integra-primary-active: rgba(0, 85, 169, 0.16);

  /* Semantic Accent Palette */
  --integra-blue: #2563EB;
  --integra-blue-soft: rgba(37, 99, 235, 0.10);
  --integra-indigo: #4F46E5;
  --integra-indigo-soft: rgba(79, 70, 229, 0.10);
  --integra-emerald: #10B981;
  --integra-emerald-soft: rgba(16, 185, 129, 0.10);
  --integra-purple: #8B5CF6;
  --integra-purple-soft: rgba(139, 92, 246, 0.10);
  --integra-amber: #F59E0B;
  --integra-amber-soft: rgba(245, 158, 11, 0.10);
  --integra-rose: #F43F5E;
  --integra-rose-soft: rgba(244, 63, 94, 0.10);
  --integra-cyan: #06B6D4;
  --integra-cyan-soft: rgba(6, 182, 212, 0.10);
  --integra-teal: #0D9488;
  --integra-teal-soft: rgba(13, 148, 136, 0.10);

  /* Neutrals & Surfaces */
  --integra-bg: #F4F6F9;
  --integra-bg-card: #FFFFFF;
  --integra-bg-muted: #F8FAFC;
  --integra-bg-hover: #F1F5F9;
  --integra-border: #E2E8F0;
  --integra-border-strong: #CBD5E1;
  --integra-text: #0F172A;
  --integra-text-muted: #64748B;
  --integra-text-subtle: #94A3B8;

  /* Geometry & Radii */
  --integra-radius-sm: 6px;
  --integra-radius-md: 8px;
  --integra-radius-lg: 12px;
  --integra-radius-xl: 14px;
  --integra-radius-2xl: 18px;
  --integra-radius-pill: 9999px;

  /* Refined Enterprise Shadows */
  --integra-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --integra-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  --integra-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --integra-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --integra-shadow-xl: 0 20px 35px -4px rgba(0, 0, 0, 0.12);

  /* Motion Standards */
  --integra-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --integra-transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --integra-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Backward Compatibility Aliases */
  --theme-blue: var(--integra-primary);
  --theme-blue-hover: var(--integra-primary-hover);
  --theme-blue-subtle: var(--integra-primary-soft);
  --theme-blue-active: rgba(255, 255, 255, 0.18);

  --success: var(--integra-emerald);
  --danger: var(--integra-rose);
  --warning: var(--integra-amber);
  --info: var(--integra-cyan);
  --text-male: #0055a9;
  --text-female: #D946EF;

  --bg: var(--integra-bg);
  --bg-card: var(--integra-bg-card);
  --border: var(--integra-border);
  --border-subtle: var(--integra-border);
  --text-main: var(--integra-text);
  --text-muted: var(--integra-text-muted);
  --text-subtle: var(--integra-text-subtle);

  /* Modern Theme Aliases for DMS, BI, AI & Subledgers */
  --integra-card: var(--integra-bg-card);
  --surface: var(--integra-bg-card);
  --text-secondary: var(--integra-text-muted);
  --text-primary: var(--integra-text);
  --integra-muted: var(--integra-text-muted);

  /* Dimensions */
  --header-height: 50px;
  --subnav-height: 42px;
  --sidebar-min-width: 58px;
  --sidebar-expand-width: 270px;

  /* Typography */
  --font-family: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --integra-bg: #0B131E;
  --integra-bg-card: #121E2D;
  --integra-bg-muted: #18273A;
  --integra-bg-hover: #1E314B;
  --integra-border: #22354D;
  --integra-border-strong: #2D4463;
  --integra-text: #F1F5F9;
  --integra-text-muted: #94A3B8;
  --integra-text-subtle: #64748B;

  --integra-blue-soft: rgba(37, 99, 235, 0.18);
  --integra-indigo-soft: rgba(79, 70, 229, 0.18);
  --integra-emerald-soft: rgba(16, 185, 129, 0.18);
  --integra-purple-soft: rgba(139, 92, 246, 0.18);
  --integra-amber-soft: rgba(245, 158, 11, 0.18);
  --integra-rose-soft: rgba(244, 63, 94, 0.18);
  --integra-cyan-soft: rgba(6, 182, 212, 0.18);
  --integra-teal-soft: rgba(13, 148, 136, 0.18);

  --integra-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --integra-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.35);
  --integra-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --integra-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
  --integra-shadow-xl: 0 20px 35px -4px rgba(0, 0, 0, 0.7);

  --bg: var(--integra-bg);
  --bg-card: var(--integra-bg-card);
  --border: var(--integra-border);
  --border-subtle: #1C2D42;
  --text-main: var(--integra-text);
  --text-muted: var(--integra-text-muted);
  --text-subtle: #5F748F;

  /* Modern Theme Aliases for Dark Mode */
  --integra-card: var(--integra-bg-card);
  --surface: var(--integra-bg-card);
  --text-secondary: var(--integra-text-muted);
  --text-primary: var(--integra-text);
  --integra-muted: var(--integra-text-muted);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   STRICT USER SPECIFICATION:
   font-family: 'Inter', system-ui, sans-serif;
   body: font-size: 0.85rem; font-weight: 400;
   label: font-size: 0.7rem; font-weight: 700;
   heading: font-size: 0.85rem; font-weight: 600;
   ========================================================================== */
body, button, input, select, textarea {
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 400;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

/* Language-Specific Font Families */
html[lang="ar"],
html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6,
html[lang="ar"] .heading, html[lang="ar"] .font-heading, html[lang="ar"] .dash-card-title, html[lang="ar"] .pane-header {
  font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif !important;
}

html[lang="ta"],
html[lang="ta"] body,
html[lang="ta"] button,
html[lang="ta"] input,
html[lang="ta"] select,
html[lang="ta"] textarea,
html[lang="ta"] h1, html[lang="ta"] h2, html[lang="ta"] h3, html[lang="ta"] h4, html[lang="ta"] h5, html[lang="ta"] h6,
html[lang="ta"] .heading, html[lang="ta"] .font-heading, html[lang="ta"] .dash-card-title, html[lang="ta"] .pane-header {
  font-family: 'Noto Sans Tamil', 'Inter', sans-serif !important;
}

/* RTL Layout Optimizations for Arabic */
[dir="rtl"] aside.integra-sidebar {
  border-right: none;
  border-left: 1px solid transparent;
}

[dir="rtl"] aside.integra-sidebar:hover,
[dir="rtl"] aside.integra-sidebar.pinned-expanded {
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.12);
}

[dir="rtl"] .menu-lvl2-container {
  padding-left: 0;
  padding-right: 20px;
  margin: 2px 10px 4px 0;
  border-left: none;
  border-right: 1.5px solid rgba(255, 255, 255, 0.2);
}

[dir="rtl"] aside.integra-sidebar:hover .menu-lvl2-container.open,
[dir="rtl"] aside.integra-sidebar.pinned-expanded .menu-lvl2-container.open {
  border-right-color: #CBD5E1;
}

[dir="rtl"] aside.integra-sidebar:hover .menu-lvl1-btn.active,
[dir="rtl"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn.active {
  border-left: none;
  border-right: 3px solid var(--theme-blue);
}

[dir="rtl"] .pane {
  border-right: none;
  border-left: 1px solid var(--border);
}

[dir="rtl"] .pane:last-child {
  border-left: none;
}

html {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
}

/* Headings: font-size: 0.85rem; font-weight: 600; */
h1, h2, h3, h4, h5, h6, .heading, .font-heading, .dash-card-title, .pane-header, .topbar-brand-title {
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

/* Labels: font-size: 0.7rem; font-weight: 700; */
label, .label, .stat-cell-label, .card-label {
  font-family: var(--font-family);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.font-numeric {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums lining-nums;
}

/* ==========================================================================
   1. 100% FULL-WIDTH TOP BAR (#0055a9)
   ========================================================================== */
header.integra-topbar-100 {
  width: 100%;
  max-width: 100vw;
  height: var(--header-height);
  background: var(--theme-blue);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 100;
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}

header.integra-topbar-100::-webkit-scrollbar {
  display: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-sq-logo {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.topbar-org-meta {
  display: flex;
  flex-direction: column;
}

.topbar-brand-title {
  color: #FFFFFF;
  text-transform: uppercase;
}

.topbar-org-name {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-icon-link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.topbar-icon-link:hover {
  color: #FFFFFF;
}

.live-clock-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  background: rgba(0, 0, 0, 0.22);
  color: #E2E8F0;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.topbar-lang-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 3px 8px;
  border-radius: 4px;
  color: white;
  font-size: 0.75rem;
}

.topbar-lang-select {
  background: transparent;
  border: none;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.topbar-lang-select option {
  background: #FFFFFF;
  color: #12263F;
}

[data-theme="dark"] .topbar-lang-select option {
  background: #121E2D;
  color: #E2E8F0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00D97E;
}

/* ==========================================================================
   2. HORIZONTAL SUB-NAVIGATION BAR (View Switcher: Dashboard vs Inner 3-Pane)
   ========================================================================== */
.module-subnav {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  padding: 0 16px;
  height: var(--subnav-height);
  align-items: center;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--integra-border, #CBD5E1) transparent;
  scroll-behavior: smooth;
  z-index: 30;
}

[data-theme="dark"] .module-subnav {
  background: #0F1A28;
}

.module-subnav::-webkit-scrollbar {
  height: 3px;
}
.module-subnav::-webkit-scrollbar-track {
  background: transparent;
}
.module-subnav::-webkit-scrollbar-thumb {
  background: var(--integra-border, #CBD5E1);
  border-radius: 4px;
}

.subnav-tab {
  padding: 0 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.subnav-tab:hover {
  color: var(--theme-blue);
}

.subnav-tab.active {
  color: var(--theme-blue);
  border-bottom-color: var(--theme-blue);
  background: rgba(0, 85, 169, 0.05);
  font-weight: 700;
}

[data-theme="dark"] .subnav-tab.active {
  color: #60A5FA;
  border-bottom-color: #60A5FA;
  background: rgba(96, 165, 250, 0.08);
}

/* ==========================================================================
   3. BELOW-HEADER SPLIT: SIDEBAR + MAIN WORKSPACE
   ========================================================================== */
.below-header-layout {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  height: calc(100vh - var(--header-height));
}

/* SIDEBAR: Minimized (58px, #0055a9) -> Expanding on Hover/Pin (270px, White Background #FFFFFF) */
aside.integra-sidebar {
  width: var(--sidebar-min-width);
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: var(--theme-blue);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 60;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.24s ease, border-color 0.2s ease;
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  position: relative;
  border-right: 1px solid transparent;
}

/* WHEN HOVERED OR PINNED-EXPANDED: CHANGE TO WHITE BACKGROUND */
aside.integra-sidebar:hover,
aside.integra-sidebar.pinned-expanded {
  width: var(--sidebar-expand-width);
  background: #FFFFFF;
  color: var(--text-main);
  border-right: 1px solid var(--border);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] aside.integra-sidebar:hover,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded {
  background: #121E2D;
  border-right-color: #22354D;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.35);
}

/* Control Row */
.sidebar-ctrl-row {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

aside.integra-sidebar:hover .sidebar-ctrl-row,
aside.integra-sidebar.pinned-expanded .sidebar-ctrl-row {
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-ctrl-row,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-ctrl-row {
  border-bottom-color: #22354D;
}

.sidebar-ctrl-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.sidebar-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

aside.integra-sidebar:hover .sidebar-ctrl-btn,
aside.integra-sidebar.pinned-expanded .sidebar-ctrl-btn {
  color: var(--text-muted);
}

aside.integra-sidebar:hover .sidebar-ctrl-btn:hover,
aside.integra-sidebar.pinned-expanded .sidebar-ctrl-btn:hover {
  background: #F1F5F9;
  color: var(--theme-blue);
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-ctrl-btn,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-ctrl-btn {
  color: var(--text-muted);
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-ctrl-btn:hover,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-ctrl-btn:hover {
  background: #1C2D42;
  color: #60A5FA;
}

.sidebar-heading-text {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  display: none;
}

aside.integra-sidebar:hover .sidebar-heading-text,
aside.integra-sidebar.pinned-expanded .sidebar-heading-text {
  display: block;
  color: var(--theme-blue);
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-heading-text,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-heading-text {
  color: #60A5FA;
}

/* Search Box */
.sidebar-search-box {
  padding: 8px 12px;
  display: none;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

aside.integra-sidebar:hover .sidebar-search-box,
aside.integra-sidebar.pinned-expanded .sidebar-search-box {
  display: block;
  border-bottom: 1px solid var(--border);
  background: #FAFBFD;
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-search-box,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-search-box {
  border-bottom-color: #22354D;
  background: #0E1825;
}

.sidebar-search-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 400;
  outline: none;
  transition: all 0.15s ease;
}

.sidebar-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

aside.integra-sidebar:hover .sidebar-search-input,
aside.integra-sidebar.pinned-expanded .sidebar-search-input {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-main);
}

aside.integra-sidebar:hover .sidebar-search-input:focus,
aside.integra-sidebar.pinned-expanded .sidebar-search-input:focus {
  border-color: var(--theme-blue);
  box-shadow: 0 0 0 2px rgba(0, 85, 169, 0.12);
}

aside.integra-sidebar:hover .sidebar-search-input::placeholder,
aside.integra-sidebar.pinned-expanded .sidebar-search-input::placeholder {
  color: var(--text-subtle);
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-search-input,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-search-input {
  background: #1A293D;
  border-color: #2B4261;
  color: #F1F5F9;
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-search-input:focus,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-search-input:focus {
  border-color: #60A5FA;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
}

/* Sidebar Menu Scroll */
.sidebar-menu-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px;
  overscroll-behavior: contain;
}

.sidebar-menu-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-menu-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}

aside.integra-sidebar:hover .sidebar-menu-scroll::-webkit-scrollbar-thumb,
aside.integra-sidebar.pinned-expanded .sidebar-menu-scroll::-webkit-scrollbar-thumb {
  background: #94A3B8;
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-menu-scroll::-webkit-scrollbar-thumb,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-menu-scroll::-webkit-scrollbar-thumb {
  background: #3B5270;
}

.menu-lvl1-wrapper {
  margin-bottom: 2px;
}

/* Level 1 Button */
.menu-lvl1-btn {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  gap: 12px;
}

/* Strict Collapsed Rail Handling: Centered icon only, NO overflowing text */
aside.integra-sidebar:not(:hover):not(.pinned-expanded) .lvl1-title,
aside.integra-sidebar:not(:hover):not(.pinned-expanded) .lvl1-arrow,
aside.integra-sidebar:not(:hover):not(.pinned-expanded) .menu-lvl2-container,
aside.integra-sidebar:not(:hover):not(.pinned-expanded) .sidebar-heading-text,
aside.integra-sidebar:not(:hover):not(.pinned-expanded) .sidebar-search-box,
aside.integra-sidebar:not(:hover):not(.pinned-expanded) .sidebar-footer-text {
  display: none !important;
}

aside.integra-sidebar:not(:hover):not(.pinned-expanded) .menu-lvl1-btn {
  padding: 0 !important;
  justify-content: center !important;
}

.lvl1-arrow.rotate-90 {
  transform: rotate(90deg) !important;
}

.menu-lvl1-btn i.fa-solid {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: #FFFFFF;
  transition: color 0.15s ease;
}

.menu-lvl1-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.menu-lvl1-btn.active {
  background: var(--theme-blue-active);
  border-left: 3px solid #FFFFFF;
  color: #FFFFFF;
  font-weight: 700;
}

/* White background adaptations for Level 1 */
aside.integra-sidebar:hover .menu-lvl1-btn,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn {
  color: #334155;
}

aside.integra-sidebar:hover .menu-lvl1-btn i.fa-solid,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn i.fa-solid {
  color: #475569;
}

aside.integra-sidebar:hover .menu-lvl1-btn:hover,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn:hover {
  background: #F0F4F9;
  color: var(--theme-blue);
}

aside.integra-sidebar:hover .menu-lvl1-btn:hover i.fa-solid,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn:hover i.fa-solid {
  color: var(--theme-blue);
}

aside.integra-sidebar:hover .menu-lvl1-btn.active,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn.active {
  background: var(--theme-blue-subtle);
  border-left: 3px solid var(--theme-blue);
  color: var(--theme-blue);
  font-weight: 700;
}

aside.integra-sidebar:hover .menu-lvl1-btn.active i.fa-solid,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn.active i.fa-solid {
  color: var(--theme-blue);
}

/* Dark mode Level 1 */
[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn {
  color: #CBD5E1;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn i.fa-solid,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn i.fa-solid {
  color: #94A3B8;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn:hover,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn:hover {
  background: #1C2D42;
  color: #60A5FA;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn:hover i.fa-solid,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn:hover i.fa-solid {
  color: #60A5FA;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn.active,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn.active {
  background: rgba(96, 165, 250, 0.12);
  border-left: 3px solid #60A5FA;
  color: #60A5FA;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn.active i.fa-solid,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn.active i.fa-solid {
  color: #60A5FA;
}

.lvl1-title {
  display: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

aside.integra-sidebar:hover .lvl1-title,
aside.integra-sidebar.pinned-expanded .lvl1-title {
  display: block;
}

.lvl1-arrow {
  display: none;
  font-size: 0.65rem;
  transition: transform 0.2s ease, color 0.15s ease;
  color: rgba(255, 255, 255, 0.7);
}

aside.integra-sidebar:hover .lvl1-arrow,
aside.integra-sidebar.pinned-expanded .lvl1-arrow {
  display: block;
  color: #94A3B8;
}

aside.integra-sidebar:hover .menu-lvl1-btn:hover .lvl1-arrow,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn:hover .lvl1-arrow,
aside.integra-sidebar:hover .menu-lvl1-btn.active .lvl1-arrow,
aside.integra-sidebar.pinned-expanded .menu-lvl1-btn.active .lvl1-arrow {
  color: var(--theme-blue);
}

[data-theme="dark"] aside.integra-sidebar:hover .lvl1-arrow,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .lvl1-arrow {
  color: #64748B;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn:hover .lvl1-arrow,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn:hover .lvl1-arrow,
[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl1-btn.active .lvl1-arrow,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl1-btn.active .lvl1-arrow {
  color: #60A5FA;
}

/* Level 2 Submenu Container */
.menu-lvl2-container {
  display: none;
  padding-left: 20px;
  margin: 2px 0 4px 10px;
  border-left: 1.5px solid rgba(255, 255, 255, 0.2);
}

aside.integra-sidebar:hover .menu-lvl2-container.open,
aside.integra-sidebar.pinned-expanded .menu-lvl2-container.open {
  display: block;
  border-left-color: #CBD5E1;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl2-container.open,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl2-container.open {
  border-left-color: #2B4261;
}

.menu-lvl2-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: all 0.15s ease;
}

.menu-lvl2-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.menu-lvl2-btn.active {
  color: #FFFFFF;
  font-weight: 700;
}

aside.integra-sidebar:hover .menu-lvl2-btn,
aside.integra-sidebar.pinned-expanded .menu-lvl2-btn {
  color: #475569;
}

aside.integra-sidebar:hover .menu-lvl2-btn:hover,
aside.integra-sidebar.pinned-expanded .menu-lvl2-btn:hover {
  color: var(--theme-blue);
  background: #F1F5F9;
}

aside.integra-sidebar:hover .menu-lvl2-btn.active,
aside.integra-sidebar.pinned-expanded .menu-lvl2-btn.active {
  color: var(--theme-blue);
  font-weight: 700;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl2-btn,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl2-btn {
  color: #94A3B8;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl2-btn:hover,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl2-btn:hover {
  color: #60A5FA;
  background: #1C2D42;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl2-btn.active,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl2-btn.active {
  color: #60A5FA;
  font-weight: 700;
}

/* Level 3 Leaves */
.menu-lvl3-container {
  display: none;
  padding-left: 10px;
  margin: 2px 0 4px 0;
}

.menu-lvl3-container.open {
  display: block;
}

.menu-lvl3-leaf {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.12s ease;
}

.menu-lvl3-leaf:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

.menu-lvl3-leaf.active {
  color: #FFFFFF;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
}

aside.integra-sidebar:hover .menu-lvl3-leaf,
aside.integra-sidebar.pinned-expanded .menu-lvl3-leaf {
  color: #64748B;
}

aside.integra-sidebar:hover .menu-lvl3-leaf:hover,
aside.integra-sidebar.pinned-expanded .menu-lvl3-leaf:hover {
  color: var(--theme-blue);
  background: #EBF2FA;
}

aside.integra-sidebar:hover .menu-lvl3-leaf.active,
aside.integra-sidebar.pinned-expanded .menu-lvl3-leaf.active {
  color: var(--theme-blue);
  background: rgba(0, 85, 169, 0.1);
  font-weight: 600;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl3-leaf,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl3-leaf {
  color: #8CA0BA;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl3-leaf:hover,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl3-leaf:hover {
  color: #60A5FA;
  background: #1C2D42;
}

[data-theme="dark"] aside.integra-sidebar:hover .menu-lvl3-leaf.active,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .menu-lvl3-leaf.active {
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.15);
  font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

aside.integra-sidebar:hover .sidebar-footer,
aside.integra-sidebar.pinned-expanded .sidebar-footer {
  border-top: 1px solid var(--border);
  background: #FAFBFD;
}

aside.integra-sidebar:hover .sidebar-footer i,
aside.integra-sidebar.pinned-expanded .sidebar-footer i {
  color: var(--theme-blue) !important;
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-footer,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-footer {
  border-top-color: #22354D;
  background: #0E1825;
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-footer i,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-footer i {
  color: #60A5FA !important;
}

.sidebar-footer-text {
  display: none;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.72rem;
}

aside.integra-sidebar:hover .sidebar-footer-text,
aside.integra-sidebar.pinned-expanded .sidebar-footer-text {
  display: block;
}

aside.integra-sidebar:hover .sidebar-footer-text div:first-child,
aside.integra-sidebar.pinned-expanded .sidebar-footer-text div:first-child {
  color: var(--text-main) !important;
}

aside.integra-sidebar:hover .sidebar-footer-text div:last-child,
aside.integra-sidebar.pinned-expanded .sidebar-footer-text div:last-child {
  color: var(--text-muted) !important;
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-footer-text div:first-child,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-footer-text div:first-child {
  color: #E2E8F0 !important;
}

[data-theme="dark"] aside.integra-sidebar:hover .sidebar-footer-text div:last-child,
[data-theme="dark"] aside.integra-sidebar.pinned-expanded .sidebar-footer-text div:last-child {
  color: #8CA0BA !important;
}

/* ==========================================================================
   4. EXECUTIVE DASHBOARD: 3-COLUMN CARD GRID
   ========================================================================== */
.executive-dashboard-view {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1200px) {
  .executive-dashboard-view {
    grid-template-columns: 1fr;
  }
}

.dash-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

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

.dash-hero-box {
  background: #EEF6FF;
  border: 1px solid #D6E7FA;
  border-radius: 6px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dash-hero-stat {
  display: flex;
  flex-direction: column;
}

.dash-hero-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--theme-blue);
  line-height: 1.1;
}

.dash-hero-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dash-gender-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.gender-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
}

.gender-bar-bg {
  width: 100%;
  height: 4px;
  background: #E2E8F0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.gender-bar-fill-male {
  height: 100%;
  background: var(--theme-blue);
}

.gender-bar-fill-female {
  height: 100%;
  background: #D946EF;
}

/* Stat Grid Row */
.stat-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.stat-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.stat-cell {
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-cell-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Pastel Tinted Metric Blocks */
.pastel-cell-green {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pastel-cell-purple {
  background: #FAF5FF;
  border: 1px solid #E9D5FF;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pastel-cell-yellow {
  background: #FEFCE8;
  border: 1px solid #FEF08A;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

table.conversion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin-top: 8px;
}

table.conversion-table th {
  background: #F1F5F9;
  border: 1px solid var(--border-subtle);
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
}

table.conversion-table td {
  border: 1px solid var(--border-subtle);
  padding: 6px 8px;
  font-weight: 600;
  text-align: center;
}

table.conversion-table td:first-child {
  text-align: left;
  font-weight: 400;
  color: var(--text-muted);
}

.birthday-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: #FFFDF5;
  border: 1px solid #FEF3C7;
  border-radius: 8px;
}

.birthday-avatar-sq {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #FEF08A;
  border: 2px solid #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ==========================================================================
   5. INNER PAGES: FROZEN 3-PANE SYSTEM
   ========================================================================== */
.frozen-workspace-view {
  flex: 1;
  display: grid;
  grid-template-columns: 290px 1fr 340px;
  overflow: hidden;
  background: var(--bg);
}

.pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.pane:last-child {
  border-right: none;
}

.pane-header {
  padding: 12px 18px;
  background: #FCFCFD;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  text-transform: uppercase;
}

[data-theme="dark"] .pane-header {
  background: #111B27;
  color: #8DA2BD;
}

.scroll-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 18px;
}

.mode-banner {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--theme-blue);
  margin-bottom: 14px;
}

.m-ipd { background: #FAF5FF; color: #6B21A8; border-left-color: #8B5CF6; }
.m-retail { background: #EFF6FF; color: #1E40AF; border-left-color: var(--theme-blue); }
.m-b2b { background: #ECFDF5; color: #065F46; border-left-color: var(--success); }

.grand-total {
  text-align: right;
  font-size: 28px;
  font-weight: 700;
  color: var(--danger);
  margin: 6px 0;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
}

.btn:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

.btn-primary { background: var(--theme-blue); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-green { background: #16A34A; color: white; }
.btn-orange { background: #EA580C; color: white; }
.btn-dark { background: #0F172A; color: white; }

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.vital-box {
  background: var(--bg);
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

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

table.integra-data-table th {
  background: var(--bg);
  padding: 10px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.5px;
}

table.integra-data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

table.integra-data-table tr.clickable-row {
  cursor: pointer;
}

table.integra-data-table tr.clickable-row:hover td {
  background: rgba(0, 85, 169, 0.04);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-green { background: #DCFCE7; color: #166534; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-blue { background: #EFF6FF; color: #1E40AF; }

/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 3px;
}

/* ============================================================================
   STEP 3: PREMIUM CLIENT PLATFORM COMPONENTS (CSS LOGICAL PROPERTIES)
   ============================================================================ */

/* Topbar Switchers & Search Trigger */
.topbar-org-switchers {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 16px;
}

.topbar-selector-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.topbar-selector-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.topbar-search-trigger {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-inline-start: 16px;
  min-width: 220px;
  transition: all 0.15s ease;
}
.topbar-search-trigger:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.topbar-kbd-shortcut {
  margin-inline-start: auto;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: white;
}

/* Notification Bell with Badge */
.topbar-icon-badge-btn {
  position: relative;
  background: none;
  border: none;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
}
.topbar-icon-badge-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.notif-badge-pill {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  background: #E63757;
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Command Palette Modal (Ctrl + K) */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 100px;
}
.cmd-palette-modal {
  background: var(--bg-card);
  width: 100%;
  max-width: 620px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: cmdSlideDown 0.15s ease-out;
}
@keyframes cmdSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.cmd-palette-search-row {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.cmd-palette-search-row i {
  color: var(--text-muted);
  font-size: 1rem;
}
.cmd-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}
.cmd-palette-esc-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.cmd-palette-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
.cmd-palette-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px 4px;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s ease;
  color: var(--text-main);
}
.cmd-palette-item:hover, .cmd-palette-item.active {
  background: rgba(0, 85, 169, 0.08);
  color: var(--theme-blue);
}
.cmd-palette-item-icon {
  width: 22px;
  text-align: center;
  color: var(--text-muted);
}
.cmd-palette-item:hover .cmd-palette-item-icon {
  color: var(--theme-blue);
}
.cmd-palette-item-text {
  flex: 1;
  font-size: 0.825rem;
  font-weight: 600;
}
.cmd-palette-item-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Notification & Dropdown Popovers */
.notification-popover {
  position: absolute;
  top: 48px;
  inset-inline-end: 20px;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  z-index: 2200;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.notification-popover.show {
  display: flex !important;
  animation: popoverFadeIn 0.15s ease-out;
}

.cmd-palette-backdrop.show {
  display: flex !important;
  animation: fadeIn 0.15s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-header h4 {
  font-size: 0.85rem;
  font-weight: 700;
}
.notif-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.notif-item:hover {
  background: rgba(0, 85, 169, 0.04);
}
.notif-item.unread {
  background: rgba(0, 85, 169, 0.06);
  border-inline-start: 3px solid var(--theme-blue);
}
.notif-item-title {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.notif-item-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.notif-item-time {
  font-size: 0.65rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* Integra DataGrid Component */
.integra-datagrid-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
}
.datagrid-toolbar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg);
}
.datagrid-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  width: 240px;
}
.datagrid-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.78rem;
  width: 100%;
  color: var(--text-main);
}
.datagrid-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.datagrid-density-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.datagrid-density-btn {
  padding: 4px 8px;
  background: var(--bg-card);
  border: none;
  font-size: 0.7rem;
  cursor: pointer;
  color: var(--text-muted);
}
.datagrid-density-btn.active {
  background: var(--theme-blue);
  color: white;
}
.datagrid-table-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
}
.datagrid-table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
}
.datagrid-table th {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.datagrid-table th:hover {
  color: var(--theme-blue);
}
.datagrid-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-main);
  white-space: nowrap;
}
.datagrid-table tr:hover td {
  background: rgba(0, 85, 169, 0.03);
}

/* Densities */
.density-compact td { padding: 4px 8px; font-size: 0.73rem; }
.density-compact th { padding: 5px 8px; }
.density-spacious td { padding: 14px 16px; font-size: 0.825rem; }
.density-spacious th { padding: 12px 16px; }

/* Pagination Footer */
.datagrid-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.datagrid-pagination-btns {
  display: flex;
  gap: 4px;
}
.datagrid-page-btn {
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  color: var(--text-main);
}
.datagrid-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Floating Toast Notification System */
.integra-toast-container {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5000;
  pointer-events: none;
}
.integra-toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}
@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.integra-toast.toast-success { border-inline-start: 4px solid var(--success); }
.integra-toast.toast-error { border-inline-start: 4px solid var(--danger); }
.integra-toast.toast-warning { border-inline-start: 4px solid var(--warning); }
.integra-toast.toast-info { border-inline-start: 4px solid var(--info); }
.integra-toast.toast-syncing { border-inline-start: 4px solid #0EA5E9; }

.toast-icon { font-size: 1rem; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-syncing .toast-icon { color: #0EA5E9; }

.toast-content { flex: 1; }
.toast-title { font-size: 0.78rem; font-weight: 700; color: var(--text-main); }
.toast-message { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* Common UI States: Empty, Skeleton, Error */
.ui-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ui-state-icon {
  font-size: 2.2rem;
  color: var(--text-subtle);
  margin-bottom: 12px;
}
.ui-state-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.ui-state-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 400px;
  margin-bottom: 16px;
}

/* ============================================================================
 * ENTERPRISE ORGANIZATION MANAGEMENT WORKSPACE STYLES
 * ============================================================================ */

/* View Mode Selector Strip */
.org-view-modes {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.org-view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.org-view-mode-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.org-view-mode-btn.active {
  background: var(--bg-card);
  color: var(--theme-blue);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

/* Tree Node Interactive Styling */
.org-tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin-bottom: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.org-tree-node:hover {
  border-color: var(--theme-blue);
  background: #F8FAFC;
  transform: translateX(2px);
}

.org-tree-node.selected {
  border-color: var(--theme-blue);
  background: #EFF6FF;
  box-shadow: 0 0 0 1px var(--theme-blue);
}

.org-node-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-group { background: #E0E7FF; color: #3730A3; }
.badge-org { background: #EFF6FF; color: #1D4ED8; }
.badge-le { background: #FEF3C7; color: #92400E; }
.badge-bu { background: #F3E8FF; color: #6B21A8; }
.badge-branch { background: #D1FAE5; color: #065F46; }
.badge-dept { background: #FCE7F3; color: #9D174D; }
.badge-location { background: #CFFAFE; color: #155E75; }

/* Visual Org Chart View */
.org-chart-viewport {
  overflow: auto;
  padding: 30px;
  background: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 500px;
  display: flex;
  justify-content: center;
}

.org-chart-tree, .org-chart-tree ul {
  display: flex;
  padding-top: 20px;
  position: relative;
  transition: all 0.3s;
  justify-content: center;
  list-style-type: none;
  margin: 0;
  padding-left: 0;
}

.org-chart-tree li {
  float: left;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 20px 10px 0 10px;
  transition: all 0.3s;
}

.org-chart-tree li::before, .org-chart-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid var(--border);
  width: 50%;
  height: 20px;
}

.org-chart-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--border);
}

.org-chart-tree li:only-child::after, .org-chart-tree li:only-child::before {
  display: none;
}

.org-chart-tree li:only-child {
  padding-top: 0;
}

.org-chart-tree li:first-child::before, .org-chart-tree li:last-child::after {
  border: 0 none;
}

.org-chart-tree li:last-child::before {
  border-right: 2px solid var(--border);
  border-radius: 0 5px 0 0;
}

.org-chart-tree li:first-child::after {
  border-radius: 5px 0 0 0;
}

.org-chart-tree ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid var(--border);
  width: 0;
  height: 20px;
}

.org-chart-card {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 190px;
  max-width: 240px;
  text-align: left;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.org-chart-card:hover {
  transform: translateY(-2px);
  border-color: var(--theme-blue);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.org-chart-card.active-node {
  border-color: var(--theme-blue);
  background: #F0F7FF;
  box-shadow: 0 0 0 2px var(--theme-blue);
}

/* Map Grid Cards */
.org-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.org-map-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  cursor: pointer;
}

.org-map-card:hover {
  border-color: var(--theme-blue);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Detail Slide-Over Drawer */
.org-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1050;
  display: none;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease;
}

.org-drawer-panel {
  width: 580px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  animation: slideInRight 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.org-drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
}

.org-drawer-tab {
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.org-drawer-tab:hover {
  color: var(--text-main);
}

.org-drawer-tab.active {
  color: var(--theme-blue);
  border-bottom-color: var(--theme-blue);
  background: var(--bg-card);
}

/* Timeline & History View */
.org-timeline {
  position: relative;
  padding-left: 28px;
}

.org-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.org-timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.org-timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-blue);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--border);
}

/* Creation Wizard Progress */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.wizard-step-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.wizard-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.wizard-step-node.active .wizard-step-circle {
  background: var(--theme-blue);
  border-color: var(--theme-blue);
  color: #FFFFFF;
}

.wizard-step-node.completed .wizard-step-circle {
  background: #10B981;
  border-color: #10B981;
  color: #FFFFFF;
}

.wizard-step-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}

.wizard-step-node.active .wizard-step-label {
  color: var(--theme-blue);
}

/* ==========================================================================
   RESPONSIVE DRAWER & SIDEBAR RULES (375px, 768px, 1024px, 1440px)
   ========================================================================== */

@media (max-width: 1024px) {
  aside.integra-sidebar {
    position: relative;
    z-index: 80;
  }
}

@media (max-width: 768px) {
  aside.integra-sidebar:not(.pinned-expanded) {
    width: 0 !important;
    min-width: 0 !important;
    display: none;
  }
  
  aside.integra-sidebar.pinned-expanded {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: 280px !important;
    max-width: 85vw;
    z-index: 200;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }
  
  [dir="rtl"] aside.integra-sidebar.pinned-expanded {
    left: auto;
    right: 0;
  }
}

@media (max-width: 375px) {
  aside.integra-sidebar.pinned-expanded {
    width: 310px !important;
    max-width: 90vw;
  }
}

@media (min-width: 1440px) {
  aside.integra-sidebar.pinned-expanded {
    width: 270px;
  }
}

/* ==========================================================================
   ENTERPRISE ORGANIZATION PRODUCTION STYLES (11-STEP WIZARD & 10 VIEWS)
   ========================================================================== */

.wizard-progress-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 6px 4px 14px 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.wizard-progress-scroll::-webkit-scrollbar {
  height: 4px;
}

.wizard-progress-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.wizard-step-node-11 {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 68px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.wizard-step-node-11 .wiz-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
  transition: all 0.2s;
}

.wizard-step-node-11.active .wiz-circle {
  background: var(--theme-blue);
  border-color: var(--theme-blue);
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 85, 169, 0.2);
}

.wizard-step-node-11.completed .wiz-circle {
  background: #10B981;
  border-color: #10B981;
  color: #FFFFFF;
}

.wizard-step-node-11 .wiz-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.wizard-step-node-11.active .wiz-label {
  color: var(--theme-blue);
  font-weight: 800;
}

.wizard-step-node-11.completed .wiz-label {
  color: #10B981;
}

/* Entity Types Selection Grid */
.entity-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}

.entity-type-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entity-type-card:hover {
  border-color: var(--theme-blue);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.entity-type-card.selected {
  border-color: var(--theme-blue);
  background: rgba(0, 85, 169, 0.05);
  box-shadow: 0 0 0 2px var(--theme-blue);
}

.entity-type-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.entity-type-card .card-icon {
  font-size: 0.95rem;
  color: var(--theme-blue);
}

.entity-type-card .card-tier-badge {
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
}

.entity-type-card .card-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.entity-type-card .card-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Relationships Grid & Cards */
.org-rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.org-rel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Audit Log Table */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.audit-table th {
  background: var(--bg);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.audit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.audit-event-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Master Data Core UI Styles */
.masterdata-tab-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.masterdata-tab-btn:hover {
  background: var(--bg);
  color: var(--text-main);
}

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

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.role-badge-customer { background: #E0E7FF; color: #4338CA; }
.role-badge-supplier { background: #FEF3C7; color: #B45309; }
.role-badge-partner { background: #E0F2FE; color: #0369A1; }
.role-badge-employee { background: #DCFCE7; color: #15803D; }
.role-badge-other { background: #F3F4F6; color: #374151; }

.masterdata-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Fixed Asset Management UI Styles */
.assets-tab-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.assets-tab-btn:hover {
  background: var(--bg);
  color: var(--text-main);
}

.assets-tab-btn.active {
  background: #0284C7;
  color: #FFFFFF;
}

.asset-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.asset-status-draft { background: #F3F4F6; color: #4B5563; }
.asset-status-active { background: #DCFCE7; color: #15803D; }
.asset-status-suspended { background: #FEF3C7; color: #B45309; }
.asset-status-depreciated { background: #E0E7FF; color: #4338CA; }
.asset-status-disposed { background: #FEE2E2; color: #B91C1C; }
.asset-status-transferred { background: #E0F2FE; color: #0369A1; }
.asset-status-written-off { background: #F1F5F9; color: #64748B; }

.assets-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Procurement & Supply Chain Management UI Styles */
.proc-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-top: 6px;
  padding-bottom: 8px;
  padding-left: 2px;
  padding-right: 2px;
  margin-top: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  min-height: 48px;
  height: auto;
  flex-shrink: 0;
}

.proc-tab-btn, .inv-tab-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.proc-tab-btn:hover, .inv-tab-btn:hover {
  background: var(--bg);
  color: var(--text-main);
  border-color: #94A3B8;
}

.proc-tab-btn:focus-visible, .inv-tab-btn:focus-visible {
  outline: 2px solid #0D9488;
  outline-offset: 1px;
}

.proc-tab-btn.active {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.3);
}

.inv-tab-btn.active {
  background: #0284C7;
  border-color: #0284C7;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35);
}

.proc-tab-btn:disabled, .inv-tab-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Dark Mode Compatibility */
[data-theme="dark"] .proc-tab-btn, [data-theme="dark"] .inv-tab-btn {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .proc-tab-btn:hover, [data-theme="dark"] .inv-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: #475569;
}

[data-theme="dark"] .proc-tab-btn.active {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.45);
}

[data-theme="dark"] .inv-tab-btn.active {
  background: #0284C7;
  border-color: #0284C7;
  color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.45);
}

/* RTL Internationalization */
[dir="rtl"] .proc-tab-btn, [dir="rtl"] .inv-tab-btn {
  gap: 6px;
  font-family: 'IBM Plex Sans Arabic', var(--font-family);
}

/* ============================================================================
   UNIVERSAL INVENTORY & WAREHOUSE ENGINE UI POLISH
   ============================================================================ */
.inventory-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  margin: 6px 0 14px;
}

.inventory-quick-actions .integra-btn {
  width: auto;
  min-width: 0;
  height: 36px;
  padding: 0 14px;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--integra-radius-md, 8px);
}

#inventoryView .btn {
  width: auto;
  min-width: 0;
  margin-bottom: 0;
}

/* Universal Inventory Tabs Strip — Robust Enterprise Styling */
.inv-tabs-bar,
#inventoryView .integra-tabs-bar {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-bottom: 1px solid var(--integra-border, var(--border)) !important;
  padding-top: 6px !important;
  padding-bottom: 8px !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  margin-top: 4px !important;
  margin-bottom: 16px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: thin !important;
  min-height: 48px !important;
  height: auto !important;
  flex-shrink: 0 !important;
}

#inventoryView .inv-tab-btn,
#inventoryView .integra-tab-btn {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 14px !important;
  border-radius: 6px !important;
  font-family: var(--font-family) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  flex-shrink: 0 !important;
}

#inventoryView .inv-tab-btn:hover,
#inventoryView .integra-tab-btn:hover {
  background: var(--bg) !important;
  color: var(--text-main) !important;
  border-color: #94A3B8 !important;
}

#inventoryView .inv-tab-btn.active,
#inventoryView .integra-tab-btn.active {
  background: #0284C7 !important;
  border-color: #0284C7 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35) !important;
}

[data-theme="dark"] #inventoryView .inv-tab-btn,
[data-theme="dark"] #inventoryView .integra-tab-btn {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] #inventoryView .inv-tab-btn:hover,
[data-theme="dark"] #inventoryView .integra-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
  border-color: #475569 !important;
}

[data-theme="dark"] #inventoryView .inv-tab-btn.active,
[data-theme="dark"] #inventoryView .integra-tab-btn.active {
  background: #0284C7 !important;
  border-color: #0284C7 !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.45) !important;
}

.inventory-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 1280px) {
  .inventory-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

/* ============================================================================
   UNIVERSAL SALES & BILLING ENGINE WORKSPACE STYLING
   ============================================================================ */
.sales-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  margin: 6px 0 14px;
}

.sales-quick-actions .integra-btn {
  width: auto;
  min-width: 0;
  height: 36px;
  padding: 0 14px;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--integra-radius-md, 8px);
}

#salesView .btn {
  width: auto;
  min-width: 0;
  margin-bottom: 0;
}

/* Universal Sales Tabs Strip — Robust Enterprise Styling */
.sales-tabs-bar,
#salesView .integra-tabs-bar {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  border-bottom: 1px solid var(--integra-border, var(--border)) !important;
  padding-top: 5px !important;
  padding-bottom: 7px !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  margin-top: 4px !important;
  margin-bottom: 16px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: thin !important;
  min-height: 44px !important;
  height: auto !important;
  flex-shrink: 0 !important;
}

#salesView .sales-tab-btn,
#salesView .integra-tab-btn {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  font-family: var(--font-family) !important;
  font-size: 0.70rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.1px !important;
  cursor: pointer !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  flex-shrink: 0 !important;
}

#salesView .sales-tab-btn:hover,
#salesView .integra-tab-btn:hover {
  background: var(--bg) !important;
  color: var(--text-main) !important;
  border-color: #94A3B8 !important;
}

#salesView .sales-tab-btn.active,
#salesView .integra-tab-btn.active {
  background: #2563EB !important;
  border-color: #2563EB !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] #salesView .sales-tab-btn,
[data-theme="dark"] #salesView .integra-tab-btn {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] #salesView .sales-tab-btn:hover,
[data-theme="dark"] #salesView .integra-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
  border-color: #475569 !important;
}

[data-theme="dark"] #salesView .sales-tab-btn.active,
[data-theme="dark"] #salesView .integra-tab-btn.active {
  background: #2563EB !important;
  border-color: #2563EB !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.45) !important;
}

.sales-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 1280px) {
  .sales-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

/* Universal CRM Tabs Strip — Robust Enterprise Styling */
.crm-tabs-bar,
#crmView .integra-tabs-bar {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  border-bottom: 1px solid var(--integra-border, var(--border)) !important;
  padding-top: 5px !important;
  padding-bottom: 7px !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  margin-top: 4px !important;
  margin-bottom: 16px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: thin !important;
  min-height: 44px !important;
  height: auto !important;
  flex-shrink: 0 !important;
}

#crmView .crm-tab-btn,
#crmView .integra-tab-btn {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  font-family: var(--font-family) !important;
  font-size: 0.70rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.1px !important;
  cursor: pointer !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  flex-shrink: 0 !important;
}

#crmView .crm-tab-btn:hover,
#crmView .integra-tab-btn:hover {
  background: var(--bg) !important;
  color: var(--text-main) !important;
  border-color: #94A3B8 !important;
}

#crmView .crm-tab-btn.active,
#crmView .integra-tab-btn.active {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] #crmView .crm-tab-btn,
[data-theme="dark"] #crmView .integra-tab-btn {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] #crmView .crm-tab-btn:hover,
[data-theme="dark"] #crmView .integra-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
  border-color: #475569 !important;
}

[data-theme="dark"] #crmView .crm-tab-btn.active,
[data-theme="dark"] #crmView .integra-tab-btn.active {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.45) !important;
}

.crm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 1280px) {
  .crm-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

/* CRM Pipeline Kanban Board */
.crm-kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: stretch;
  min-height: 480px;
}

.crm-kanban-column {
  flex: 0 0 280px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.crm-kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.crm-kanban-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
}

.crm-kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.crm-kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: #10B981;
}

.proc-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.proc-status-draft { background: #F3F4F6; color: #4B5563; }
.proc-status-submitted { background: #FEF3C7; color: #B45309; }
.proc-status-approved { background: #DCFCE7; color: #15803D; }
.proc-status-rejected { background: #FEE2E2; color: #B91C1C; }
.proc-status-converted { background: #E0E7FF; color: #4338CA; }
.proc-status-issued { background: #E0F2FE; color: #0369A1; }
.proc-status-awarded { background: #CCFBF1; color: #0F766E; }
.proc-status-sent { background: #DBEAFE; color: #1D4ED8; }
.proc-status-partially-received { background: #FEF08A; color: #854D0E; }
.proc-status-completed { background: #DCFCE7; color: #15803D; }
.proc-status-matched { background: #DCFCE7; color: #15803D; }
.proc-status-blocked { background: #FEE2E2; color: #B91C1C; }
.proc-status-resolved { background: #E0E7FF; color: #4338CA; }

/* ============================================================================
   INTEGRA GLOBAL ERP PREMIUM UI/UX DESIGN SYSTEM & MOTION STANDARD
   Unified Enterprise Component Architecture
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. KEYFRAME ANIMATIONS & MICRO-INTERACTIONS
   ---------------------------------------------------------------------------- */
@keyframes integraFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes integraModalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes integraDrawerSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes integraPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.9);
  }
}

@keyframes integraShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes integraSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ----------------------------------------------------------------------------
   2. GLOBAL WORKSPACE & VIEW TRANSITIONS
   ---------------------------------------------------------------------------- */
.integra-workspace-view {
  animation: integraFadeIn var(--integra-transition-normal) ease-out forwards;
}

/* ----------------------------------------------------------------------------
   3. GLOBAL CARD SYSTEM
   ---------------------------------------------------------------------------- */
.integra-card {
  background: var(--integra-bg-card);
  border: 1px solid var(--integra-border);
  border-radius: var(--integra-radius-xl);
  padding: 18px 20px;
  box-shadow: var(--integra-shadow-xs);
  transition: transform var(--integra-transition-fast), box-shadow var(--integra-transition-fast), border-color var(--integra-transition-fast);
  position: relative;
}

.integra-card:hover,
.integra-card-hover:hover {
  transform: translateY(-1px);
  box-shadow: var(--integra-shadow-md);
  border-color: var(--integra-border-strong);
}

.integra-card-accent {
  border-top: 3px solid var(--integra-primary);
}

.integra-card-accent.accent-indigo { border-top-color: var(--integra-indigo); }
.integra-card-accent.accent-emerald { border-top-color: var(--integra-emerald); }
.integra-card-accent.accent-amber { border-top-color: var(--integra-amber); }
.integra-card-accent.accent-rose { border-top-color: var(--integra-rose); }
.integra-card-accent.accent-purple { border-top-color: var(--integra-purple); }
.integra-card-accent.accent-cyan { border-top-color: var(--integra-cyan); }
.integra-card-accent.accent-teal { border-top-color: var(--integra-teal); }

.integra-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--integra-border);
}

.integra-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--integra-text);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.integra-card-subtitle {
  font-size: 0.72rem;
  color: var(--integra-text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.integra-card-body {
  flex: 1;
}

.integra-card-footer {
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--integra-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.integra-card-table {
  padding: 0;
  overflow: hidden;
}

.integra-card-table .integra-card-header {
  padding: 16px 20px;
  margin-bottom: 0;
}

/* ----------------------------------------------------------------------------
   4. GLOBAL KPI CARD SYSTEM (PREMIUM ENTERPRISE KPI CARDS)
   ---------------------------------------------------------------------------- */
.integra-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.integra-kpi-card {
  background: var(--integra-bg-card);
  border: 1px solid var(--integra-border);
  border-top: 2px solid var(--integra-primary);
  border-radius: var(--integra-radius-xl);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 108px;
  box-shadow: var(--integra-shadow-xs);
  transition: transform var(--integra-transition-fast), box-shadow var(--integra-transition-fast);
}

.integra-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--integra-shadow-md);
}

.integra-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.integra-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--integra-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.integra-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--integra-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: var(--integra-primary-soft);
  color: var(--integra-primary);
  flex-shrink: 0;
}

.integra-kpi-middle {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.integra-kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--integra-text);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.integra-kpi-trend {
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.integra-kpi-trend.up {
  color: #059669;
}

.integra-kpi-trend.down {
  color: #E11D48;
}

.integra-kpi-bottom {
  font-size: 0.72rem;
  color: var(--integra-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

/* Semantic Variants for KPI */
.integra-kpi-blue { border-top-color: var(--integra-blue); }
.integra-kpi-blue .integra-kpi-icon { background: var(--integra-blue-soft); color: var(--integra-blue); }

.integra-kpi-indigo { border-top-color: var(--integra-indigo); }
.integra-kpi-indigo .integra-kpi-icon { background: var(--integra-indigo-soft); color: var(--integra-indigo); }

.integra-kpi-emerald { border-top-color: var(--integra-emerald); }
.integra-kpi-emerald .integra-kpi-icon { background: var(--integra-emerald-soft); color: var(--integra-emerald); }

.integra-kpi-purple { border-top-color: var(--integra-purple); }
.integra-kpi-purple .integra-kpi-icon { background: var(--integra-purple-soft); color: var(--integra-purple); }

.integra-kpi-amber { border-top-color: var(--integra-amber); }
.integra-kpi-amber .integra-kpi-icon { background: var(--integra-amber-soft); color: var(--integra-amber); }

.integra-kpi-rose { border-top-color: var(--integra-rose); }
.integra-kpi-rose .integra-kpi-icon { background: var(--integra-rose-soft); color: var(--integra-rose); }

.integra-kpi-cyan { border-top-color: var(--integra-cyan); }
.integra-kpi-cyan .integra-kpi-icon { background: var(--integra-cyan-soft); color: var(--integra-cyan); }

.integra-kpi-teal { border-top-color: var(--integra-teal); }
.integra-kpi-teal .integra-kpi-icon { background: var(--integra-teal-soft); color: var(--integra-teal); }

/* ----------------------------------------------------------------------------
   5. GLOBAL TAB SYSTEM (INTEGRA TABS)
   ---------------------------------------------------------------------------- */
.integra-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--integra-border);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.integra-tabs-bar::-webkit-scrollbar {
  display: none;
}

.integra-tab-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--integra-radius-md) var(--integra-radius-md) 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--integra-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all var(--integra-transition-fast);
  user-select: none;
}

.integra-tab-btn:hover {
  color: var(--integra-text);
  background: var(--integra-bg-muted);
}

.integra-tab-btn.active {
  color: var(--integra-primary);
  font-weight: 700;
  border-bottom-color: var(--integra-primary);
  background: var(--integra-primary-soft);
}

[data-theme="dark"] .integra-tab-btn.active {
  color: #60A5FA;
  border-bottom-color: #60A5FA;
  background: rgba(96, 165, 250, 0.12);
}

.integra-tab-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--integra-bg-muted);
  color: var(--integra-text-muted);
}

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

/* Pills variant for inner sub-tabs */
.integra-tabs-pills {
  display: inline-flex;
  background: var(--integra-bg-muted);
  padding: 3px;
  border-radius: var(--integra-radius-md);
  border: 1px solid var(--integra-border);
  gap: 2px;
  border-bottom: 1px solid var(--integra-border);
}

.integra-tabs-pills .integra-tab-btn {
  border-radius: var(--integra-radius-sm);
  height: 28px;
  padding: 0 12px;
  border-bottom: none;
  font-size: 0.74rem;
}

.integra-tabs-pills .integra-tab-btn.active {
  background: var(--integra-bg-card);
  color: var(--integra-primary);
  box-shadow: var(--integra-shadow-xs);
}

/* ----------------------------------------------------------------------------
   6. GLOBAL BUTTON SYSTEM
   ---------------------------------------------------------------------------- */
.integra-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--integra-radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--integra-transition-fast);
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

.integra-btn:hover {
  transform: translateY(-1px);
}

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

.integra-btn:disabled,
.integra-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.integra-btn-primary {
  background: var(--integra-primary);
  color: #FFFFFF;
  border-color: var(--integra-primary);
  box-shadow: 0 1px 2px rgba(0, 85, 169, 0.2);
}

.integra-btn-primary:hover {
  background: var(--integra-primary-hover);
  border-color: var(--integra-primary-hover);
  box-shadow: 0 2px 6px rgba(0, 85, 169, 0.32);
}

.integra-btn-secondary {
  background: var(--integra-bg-muted);
  color: var(--integra-text);
  border-color: var(--integra-border);
}

.integra-btn-secondary:hover {
  background: var(--integra-bg-hover);
  color: var(--integra-text);
  border-color: var(--integra-border-strong);
}

.integra-btn-outline {
  background: transparent;
  color: var(--integra-text);
  border-color: var(--integra-border);
}

.integra-btn-outline:hover {
  background: var(--integra-bg-muted);
  border-color: var(--integra-border-strong);
}

.integra-btn-success {
  background: var(--integra-emerald);
  color: #FFFFFF;
  border-color: var(--integra-emerald);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.integra-btn-success:hover {
  filter: brightness(0.92);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.integra-btn-warning {
  background: var(--integra-amber);
  color: #FFFFFF;
  border-color: var(--integra-amber);
}

.integra-btn-danger {
  background: var(--integra-rose);
  color: #FFFFFF;
  border-color: var(--integra-rose);
  box-shadow: 0 1px 2px rgba(244, 63, 94, 0.2);
}

.integra-btn-danger:hover {
  filter: brightness(0.92);
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.3);
}

.integra-btn-ghost {
  background: transparent;
  color: var(--integra-text-muted);
  border: none;
}

.integra-btn-ghost:hover {
  background: var(--integra-bg-muted);
  color: var(--integra-text);
}

.integra-btn-icon {
  width: 34px;
  padding: 0;
}

.integra-btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
}

.integra-btn-lg {
  height: 40px;
  padding: 0 20px;
  font-size: 0.85rem;
}

/* ----------------------------------------------------------------------------
   6B. BUTTON SYSTEM COMPATIBILITY ALIASES (.btn-integra)
   ---------------------------------------------------------------------------- */
.btn-integra {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--integra-radius-md, 6px);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--integra-transition-fast, 0.15s ease);
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  box-sizing: border-box;
}

.btn-integra:hover {
  transform: translateY(-1px);
}

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

.btn-integra-primary {
  background: var(--integra-primary, #0055A9) !important;
  color: #FFFFFF !important;
  border-color: var(--integra-primary, #0055A9) !important;
  box-shadow: 0 1px 3px rgba(0, 85, 169, 0.25);
}

.btn-integra-primary:hover {
  background: var(--integra-primary-hover, #004488) !important;
  border-color: var(--integra-primary-hover, #004488) !important;
  box-shadow: 0 2px 6px rgba(0, 85, 169, 0.35);
}

.btn-integra-secondary {
  background: var(--integra-bg-card, #FFFFFF) !important;
  color: var(--integra-text, #1E293B) !important;
  border-color: var(--integra-border, #CBD5E1) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-integra-secondary:hover {
  background: var(--integra-bg-muted, #F8FAFC) !important;
  border-color: var(--integra-border-strong, #94A3B8) !important;
  color: var(--integra-text, #1E293B) !important;
}

.btn-integra-outline {
  background: transparent !important;
  color: var(--integra-text, #1E293B) !important;
  border-color: var(--integra-border, #CBD5E1) !important;
}

.btn-integra-outline:hover {
  background: var(--integra-bg-muted, #F8FAFC) !important;
  border-color: var(--integra-border-strong, #94A3B8) !important;
}

.btn-integra-sm {
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 0.74rem !important;
}

[data-theme="dark"] .btn-integra-secondary {
  background: var(--integra-bg-card, #1E293B) !important;
  color: var(--integra-text, #F8FAFC) !important;
  border-color: var(--integra-border, #334155) !important;
}

[data-theme="dark"] .btn-integra-secondary:hover {
  background: var(--integra-bg-muted, #334155) !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .btn-integra-outline {
  color: var(--integra-text-muted, #94A3B8) !important;
  border-color: var(--integra-border, #334155) !important;
}

/* ----------------------------------------------------------------------------
   6C. SUBNAV TABS & SUBTAB SYSTEM (.integra-subnav-tabs & .integra-subtab)
   ---------------------------------------------------------------------------- */
.integra-subnav-tabs {
  display: flex !important;
  gap: 4px !important;
  margin-bottom: 16px !important;
  border-bottom: 1px solid var(--integra-border, #E2E8F0) !important;
  padding-bottom: 0 !important;
  overflow-x: auto !important;
}

.integra-subtab {
  height: 36px !important;
  padding: 0 16px !important;
  border-radius: var(--integra-radius-md, 6px) var(--integra-radius-md, 6px) 0 0 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: var(--integra-text-muted, #64748B) !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  transition: all var(--integra-transition-fast, 0.15s ease) !important;
  user-select: none !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}

.integra-subtab:hover {
  color: var(--integra-text, #1E293B) !important;
  background: var(--integra-bg-muted, rgba(0, 0, 0, 0.04)) !important;
}

.integra-subtab.active {
  color: var(--integra-primary, #0055A9) !important;
  font-weight: 700 !important;
  border-bottom-color: var(--integra-primary, #0055A9) !important;
  background: var(--integra-primary-soft, rgba(0, 85, 169, 0.08)) !important;
}

[data-theme="dark"] .integra-subnav-tabs {
  border-bottom-color: var(--integra-border, #334155) !important;
}

[data-theme="dark"] .integra-subtab {
  color: var(--integra-text-muted, #94A3B8) !important;
}

[data-theme="dark"] .integra-subtab:hover {
  color: #F8FAFC !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .integra-subtab.active {
  color: #60A5FA !important;
  border-bottom-color: #60A5FA !important;
  background: rgba(96, 165, 250, 0.12) !important;
}

/* ----------------------------------------------------------------------------
   7. GLOBAL MODAL SYSTEM
   ---------------------------------------------------------------------------- */
.integra-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.integra-modal-overlay.show,
.integra-modal-overlay[style*="display: flex"] {
  animation: integraModalFadeIn var(--integra-transition-normal) ease-out forwards;
}

.integra-modal-panel {
  background: var(--integra-bg-card);
  color: var(--integra-text);
  border-radius: var(--integra-radius-xl);
  border: 1px solid var(--integra-border);
  box-shadow: var(--integra-shadow-xl);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: integraModalSlideIn var(--integra-transition-normal) ease-out forwards;
}

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

.integra-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--integra-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.integra-modal-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--integra-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--integra-radius-sm);
  transition: all var(--integra-transition-fast);
}

.integra-modal-close:hover {
  color: var(--integra-text);
  background: var(--integra-bg-muted);
}

.integra-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.integra-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--integra-border);
  background: var(--integra-bg-muted);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

/* ----------------------------------------------------------------------------
   8. GLOBAL DRAWER SYSTEM
   ---------------------------------------------------------------------------- */
.integra-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1500;
  display: none;
}

.integra-drawer-overlay.show {
  display: block;
  animation: integraModalFadeIn var(--integra-transition-normal) ease-out forwards;
}

.integra-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 90vw;
  background: var(--integra-bg-card);
  border-left: 1px solid var(--integra-border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1501;
  display: flex;
  flex-direction: column;
  animation: integraDrawerSlideIn var(--integra-transition-normal) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[dir="rtl"] .integra-drawer-panel {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--integra-border);
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
}

/* ----------------------------------------------------------------------------
   9. GLOBAL PAGE HEADER PATTERN
   ---------------------------------------------------------------------------- */
.integra-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.integra-page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.integra-page-header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--integra-radius-lg);
  background: var(--integra-primary-soft);
  color: var(--integra-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: var(--integra-shadow-xs);
  flex-shrink: 0;
}

.integra-page-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--integra-text);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.integra-page-header-subtitle {
  font-size: 0.74rem;
  color: var(--integra-text-muted);
  font-weight: 500;
  margin-top: 2px;
}

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

/* ----------------------------------------------------------------------------
   10. GLOBAL TABLE SYSTEM
   ---------------------------------------------------------------------------- */
.integra-table-container {
  background: var(--integra-bg-card);
  border: 1px solid var(--integra-border);
  border-radius: var(--integra-radius-xl);
  overflow: hidden;
  box-shadow: var(--integra-shadow-xs);
  width: 100%;
}

.integra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.integra-table thead {
  background: var(--integra-bg-muted);
  border-bottom: 1px solid var(--integra-border);
}

.integra-table th {
  padding: 10px 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--integra-text-muted);
  text-align: left;
  white-space: nowrap;
}

.integra-table tbody tr {
  border-bottom: 1px solid var(--integra-border);
  transition: background var(--integra-transition-fast);
}

.integra-table tbody tr:last-child {
  border-bottom: none;
}

.integra-table tbody tr:hover {
  background: var(--integra-bg-hover);
}

.integra-table td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--integra-text);
}

.integra-col-numeric {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.integra-table-sticky th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* ----------------------------------------------------------------------------
   11. GLOBAL STATUS BADGES
   ---------------------------------------------------------------------------- */
.integra-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--integra-radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.integra-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  animation: integraPulse 2.5s infinite;
}

.integra-badge-active,
.integra-badge-approved,
.integra-badge-posted,
.integra-badge-paid,
.integra-badge-completed {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}
.integra-badge-active .integra-badge-dot,
.integra-badge-approved .integra-badge-dot,
.integra-badge-posted .integra-badge-dot,
.integra-badge-paid .integra-badge-dot,
.integra-badge-completed .integra-badge-dot {
  background: #10B981;
}

.integra-badge-submitted,
.integra-badge-pending,
.integra-badge-evaluating,
.integra-badge-under-review {
  background: rgba(79, 70, 229, 0.12);
  color: #4F46E5;
  border-color: rgba(79, 70, 229, 0.25);
}
.integra-badge-submitted .integra-badge-dot,
.integra-badge-pending .integra-badge-dot,
.integra-badge-evaluating .integra-badge-dot,
.integra-badge-under-review .integra-badge-dot {
  background: #6366F1;
}

.integra-badge-draft,
.integra-badge-inactive {
  background: rgba(100, 116, 139, 0.12);
  color: #64748B;
  border-color: rgba(100, 116, 139, 0.25);
}
.integra-badge-draft .integra-badge-dot,
.integra-badge-inactive .integra-badge-dot {
  background: #94A3B8;
}

.integra-badge-rejected,
.integra-badge-cancelled,
.integra-badge-blocked,
.integra-badge-exception {
  background: rgba(244, 63, 94, 0.12);
  color: #E11D48;
  border-color: rgba(244, 63, 94, 0.25);
}
.integra-badge-rejected .integra-badge-dot,
.integra-badge-cancelled .integra-badge-dot,
.integra-badge-blocked .integra-badge-dot,
.integra-badge-exception .integra-badge-dot {
  background: #F43F5E;
}

.integra-badge-converted,
.integra-badge-awarded,
.integra-badge-matched {
  background: rgba(13, 148, 136, 0.12);
  color: #0D9488;
  border-color: rgba(13, 148, 136, 0.25);
}
.integra-badge-converted .integra-badge-dot,
.integra-badge-awarded .integra-badge-dot,
.integra-badge-matched .integra-badge-dot {
  background: #0D9488;
}

.integra-badge-warning,
.integra-badge-unpaid,
.integra-badge-partially-received {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border-color: rgba(245, 158, 11, 0.25);
}
.integra-badge-warning .integra-badge-dot,
.integra-badge-unpaid .integra-badge-dot,
.integra-badge-partially-received .integra-badge-dot {
  background: #F59E0B;
}

/* ----------------------------------------------------------------------------
   12. GLOBAL FORM SYSTEM
   ---------------------------------------------------------------------------- */
.integra-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.integra-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--integra-text-muted);
  letter-spacing: 0.4px;
  display: block;
}

.integra-input,
.integra-select,
.integra-textarea {
  padding: 7px 12px;
  border: 1px solid var(--integra-border);
  border-radius: var(--integra-radius-md);
  background: var(--integra-bg-card);
  color: var(--integra-text);
  font-size: 0.82rem;
  transition: border-color var(--integra-transition-fast), box-shadow var(--integra-transition-fast);
  outline: none;
  width: 100%;
}

.integra-input:focus,
.integra-select:focus,
.integra-textarea:focus {
  border-color: var(--integra-primary);
  box-shadow: 0 0 0 3px var(--integra-primary-soft);
}

.integra-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* ----------------------------------------------------------------------------
   13. GLOBAL LOADING & SKELETON SYSTEM
   ---------------------------------------------------------------------------- */
.integra-skeleton {
  background: linear-gradient(90deg, var(--integra-bg-muted) 25%, var(--integra-border) 50%, var(--integra-bg-muted) 75%);
  background-size: 200% 100%;
  animation: integraShimmer 1.6s infinite;
  border-radius: var(--integra-radius-sm);
}

.integra-skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.integra-skeleton-card {
  height: 110px;
  border-radius: var(--integra-radius-xl);
}

.integra-skeleton-table {
  height: 240px;
  border-radius: var(--integra-radius-xl);
}

.integra-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--integra-border);
  border-top-color: var(--integra-primary);
  border-radius: 50%;
  animation: integraSpin 0.75s linear infinite;
  display: inline-block;
}

.integra-btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.integra-btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: integraSpin 0.6s linear infinite;
  display: inline-block;
  margin-left: 6px;
}

/* ----------------------------------------------------------------------------
   14. GLOBAL EMPTY & ERROR STATES
   ---------------------------------------------------------------------------- */
.integra-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  border-radius: var(--integra-radius-xl);
  background: var(--integra-bg-card);
  border: 1px dashed var(--integra-border);
}

.integra-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--integra-radius-xl);
  background: var(--integra-bg-muted);
  color: var(--integra-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
  border: 1px solid var(--integra-border);
}

.integra-empty-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--integra-text);
  margin-bottom: 6px;
}

.integra-empty-desc {
  font-size: 0.76rem;
  color: var(--integra-text-muted);
  max-width: 360px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.integra-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--integra-radius-xl);
  background: rgba(244, 63, 94, 0.04);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.integra-error-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--integra-radius-xl);
  background: rgba(244, 63, 94, 0.1);
  color: var(--integra-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

/* ----------------------------------------------------------------------------
   15. REDUCED MOTION SUPPORT (ACCESSIBILITY STANDARD)
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }
}

/* ----------------------------------------------------------------------------
   16. SYSTEM-WIDE WORKSPACE INHERITANCE & ELEMENT STANDARDIZATION
   ---------------------------------------------------------------------------- */
[data-theme="dark"] header.integra-topbar-100 {
  background: #0F172A;
  border-bottom: 1px solid var(--integra-border);
}

#dashboardView, #orgView, #coaView, #voucherView, #ledgerView, 
#reportsView, #periodsView, #financeView, #devicesView, 
#masterdataView, #assetsView, #procurementView {
  animation: integraFadeIn var(--integra-transition-normal) ease-out forwards;
}

/* Modals System Integration */
div[id$="Modal"] {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity var(--integra-transition-normal) ease-out;
}

div[id$="Modal"] > div {
  border-radius: var(--integra-radius-xl) !important;
  border: 1px solid var(--integra-border) !important;
  box-shadow: var(--integra-shadow-xl) !important;
  background: var(--integra-bg-card) !important;
  color: var(--integra-text) !important;
}

div[id$="Modal"][style*="display: flex"] {
  animation: integraModalFadeIn var(--integra-transition-normal) ease-out forwards;
}

div[id$="Modal"][style*="display: flex"] > div {
  animation: integraModalSlideIn var(--integra-transition-normal) ease-out forwards;
}

/* Global Table Typography & Compact Row Elevation */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

thead tr {
  background: var(--integra-bg-muted);
  border-bottom: 1px solid var(--integra-border);
}

th {
  padding: 10px 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--integra-text-muted);
}

tbody tr {
  border-bottom: 1px solid var(--integra-border);
  transition: background var(--integra-transition-fast);
}

tbody tr:hover {
  background: var(--integra-bg-hover);
}

td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--integra-text);
}

/* Global Input / Select Form Standardization */
input[type="text"], input[type="number"], input[type="date"], input[type="email"], select, textarea {
  border-radius: var(--integra-radius-md);
  border: 1px solid var(--integra-border);
  background: var(--integra-bg-card);
  color: var(--integra-text);
  font-size: 0.82rem;
  padding: 7px 12px;
  transition: border-color var(--integra-transition-fast), box-shadow var(--integra-transition-fast);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--integra-primary);
  box-shadow: 0 0 0 3px var(--integra-primary-soft);
}

/* ==========================================================================
   DMS, BI & AI WORKSPACE PANELS & COMPONENT STYLING
   ========================================================================== */
.dms-panel {
  display: block;
}
.dms-panel.hidden, .dms-panel[style*="display:none"], .dms-panel[style*="display: none"] {
  display: none !important;
}

.bi-panel {
  display: block;
}
.bi-panel.hidden, .bi-panel[style*="display:none"], .bi-panel[style*="display: none"] {
  display: none !important;
}

.ai-panel {
  display: block;
}
.ai-panel#ai-panel-chat {
  display: flex;
}
.ai-panel.hidden, .ai-panel[style*="display:none"], .ai-panel[style*="display: none"] {
  display: none !important;
}

/* Subtab and Card Container Consistency */
.integra-subnav-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--integra-border);
  padding-bottom: 8px;
  overflow-x: auto;
}

.integra-subtab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--integra-radius-md);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--integra-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--integra-transition-fast);
  white-space: nowrap;
}

.integra-subtab:hover {
  background: var(--integra-bg-hover);
  color: var(--integra-text);
}

.integra-subtab.active {
  background: var(--integra-primary-soft);
  color: var(--integra-primary);
  border-color: rgba(37, 99, 235, 0.25);
  font-weight: 700;
}

/* ==========================================================================
   AI QUICK PROMPT CHIPS (.integra-btn-pill)
   ========================================================================== */
.integra-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.06);
  color: var(--integra-primary, #4F46E5);
  transition: all 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
}

.integra-btn-pill:hover {
  background: rgba(79, 70, 229, 0.14);
  border-color: rgba(79, 70, 229, 0.6);
  color: var(--integra-primary, #4F46E5);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.integra-btn-pill:active {
  transform: translateY(0);
  box-shadow: none;
}

[data-theme="dark"] .integra-btn-pill {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
  color: #A78BFA;
}

[data-theme="dark"] .integra-btn-pill:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.7);
  color: #C4B5FD;
}

/* Ensure chat panel fills available height in new flex context */
#ai-panel-chat {
  min-height: 0 !important;
}
