/* ============================================
   Modern CRM Application Styles
   ============================================ */

/* ============================================
   CSS Variables & Theme
   ============================================ */
:root {
  /* ============================================
     VIEW26 BRAND COLOR PALETTE
     ============================================ */

  /* Neutral Colors */
  --color-neutral-900: #000000;
  --color-neutral-600: #585858;
  --color-neutral-500: #858585;
  --color-neutral-400: #A6A6A6;
  --color-neutral-300: #D0D0D1;
  --color-neutral-25: #F8F8F8;
  --color-neutral-0: #FFFFFF;

  /* Legacy neutral aliases */
  --color-black: #000000;
  --color-neutral-dark: #585858;
  --color-neutral: #858585;
  --color-neutral-light: #A6A6A6;
  --color-neutral-lighter: #D0D0D1;
  --color-neutral-lightest: #F8F8F8;
  --color-white: #FFFFFF;

  /* Primary Blue Shades */
  --color-blue-900: #003166;
  --color-blue-800: #005BCC;
  --color-blue-600: #1072FC;
  --color-blue-500: #3A8DFF;
  --color-blue-400: #579BFF;
  --color-blue-200: #ACCDFF;
  --color-blue-100: #E9F2FF;

  /* Additional Primary Shades */
  --color-primary-pink: #F8AACF;
  --color-primary-light-blue: #64ACE6;
  --color-primary-lighter-blue: #CADFEC;
  --color-primary-lightest-blue: #EEEEFC;
  --color-primary-dark-navy: #0F2845;
  --color-primary-slate: #5F768F;
  --color-primary-light-pink: #FFB5B5;
  --color-primary-lavender: #CFC6DA;
  --color-primary-lime: #88E560;
  --color-primary-light-lime: #C3EEA7;
  --color-primary-lightest-lime: #EEFEC3;
  --color-primary-cream: #FDFBE2;

  /* Legacy primary aliases */
  --color-primary-900: #003166;
  --color-primary-800: #005BCC;
  --color-primary-600: #1072FC;
  --color-primary-500: #3A8DFF;
  --color-primary-400: #579BFF;
  --color-primary-200: #ACCDFF;
  --color-primary-100: #E9F2FF;
  --color-primary: #1072FC;
  --color-primary-dark: #005BCC;
  --color-primary-light: #3A8DFF;
  --color-primary-lighter: #E9F2FF;

  /* Logo Colors */
  --color-logo-purple: #A1A8EF;
  --color-logo-dark-green: #2F3C24;

  /* Legacy logo aliases */
  --color-logo: #A1A8EF;
  --color-logo-dark: #2F3C24;

  /* Chart Colors - Purple */
  --color-purple-800: #392D63;
  --color-purple-700: #5E40B2;
  --color-purple-600: #8D70CB;
  --color-purple-500: #AF7FE7;
  --color-purple-400: #8F8FFF;
  --color-purple-200: #CFDFFD;
  --color-purple-100: #F3F5FF;

  /* Chart Colors - Green */
  --color-green-900: #1E5315;
  --color-green-800: #287B1E;
  --color-green-600: #72A55B;
  --color-green-500: #76B817;
  --color-green-400: #4ADCB7;
  --color-green-200: #EAF4DB;
  --color-green-100: #C5DFF1;

  /* Chart Colors - Teal */
  --color-teal-800: #18E555;
  --color-teal-700: #C00883;
  --color-teal-600: #288B00;
  --color-teal-500: #42B2A7;
  --color-teal-400: #8CC3E0;
  --color-teal-200: #CCEAF8;
  --color-teal-100: #E7F5FF;

  /* Chart Colors - Yellow */
  --color-yellow-900: #E48800;
  --color-yellow-800: #FFA828;
  --color-yellow-600: #FFA127;
  --color-yellow-500: #FEBBCD;
  --color-yellow-400: #FFC270;
  --color-yellow-200: #FFD5D6;
  --color-yellow-100: #FFF8EC;

  /* Chart Colors - Orange */
  --color-orange-900: #663511;
  --color-orange-800: #AA5801;
  --color-orange-600: #CA6A01;
  --color-orange-500: #FF8850;
  --color-orange-400: #FFA612;
  --color-orange-200: #FFC9C8;
  --color-orange-100: #FFF6F6;

  /* Chart Colors - Red */
  --color-red-900: #6C1803;
  --color-red-800: #A46023;
  --color-red-600: #D5A635;
  --color-red-500: #F15B5C;
  --color-red-400: #EB7760;
  --color-red-200: #FEECD2;
  --color-red-100: #FFEFE8;

  /* Semantic Color Aliases */
  --color-secondary: #585858;
  --color-secondary-dark: #000000;
  --color-secondary-light: #858585;
  --color-accent: #8D70CB;
  --color-accent-dark: #5E40B2;
  --color-success: #76B817;
  --color-warning: #FFA127;
  --color-danger: #F15B5C;
  --color-info: #42B2A7;

  /* Gray Scale Aliases - Mapped to view26 Neutral Palette */
  --color-gray-50: #F8F8F8;   /* Neutral-25: Light backgrounds */
  --color-gray-100: #F8F8F8;  /* Neutral-25: Very light backgrounds */
  --color-gray-200: #D0D0D1;  /* Neutral-300: Dividers, borders */
  --color-gray-300: #D0D0D1;  /* Neutral-300: Borders */
  --color-gray-400: #A6A6A6;  /* Neutral-400: Disabled text, subtle borders */
  --color-gray-500: #858585;  /* Neutral-500: Tertiary text, placeholders */
  --color-gray-600: #585858;  /* Neutral-600: Secondary text */
  --color-gray-700: #585858;  /* Neutral-600: Secondary text */
  --color-gray-800: #000000;  /* Neutral-900: Primary text */
  --color-gray-900: #000000;  /* Neutral-900: Headings, primary text */

  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Borders */
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  --border-radius-full: 9999px;

  --border-width: 1px;
  --border-color: var(--color-gray-200);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --header-height: 64px;
  --container-max-width: 1400px;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
  min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-gray-900);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-gray-700);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

strong, b {
  font-weight: var(--font-weight-bold);
}

small {
  font-size: var(--font-size-sm);
}

code {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  background-color: var(--color-gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: var(--border-radius-sm);
}

/* ============================================
   Layout Structure
   ============================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
  flex: 1;
  padding: var(--spacing-2xl);
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   Header / Top Navigation
   ============================================ */
.header {
  height: var(--header-height);
  background-color: var(--color-white);
  border-bottom: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  color: var(--color-gray-600);
  font-size: var(--font-size-2xl);
  transition: color var(--transition-fast);
}

.menu-toggle:hover {
  color: var(--color-gray-900);
}

/* ============================================
   Sidebar Navigation
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-primary-dark-navy); /* view26 Brand: Primary Dark Navy */
  color: var(--color-white);
  overflow-x: hidden;
  transition: width var(--transition-base), transform var(--transition-base);
  z-index: var(--z-fixed);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid rgba(87, 155, 255, 0.2); /* view26 Brand: Subtle blue-400 border */
}

.sidebar-logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-logo {
  font-size: var(--font-size-lg);
}

.sidebar-nav {
  padding: var(--spacing-lg) 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-footer {
  flex-shrink: 0;
}

.nav-section {
  margin-bottom: var(--spacing-xl);
}

.nav-section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-blue-400); /* view26 Brand: Light blue for contrast on dark navy */
  padding: 0 var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: var(--spacing-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--color-blue-200); /* view26 Brand: Light blue for readable text on dark navy */
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  border-radius: var(--border-radius-md);
  margin: 0 var(--spacing-sm);
}

.nav-link:hover {
  background-color: rgba(16, 114, 252, 0.15); /* view26 Brand: Subtle blue-600 tint */
  color: var(--color-white);
  text-decoration: none;
}

.nav-link.active {
  background-color: var(--color-blue-600); /* view26 Brand: Primary brand blue */
  color: var(--color-white);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--color-blue-400); /* view26 Brand: Bright accent */
  border-radius: var(--border-radius-full);
}

.nav-icon {
  font-size: var(--font-size-xl);
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.nav-badge {
  margin-left: auto;
  background-color: var(--color-danger);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 0.125rem 0.5rem;
  border-radius: var(--border-radius-full);
}

.sidebar.collapsed .nav-badge {
  display: none;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: var(--border-width) solid var(--border-color);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-gray-50);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin: 0;
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  margin-top: var(--spacing-xs);
}

.card-body {
  padding: var(--spacing-xl);
}

.card-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: var(--border-width) solid var(--border-color);
  background-color: var(--color-gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Dashboard Metric Cards */
.metric-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  border: none;
  padding: var(--spacing-xl);
}

.metric-card.success {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
}

.metric-card.warning {
  background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
}

.metric-card.danger {
  background: linear-gradient(135deg, var(--color-danger) 0%, #dc2626 100%);
}

.metric-card.info {
  background: linear-gradient(135deg, var(--color-info) 0%, #0891b2 100%);
}

.metric-card.accent {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
}

.metric-icon {
  font-size: var(--font-size-3xl);
  opacity: 0.9;
  margin-bottom: var(--spacing-md);
}

.metric-value {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-xs);
  line-height: 1;
}

.metric-label {
  font-size: var(--font-size-sm);
  opacity: 0.9;
  font-weight: var(--font-weight-medium);
}

.metric-change {
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.metric-change.positive {
  color: rgba(255, 255, 255, 0.95);
}

.metric-change.negative {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   Grid System
   ============================================ */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid-cols-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

/* ============================================
   Flexbox Utilities
   ============================================ */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-xs {
  gap: var(--spacing-xs);
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

.gap-xl {
  gap: var(--spacing-xl);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-gray-700);
  border-color: var(--color-gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-400);
  color: var(--color-gray-900);
  text-decoration: none;
}

/* Success Button */
.btn-success {
  background-color: var(--color-success);
  color: var(--color-white);
  border-color: var(--color-success);
}

.btn-success:hover:not(:disabled) {
  background-color: var(--color-green-800); /* view26 Brand: Green-800 */
  border-color: var(--color-green-800);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger {
  background-color: var(--color-danger);
  color: var(--color-white);
  border-color: var(--color-danger);
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--color-red-600); /* view26 Brand: Red-600 */
  border-color: var(--color-red-600);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Warning Button */
.btn-warning {
  background-color: var(--color-warning);
  color: var(--color-white);
  border-color: var(--color-warning);
}

.btn-warning:hover:not(:disabled) {
  background-color: var(--color-yellow-900); /* view26 Brand: Yellow-900 */
  border-color: var(--color-yellow-900);
  text-decoration: none;
}

/* Info Button */
.btn-info {
  background-color: var(--color-info);
  color: var(--color-white);
  border-color: var(--color-info);
}

.btn-info:hover:not(:disabled) {
  background-color: var(--color-teal-600); /* view26 Brand: Teal-600 */
  border-color: var(--color-teal-600);
  text-decoration: none;
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}

/* Ghost Button */
.btn-ghost {
  background-color: transparent;
  color: var(--color-gray-700);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--color-gray-100);
  color: var(--color-gray-900);
  text-decoration: none;
}

/* Button Sizes */
.btn-sm {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-lg);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-icon {
  padding: var(--spacing-sm);
  aspect-ratio: 1;
}

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: var(--spacing-sm);
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--border-radius-md);
  border-bottom-left-radius: var(--border-radius-md);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--border-radius-md);
  border-bottom-right-radius: var(--border-radius-md);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  margin-bottom: var(--spacing-sm);
}

.form-label-required::after {
  content: '*';
  color: var(--color-danger);
  margin-left: var(--spacing-xs);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  font-family: inherit;
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.form-control:disabled {
  background-color: var(--color-gray-100);
  cursor: not-allowed;
  opacity: 0.6;
}

.form-control.error {
  border-color: var(--color-danger);
}

.form-control.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.success {
  border-color: var(--color-success);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--spacing-sm) center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: var(--spacing-2xl);
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.form-check-label {
  font-size: var(--font-size-base);
  color: var(--color-gray-700);
  cursor: pointer;
  user-select: none;
}

.form-help {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  margin-top: var(--spacing-xs);
}

.form-error {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-danger);
  margin-top: var(--spacing-xs);
}

.form-success {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-success);
  margin-top: var(--spacing-xs);
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: 0;
  flex: 1;
}

.input-group .form-control:first-child {
  border-top-left-radius: var(--border-radius-md);
  border-bottom-left-radius: var(--border-radius-md);
}

.input-group .form-control:last-child {
  border-top-right-radius: var(--border-radius-md);
  border-bottom-right-radius: var(--border-radius-md);
}

.input-group-prepend,
.input-group-append {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  color: var(--color-gray-700);
  background-color: var(--color-gray-100);
  border: var(--border-width) solid var(--border-color);
}

.input-group-prepend {
  border-right: none;
  border-top-left-radius: var(--border-radius-md);
  border-bottom-left-radius: var(--border-radius-md);
}

.input-group-append {
  border-left: none;
  border-top-right-radius: var(--border-radius-md);
  border-bottom-right-radius: var(--border-radius-md);
}

/* ============================================
   Tables
   ============================================ */
.table-container {
  overflow-x: auto;
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: var(--border-width) solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table thead {
  background-color: var(--color-gray-50);
  border-bottom: 2px solid var(--border-color);
}

.table th {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-700);
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table td {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: var(--border-width) solid var(--border-color);
  color: var(--color-gray-900);
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background-color: var(--color-gray-50);
}

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

.table-striped tbody tr:nth-child(odd) {
  background-color: var(--color-white);
}

.table-striped tbody tr:nth-child(even) {
  background-color: var(--color-gray-50);
}

.table-bordered {
  border: var(--border-width) solid var(--border-color);
}

.table-bordered th,
.table-bordered td {
  border: var(--border-width) solid var(--border-color);
}

.table-compact th,
.table-compact td {
  padding: var(--spacing-sm) var(--spacing-md);
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}

.table-action-btn {
  padding: var(--spacing-xs);
  background: none;
  border: none;
  color: var(--color-gray-600);
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.table-action-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-gray-100);
}

/* ============================================
   Badges & Labels
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.625rem;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border-radius: var(--border-radius-full);
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--color-primary-lighter);
  color: var(--color-primary-dark);
}

.badge-secondary {
  background-color: var(--color-gray-200);
  color: var(--color-gray-700);
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #cffafe;
  color: #164e63;
}

.badge-dot {
  padding-left: 0.375rem;
}

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  margin-right: var(--spacing-xs);
}

/* Status Badges */
.status-active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-inactive {
  background-color: var(--color-gray-200);
  color: var(--color-gray-700);
}

.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.status-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ============================================
   Alerts & Notifications
   ============================================ */
.alert {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius-md);
  border: var(--border-width) solid transparent;
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.alert-icon {
  font-size: var(--font-size-xl);
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-xs);
}

.alert-message {
  font-size: var(--font-size-sm);
  margin: 0;
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.alert-close:hover {
  opacity: 1;
}

.alert-info {
  background-color: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.alert-success {
  background-color: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.alert-warning {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.alert-danger {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* ============================================
   Modal / Dialog
   ============================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  opacity: 0;
  animation: fadeIn var(--transition-base) forwards;
}

.modal {
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-2xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  animation: modalSlideIn var(--transition-base) forwards;
  z-index: var(--z-modal);
}

.modal-sm {
  max-width: 400px;
}

.modal-lg {
  max-width: 800px;
}

.modal-xl {
  max-width: 1200px;
}

.modal-header {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: var(--color-gray-900);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  color: var(--color-gray-600);
  font-size: var(--font-size-2xl);
  line-height: 1;
  transition: color var(--transition-fast);
  border-radius: var(--border-radius-sm);
}

.modal-close:hover {
  color: var(--color-gray-900);
  background-color: var(--color-gray-100);
}

.modal-body {
  padding: var(--spacing-xl);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-md);
  flex-shrink: 0;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  to {
    transform: scale(1);
  }
}

/* ============================================
   Dropdown
   ============================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 200px;
  margin-top: var(--spacing-xs);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-sm) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu-right {
  left: auto;
  right: 0;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-lg);
  color: var(--color-gray-700);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: var(--font-size-base);
}

.dropdown-item:hover {
  background-color: var(--color-gray-50);
  color: var(--color-gray-900);
  text-decoration: none;
}

.dropdown-item:active {
  background-color: var(--color-gray-100);
}

.dropdown-divider {
  height: 0;
  margin: var(--spacing-sm) 0;
  border-top: var(--border-width) solid var(--border-color);
}

.dropdown-header {
  padding: var(--spacing-xs) var(--spacing-lg);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  color: var(--color-gray-600);
  letter-spacing: 0.05em;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-lg) 0;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 var(--spacing-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-item:hover:not(.active):not(:disabled) {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-300);
  color: var(--color-gray-900);
  text-decoration: none;
}

.pagination-item.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.pagination-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  list-style: none;
  padding: var(--spacing-md) 0;
  font-size: var(--font-size-sm);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-gray-600);
}

.breadcrumb-item a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--color-gray-900);
  font-weight: var(--font-weight-medium);
}

.breadcrumb-separator {
  color: var(--color-gray-400);
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--spacing-xl);
}

.tab-list {
  display: flex;
  gap: var(--spacing-sm);
  list-style: none;
}

.tab-item {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-600);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

.tab-item:hover {
  color: var(--color-gray-900);
  text-decoration: none;
}

.tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   Loading States
   ============================================ */
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.spinner-lg {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 4px;
}

.spinner-white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-white);
}

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

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-200) 25%,
    var(--color-gray-100) 50%,
    var(--color-gray-200) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--border-radius-md);
}

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

.skeleton-text {
  height: 1rem;
  margin-bottom: var(--spacing-sm);
}

.skeleton-title {
  height: 2rem;
  margin-bottom: var(--spacing-md);
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-dropdown);
}

/* ============================================
   Avatars
   ============================================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--color-gray-300);
  color: var(--color-gray-700);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: var(--font-size-sm);
}

.avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: var(--font-size-xl);
}

.avatar-xl {
  width: 5rem;
  height: 5rem;
  font-size: var(--font-size-2xl);
}

.avatar-group {
  display: flex;
  align-items: center;
  padding-left: 0;
}

.avatar-group .avatar {
  margin-left: -0.75rem;
  border: 2px solid var(--color-white);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* ============================================
   Progress Bars
   ============================================ */
.progress {
  height: 0.75rem;
  background-color: var(--color-gray-200);
  border-radius: var(--border-radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--color-primary);
  transition: width var(--transition-slow);
  border-radius: var(--border-radius-full);
}

.progress-bar-success {
  background-color: var(--color-success);
}

.progress-bar-warning {
  background-color: var(--color-warning);
}

.progress-bar-danger {
  background-color: var(--color-danger);
}

.progress-bar-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

.progress-bar-animated {
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

/* ============================================
   Tooltips
   ============================================ */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  background-color: var(--color-gray-900);
  color: var(--color-white);
  text-align: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  position: absolute;
  z-index: var(--z-tooltip);
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--color-gray-900) transparent transparent transparent;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-xl);
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--color-gray-400);
  margin-bottom: var(--spacing-lg);
}

.empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--spacing-sm);
}

.empty-state-message {
  color: var(--color-gray-600);
  margin-bottom: var(--spacing-xl);
}

/* ============================================
   Search Bar
   ============================================ */
.search-bar {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding-left: var(--spacing-2xl);
}

.search-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

/* ============================================
   User Profile Widget
   ============================================ */
.user-profile {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.user-profile:hover {
  background-color: var(--color-gray-100);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-900);
  font-size: var(--font-size-sm);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.user-role {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  line-height: 1;
}

/* ============================================
   Stats / KPI Cards
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-2xl);
}

.stat-card {
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  border: var(--border-width) solid var(--border-color);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-lg);
}

.stat-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
}

.stat-icon.primary {
  background-color: var(--color-primary-lighter);
  color: var(--color-primary);
}

.stat-icon.success {
  background-color: #d1fae5;
  color: var(--color-success);
}

.stat-icon.warning {
  background-color: #fef3c7;
  color: var(--color-warning);
}

.stat-icon.danger {
  background-color: #fee2e2;
  color: var(--color-danger);
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
  line-height: 1;
  margin-bottom: var(--spacing-sm);
}

.stat-change {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.stat-change.positive {
  color: var(--color-success);
}

.stat-change.negative {
  color: var(--color-danger);
}

/* ============================================
   MODERN BUSINESS METRICS SECTION STYLES
   Contemporary Design with Glass Morphism & Animations
   ============================================ */

/* Section Container */
.business-metrics-section {
  margin: 2rem 0 3rem 0;
  position: relative;
}

/* Modern Section Header with Gradient Line */
.kpi-section-header {
  position: relative;
  margin: 3rem 0 2rem 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.kpi-section-header:first-of-type {
  margin-top: 1.5rem;
}

.kpi-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  position: relative;
  animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-section-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(99, 102, 241, 0.3) 0%,
    rgba(168, 85, 247, 0.2) 50%,
    transparent 100%);
  border-radius: 2px;
  animation: expandWidth 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* Modern Stats Grid with Animation */
.modern-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

/* Modern Stat Card - Glass Morphism Design */
.modern-stat-card {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--animation-delay, 0s);
}

.modern-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 20px;
}

.modern-stat-card:hover::before {
  opacity: 1;
}

.modern-stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 1);
}

/* Clickable Card Enhancements */
.modern-stat-card.clickable-card {
  cursor: pointer;
}

.modern-stat-card.clickable-card:active {
  transform: translateY(-4px) scale(0.98);
}

.modern-stat-card.clickable-card:focus {
  outline: none;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.04),
    0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Card Inner Content */
.stat-card-inner {
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* Modern Icon with Gradient Background */
.stat-icon-modern {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.modern-stat-card:hover .stat-icon-modern {
  transform: scale(1.1) rotate(5deg);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Gradient Backgrounds for Icons */
.blue-gradient {
  background: linear-gradient(135deg, #667eea 0%, #4f46e5 100%);
  color: white;
}

.purple-gradient {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  color: white;
}

.green-gradient {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.teal-gradient {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: white;
}

.cyan-gradient {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.emerald-gradient {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
}

.orange-gradient {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  color: white;
}

.violet-gradient {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: white;
}

.amber-gradient {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
}

.sky-gradient {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: white;
}

.lime-gradient {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
}

.pink-gradient {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: white;
}

/* Modern Content Layout */
.stat-content-modern {
  text-align: left;
}

.stat-label-modern {
  font-size: 0.813rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.75rem;
  display: block;
  line-height: 1.2;
}

.stat-number-modern {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1;
  letter-spacing: -0.03em;
  transition: all 0.3s ease;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

.modern-stat-card:hover .stat-number-modern {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Trend Indicators */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.813rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.stat-trend.positive {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
  color: #059669;
}

.stat-trend.negative {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
  color: #dc2626;
}

.stat-trend.neutral {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(71, 85, 105, 0.1) 100%);
  color: #64748b;
}

.stat-trend i {
  font-size: 0.75rem;
}

.modern-stat-card:hover .stat-trend {
  transform: translateX(2px);
}

/* Secondary Text */
.stat-secondary {
  font-size: 0.813rem;
  color: #94a3b8;
  display: block;
  font-weight: 500;
  line-height: 1.4;
}

/* Action Hint - Hidden by Default, Shown on Hover */
.stat-action-hint {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  font-size: 0.813rem;
  font-weight: 600;
  color: #6366f1;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.modern-stat-card:hover .stat-action-hint {
  opacity: 1;
  transform: translateX(0);
}

/* Glow Effect - Background Gradient */
.stat-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
  filter: blur(20px);
}

.modern-stat-card:hover .stat-card-glow {
  opacity: 0.6;
}

.blue-glow { background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(79, 70, 229, 0.4)); }
.purple-glow { background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(124, 58, 237, 0.4)); }
.green-glow { background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.4)); }
.teal-glow { background: linear-gradient(135deg, rgba(20, 184, 166, 0.4), rgba(13, 148, 136, 0.4)); }
.cyan-glow { background: linear-gradient(135deg, rgba(6, 182, 212, 0.4), rgba(8, 145, 178, 0.4)); }
.emerald-glow { background: linear-gradient(135deg, rgba(52, 211, 153, 0.4), rgba(16, 185, 129, 0.4)); }
.orange-glow { background: linear-gradient(135deg, rgba(251, 146, 60, 0.4), rgba(249, 115, 22, 0.4)); }
.violet-glow { background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(109, 40, 217, 0.4)); }
.amber-glow { background: linear-gradient(135deg, rgba(251, 191, 36, 0.4), rgba(245, 158, 11, 0.4)); }
.sky-glow { background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(14, 165, 233, 0.4)); }
.lime-glow { background: linear-gradient(135deg, rgba(132, 204, 22, 0.4), rgba(101, 163, 13, 0.4)); }
.pink-glow { background: linear-gradient(135deg, rgba(236, 72, 153, 0.4), rgba(219, 39, 119, 0.4)); }

/* Ripple Effect on Click */
.modern-stat-card.clickable-card {
  overflow: hidden;
}

.modern-stat-card.clickable-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.modern-stat-card.clickable-card:active::after {
  width: 300px;
  height: 300px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes expandWidth {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .modern-stat-card,
  .kpi-section-title,
  .kpi-section-line,
  .stat-icon-modern,
  .stat-number-modern,
  .stat-trend,
  .stat-action-hint {
    animation: none !important;
    transition: none !important;
  }

  .modern-stat-card:hover {
    transform: none;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .modern-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card-inner {
    padding: 1.5rem;
  }

  .stat-number-modern {
    font-size: 2.5rem;
  }

  .stat-icon-modern {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .stat-action-hint {
    display: none;
  }
}

/* Legacy Compatibility - Keep old classes for backwards compatibility */
.stat-content {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0.5rem 0;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0.5rem 0 0.25rem 0;
}

.stat-description {
  font-size: 0.75rem;
  color: #718096;
  display: block;
  margin-top: 0.25rem;
}

.stat-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem auto;
  font-size: 1.5rem;
  transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon-wrapper {
  transform: scale(1.1);
}

.stat-icon-wrapper.blue { background-color: #e6f2ff; color: #2563eb; }
.stat-icon-wrapper.purple { background-color: #f3e8ff; color: #8b5cf6; }
.stat-icon-wrapper.green { background-color: #d1fae5; color: #059669; }
.stat-icon-wrapper.success { background-color: #d1fae5; color: #047857; }
.stat-icon-wrapper.info { background-color: #dbeafe; color: #0284c7; }
.stat-icon-wrapper.warning { background-color: #fed7aa; color: #ea580c; }
.stat-icon-wrapper.orange { background-color: #ffedd5; color: #f97316; }

.stat-card.clickable-card {
  cursor: pointer;
  position: relative;
}

.stat-card.clickable-card:focus {
  outline: none;
}

/* ============================================
   Timeline
   ============================================ */
.timeline {
  position: relative;
  padding: var(--spacing-lg) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-left: 3.5rem;
  padding-bottom: var(--spacing-xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--color-white);
  border: 3px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: var(--font-size-lg);
}

.timeline-content {
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.timeline-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin: 0;
}

.timeline-date {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}

.timeline-body {
  color: var(--color-gray-700);
  font-size: var(--font-size-sm);
}

/* ============================================
   Utility Classes
   ============================================ */
/* Display */
.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-inline {
  display: inline !important;
}

.d-inline-block {
  display: inline-block !important;
}

.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

/* Text Alignment */
.text-left {
  text-align: left !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

/* Text Colors */
.text-primary {
  color: var(--color-primary) !important;
}

.text-secondary {
  color: var(--color-secondary) !important;
}

.text-success {
  color: var(--color-success) !important;
}

.text-danger {
  color: var(--color-danger) !important;
}

.text-warning {
  color: var(--color-warning) !important;
}

.text-info {
  color: var(--color-info) !important;
}

.text-muted {
  color: var(--color-gray-600) !important;
}

/* Font Weights */
.fw-normal {
  font-weight: var(--font-weight-normal) !important;
}

.fw-medium {
  font-weight: var(--font-weight-medium) !important;
}

.fw-semibold {
  font-weight: var(--font-weight-semibold) !important;
}

.fw-bold {
  font-weight: var(--font-weight-bold) !important;
}

/* Margins */
.m-0 {
  margin: 0 !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-sm {
  margin-bottom: var(--spacing-sm) !important;
}

.mb-md {
  margin-bottom: var(--spacing-md) !important;
}

.mb-lg {
  margin-bottom: var(--spacing-lg) !important;
}

.mb-xl {
  margin-bottom: var(--spacing-xl) !important;
}

/* Padding */
.p-0 {
  padding: 0 !important;
}

/* Background Colors */
.bg-primary {
  background-color: var(--color-primary) !important;
}

.bg-white {
  background-color: var(--color-white) !important;
}

.bg-gray {
  background-color: var(--color-gray-100) !important;
}

/* Border Radius */
.rounded {
  border-radius: var(--border-radius-md) !important;
}

.rounded-lg {
  border-radius: var(--border-radius-lg) !important;
}

.rounded-full {
  border-radius: var(--border-radius-full) !important;
}

/* Shadow */
.shadow-none {
  box-shadow: none !important;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
  box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* Width */
.w-100 {
  width: 100% !important;
}

.w-auto {
  width: auto !important;
}

/* ============================================
   Responsive Design
   ============================================ */
/* Tablet */
@media (max-width: 1024px) {
  .content-wrapper {
    padding: var(--spacing-xl);
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
  }

  .main-content {
    margin-left: 0;
  }

  .main-content.sidebar-collapsed {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: block;
  }

  .content-wrapper {
    padding: var(--spacing-lg);
  }

  .header {
    padding: 0 var(--spacing-lg);
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-6 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .card-body {
    padding: var(--spacing-lg);
  }

  .table-container {
    overflow-x: auto;
  }

  .modal {
    max-width: 100%;
    margin: var(--spacing-md);
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
    border-radius: var(--border-radius-md) !important;
  }

  .stats-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  /* Hide text in mobile nav */
  .header-title {
    font-size: var(--font-size-lg);
  }

  /* Stack form groups on mobile */
  .form-group {
    width: 100%;
  }

  /* Adjust metric cards for mobile */
  .metric-value {
    font-size: var(--font-size-2xl);
  }

  .metric-icon {
    font-size: var(--font-size-2xl);
  }

  /* Make pagination responsive */
  .pagination {
    flex-wrap: wrap;
  }

  /* Adjust table for mobile */
  .table {
    font-size: var(--font-size-xs);
  }

  .table th,
  .table td {
    padding: var(--spacing-sm);
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .header-right > *:not(:last-child):not(.user-profile) {
    display: none;
  }

  .user-info {
    display: none;
  }

  .modal {
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .header,
  .btn,
  .dropdown,
  .menu-toggle {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .card {
    box-shadow: none;
    border: var(--border-width) solid var(--color-gray-300);
    page-break-inside: avoid;
  }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode */
  /*
  :root {
    --color-gray-50: #1f2937;
    --color-gray-100: #111827;
    --color-white: #1f2937;
    --color-gray-900: #f9fafb;
  }
  */
}

/* ============================================
   Animation Classes
   ============================================ */
.fade-in {
  animation: fadeIn var(--transition-base) ease-in;
}

.slide-in {
  animation: slideIn var(--transition-base) ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-400) var(--color-gray-100);
}

/* ============================================
   Organizations - Modern Card Grid View
   ============================================ */
.organizations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-xl);
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.organizations-header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.organizations-header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.organizations-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
  margin: 0;
}

/* View Toggle Controls */
.view-toggle-group {
  display: inline-flex;
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-white);
  border: none;
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-right: var(--border-width) solid var(--border-color);
}

.view-toggle-btn:last-child {
  border-right: none;
}

.view-toggle-btn:hover:not(.active) {
  background-color: var(--color-gray-50);
  color: var(--color-gray-900);
}

.view-toggle-btn.active {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.view-toggle-btn svg {
  flex-shrink: 0;
}

/* Organizations Grid Layout */
.organizations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

/* Organization Card */
.org-card {
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

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

.org-card-header {
  padding: var(--spacing-lg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-md);
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-white) 100%);
  border-bottom: var(--border-width) solid var(--border-color);
}

.org-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.org-card-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.org-card-menu-btn {
  background: none;
  border: none;
  color: var(--color-gray-600);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.org-card-menu-btn:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-900);
}

.org-card-body {
  padding: var(--spacing-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.org-card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin: 0;
  line-height: var(--line-height-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.org-card-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.org-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background-color: var(--color-primary-lighter);
  color: var(--color-primary-dark);
  border-radius: var(--border-radius-full);
  white-space: nowrap;
}

.org-location {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  white-space: nowrap;
}

.org-card-description {
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  line-height: var(--line-height-relaxed);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.org-card-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: var(--border-width) solid var(--border-color);
  background-color: var(--color-gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
}

.org-card-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex: 1;
}

.org-card-stats a {
  color: var(--color-gray-600);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
}

.org-card-stats a:hover {
  color: var(--color-primary);
  background-color: var(--color-white);
  text-decoration: none;
}

.org-card-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Icon Buttons for Cards */
.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-size-base);
}

.btn-icon-sm:hover {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-300);
  color: var(--color-gray-900);
  transform: translateY(-1px);
}

.btn-icon-danger {
  color: var(--color-danger);
}

.btn-icon-danger:hover {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--color-white);
}

/* Organization Level Badges */
.org-level-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--border-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.org-level-badge.level-platinum {
  background-color: #e0e7ff;
  color: #4338ca;
}

.org-level-badge.level-gold {
  background-color: #fef3c7;
  color: #92400e;
}

.org-level-badge.level-silver {
  background-color: #f3f4f6;
  color: #4b5563;
}

.org-level-badge.level-bronze {
  background-color: #fef2f2;
  color: #991b1b;
}

/* Organizations List View (Alternative to Grid) */
.organizations-list-view {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.org-list-item {
  background-color: var(--color-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  transition: all var(--transition-base);
}

.org-list-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-gray-300);
}

.org-list-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.org-list-content {
  flex: 1;
  min-width: 0;
}

.org-list-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  flex-wrap: wrap;
}

.org-list-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin: 0;
}

.org-list-description {
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  line-height: var(--line-height-normal);
  margin: var(--spacing-xs) 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.org-list-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-sm);
}

.org-list-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

/* Responsive Adjustments for Organizations */
@media (max-width: 1024px) {
  .organizations-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .organizations-header {
    flex-direction: column;
    align-items: stretch;
  }

  .organizations-header-left,
  .organizations-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .organizations-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .org-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .org-list-avatar {
    align-self: flex-start;
  }

  .org-list-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .org-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
  }

  .org-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .organizations-title {
    font-size: var(--font-size-xl);
  }

  .view-toggle-group {
    width: 100%;
    justify-content: stretch;
  }

  .view-toggle-btn {
    flex: 1;
  }

  .org-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .org-card-menu {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Modal visibility when active */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  padding: var(--spacing-lg);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-base) forwards;
}

.modal.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.modal.active .modal-container {
  position: relative;
  z-index: 1;
  animation: modalSlideIn var(--transition-base) forwards;
}

.modal-container {
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-2xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
}

/* ============================================================================
   MODERN DASHBOARD STYLES
   ============================================================================ */

/* Dashboard Header */
.dashboard-header {
  padding: 2rem 0;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dashboard-title-section {
  flex: 1;
}

.dashboard-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.dashboard-subtitle {
  font-size: 1rem;
  color: #718096;
  margin: 0;
}

.dashboard-actions {
  display: flex;
  gap: 1rem;
}

.btn-modern {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-modern-primary {
  background: linear-gradient(135deg, #dcd6f7 0%, #e8dff5 100%);
  color: #6b5b95;
  border: 1px solid #d0c4ed;
}

.btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(184, 181, 255, 0.25);
  background: linear-gradient(135deg, #d4c5f9 0%, #e0d5f3 100%);
}

/* Modern Metrics Grid */
.modern-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.modern-metric-card {
  position: relative;
  border-radius: 1rem;
  padding: 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-metric-card.clickable-card {
  cursor: pointer;
  user-select: none;
}

.modern-metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.modern-metric-card.clickable-card:active {
  transform: translateY(-2px);
}

.modern-metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  opacity: 0.95;
  z-index: 0;
}

.metric-card-inner {
  position: relative;
  z-index: 1;
}

.gradient-purple {
  background: linear-gradient(135deg, #f0ecff 0%, #f5f0ff 100%);
  color: #6b5b95;
  border: 1px solid #e0d5f3;
}

.gradient-blue {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 100%);
  color: #4a7ba7;
  border: 1px solid #d1e7f5;
}

.gradient-green {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  color: #4a7c59;
  border: 1px solid #d1f4e0;
}

.gradient-orange {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbf0 100%);
  color: #92693f;
  border: 1px solid #f5e6d3;
}

.gradient-teal {
  background: linear-gradient(135deg, #f0fdfa 0%, #f0fdf8 100%);
  color: #0f766e;
  border: 1px solid #d1f4ed;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.metric-icon-wrapper {
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.metric-trend {
  background: rgba(255, 255, 255, 0.6);
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.metric-trend.positive {
  background: rgba(167, 243, 208, 0.4);
  color: #2f855a;
}

.metric-trend.negative {
  background: rgba(252, 211, 211, 0.4);
  color: #c53030;
}

.metric-content {
  /* Color inherited from parent gradient classes */
}

.metric-label {
  font-size: 0.875rem;
  opacity: 0.8;
  margin: 0 0 0.5rem 0;
  font-weight: 500;
}

.metric-number {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  line-height: 1;
}

.metric-description {
  font-size: 0.875rem;
  opacity: 0.7;
  margin: 0;
}

/* Quick Actions Section */
.quick-actions-modern {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 1.5rem 0;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.quick-action-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.quick-action-card:hover {
  border-color: #d0c4ed;
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(184, 181, 255, 0.2);
  background: #fafafe;
}

.quick-action-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.quick-action-icon.purple {
  background: linear-gradient(135deg, #f0ecff 0%, #f5f0ff 100%);
  color: #6b5b95;
  border: 1px solid #e0d5f3;
}

.quick-action-icon.blue {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 100%);
  color: #4a7ba7;
  border: 1px solid #d1e7f5;
}

.quick-action-icon.green {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  color: #4a7c59;
  border: 1px solid #d1f4e0;
}

.quick-action-icon.orange {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbf0 100%);
  color: #92693f;
  border: 1px solid #f5e6d3;
}

.quick-action-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0;
}

.quick-action-card p {
  font-size: 0.875rem;
  color: #718096;
  margin: 0;
}

/* Date Preset Buttons */
.date-preset-btn {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.date-preset-btn i {
  font-size: 12px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.date-preset-btn:hover {
  border-color: #6b5b95;
  color: #6b5b95;
  background: #f8f7fc;
}

.date-preset-btn:hover i {
  color: #6b5b95;
}

.date-preset-btn.active {
  background: linear-gradient(135deg, #6b5b95 0%, #8b7bb5 100%);
  color: #fff;
  border-color: #6b5b95;
  box-shadow: 0 2px 8px rgba(107, 91, 149, 0.3);
}

.date-preset-btn.active i {
  color: #fff;
}

/* Dashboard Content Grid */
.dashboard-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Modern Panel */
.modern-panel {
  background: var(--color-white);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 1px solid var(--color-gray-200); /* view26 Brand: Neutral-300 */
}

.modern-panel-header {
  padding: 1.5rem;
  background: var(--color-gray-50); /* view26 Brand: Neutral-25 */
  border-bottom: 1px solid var(--color-gray-200); /* view26 Brand: Neutral-300 */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title-section {
  flex: 1;
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-gray-900); /* view26 Brand: Neutral-900 */
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title i {
  color: var(--color-purple-600); /* view26 Brand: Purple-600 */
}

.panel-subtitle {
  font-size: 0.875rem;
  color: var(--color-gray-600); /* view26 Brand: Neutral-600 */
  margin: 0;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--color-purple-600); /* view26 Brand: Purple-600 */
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s ease;
}

.btn-text-link:hover {
  color: var(--color-purple-700); /* view26 Brand: Purple-700 */
}

.modern-panel-body {
  padding: 1.5rem;
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item-modern {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-gray-50); /* view26 Brand: Neutral-25 */
  border-radius: 0.75rem;
  border-left: 3px solid var(--color-gray-200); /* view26 Brand: Neutral-300 */
  transition: all 0.2s ease;
}

.activity-item-modern:hover {
  background: var(--color-white);
  border-left-color: var(--color-purple-400); /* view26 Brand: Purple-400 */
}

.activity-icon-modern {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.activity-icon-modern.success {
  background: var(--color-green-100); /* view26 Brand: Green-100 */
  color: var(--color-green-900); /* view26 Brand: Green-900 */
  border: 1px solid var(--color-green-200); /* view26 Brand: Green-200 */
}

.activity-icon-modern.info {
  background: var(--color-blue-100); /* view26 Brand: Blue-100 */
  color: var(--color-blue-900); /* view26 Brand: Blue-900 */
  border: 1px solid var(--color-blue-200); /* view26 Brand: Blue-200 */
}

.activity-icon-modern.warning {
  background: var(--color-yellow-100); /* view26 Brand: Yellow-100 */
  color: var(--color-yellow-900); /* view26 Brand: Yellow-900 */
  border: 1px solid var(--color-yellow-200); /* view26 Brand: Yellow-200 */
}

.activity-details {
  flex: 1;
}

.activity-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 0.25rem 0;
}

.activity-description {
  font-size: 0.875rem;
  color: #4a5568;
  margin: 0 0 0.5rem 0;
}

.activity-time {
  font-size: 0.75rem;
  color: #a0aec0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Task Feed */
.tasks-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-item-modern {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  align-items: flex-start;
}

.task-item-modern:hover {
  background: #edf2f7;
}

.task-checkbox-wrapper {
  position: relative;
  min-width: 1.25rem;
}

.modern-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #cbd5e0;
  border-radius: 0.375rem;
  cursor: pointer;
  appearance: none;
  transition: all 0.2s ease;
  position: relative;
}

.modern-checkbox:checked {
  background: linear-gradient(135deg, #dcd6f7 0%, #e8dff5 100%);
  border-color: #d0c4ed;
}

.modern-checkbox:checked {
  background: #d0c4ed;
  border-color: #b8acdb;
}

.modern-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #6b5b95;
  font-size: 0.875rem;
  font-weight: bold;
}

.checkbox-label {
  display: none;
}

.task-details {
  flex: 1;
}

.task-title-modern {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 0.5rem 0;
}

.task-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.task-priority {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.task-priority.high {
  background: #fee;
  color: #c53030;
}

.task-priority.medium {
  background: #fffbeb;
  color: #d69e2e;
}

.task-priority.low {
  background: #e6fffa;
  color: #319795;
}

.task-due-modern {
  font-size: 0.75rem;
  color: #718096;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
  }

  .dashboard-title {
    font-size: 1.5rem;
  }

  .modern-metrics-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-number {
    font-size: 2rem;
  }
}

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

/* Task Priority Badge Updates */
.task-priority {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.task-priority.high {
  background: #fff0f0;
  color: #c53030;
  border: 1px solid #fcd0d0;
}

.task-priority.medium {
  background: #fffbeb;
  color: #d69e2e;
  border: 1px solid #fce9b8;
}

.task-priority.low {
  background: #e6f7ff;
  color: #3182ce;
  border: 1px solid #b8dff5;
}

/* ============================================================================
   QUICK ADD DROPDOWN
   ============================================================================ */

.quick-add-dropdown {
  position: absolute;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  min-width: 280px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.quick-add-dropdown.show {
  opacity: 1;
  transform: translateY(0);
}

.quick-add-dropdown-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f7fafc;
}

.quick-add-dropdown-item:last-child {
  border-bottom: none;
}

.quick-add-dropdown-item:hover {
  background: #f7fafc;
}

.dropdown-item-icon {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.dropdown-item-icon.purple {
  background: linear-gradient(135deg, #f0ecff 0%, #f5f0ff 100%);
  color: #6b5b95;
  border: 1px solid #e0d5f3;
}

.dropdown-item-icon.blue {
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 100%);
  color: #4a7ba7;
  border: 1px solid #d1e7f5;
}

.dropdown-item-icon.green {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  color: #4a7c59;
  border: 1px solid #d1f4e0;
}

.dropdown-item-icon.orange {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbf0 100%);
  color: #92693f;
  border: 1px solid #f5e6d3;
}

.dropdown-item-content {
  flex: 1;
}

.dropdown-item-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 0.125rem 0;
}

.dropdown-item-content p {
  font-size: 0.8125rem;
  color: #718096;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .quick-add-dropdown {
    left: 1rem !important;
    right: 1rem !important;
    min-width: auto;
  }
}

/* ============================================================================
   SIDEBAR LOGO IMAGE
   ============================================================================ */

.logo-image {
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Adjust logo container */
.sidebar-header .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Responsive logo sizing */
@media (max-width: 1200px) {
  .logo-image {
    max-width: 140px;
  }
}

@media (max-width: 768px) {
  .logo-image {
    max-width: 120px;
  }
}

/* Remove padding from sidebar header */
.sidebar-header {
  padding: 0 !important;
}

.sidebar-header .logo {
  padding: 0 !important;
  margin: 0;
}

/* ============================================================================
   MODERN PAGE HEADERS (Organizations, Contacts, Deals, Tasks)
   ============================================================================ */

.page-header {
  padding: 2rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 2rem;
}

.page-header-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.page-icon-wrapper {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.page-header-text {
  flex: 1;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.025em;
}

.page-subtitle {
  font-size: 1rem;
  color: #718096;
  margin: 0;
}

.page-header-actions {
  display: flex;
  gap: 1rem;
}

.page-content {
  padding-bottom: 2rem;
}

/* Modern grid for Organizations and Contacts */
.organizations-grid,
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Empty state */
.empty-state-message {
  text-align: center;
  padding: 4rem 2rem;
  color: #a0aec0;
}

.empty-state-message i {
  font-size: 4rem;
  color: #e2e8f0;
  margin-bottom: 1.5rem;
  display: block;
}

.empty-state-message h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #4a5568;
  margin: 0 0 0.5rem 0;
}

.empty-state-message p {
  font-size: 1rem;
  color: #a0aec0;
  margin: 0;
}

/* Responsive page headers */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .page-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-icon-wrapper {
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .page-subtitle {
    font-size: 0.9375rem;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions .btn-modern {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   MODERN DATA TABLES
   ============================================================================ */

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.data-table thead {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.data-table thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

.data-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

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

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

.data-table tbody td {
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  color: #2d3748;
}

.data-table tbody td.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.data-table .btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: white;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.2s ease;
}

.data-table .btn-sm:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

.data-table .btn-sm.btn-danger {
  color: #c53030;
  border-color: #fc8181;
}

.data-table .btn-sm.btn-danger:hover {
  background: #fff5f5;
  border-color: #fc8181;
}

/* Badge styling for tables */
.badge {
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-high {
  background: #fff0f0;
  color: #c53030;
  border: 1px solid #fcd0d0;
}

.badge-medium {
  background: #fffbeb;
  color: #d69e2e;
  border: 1px solid #fce9b8;
}

.badge-low {
  background: #e6f7ff;
  color: #3182ce;
  border: 1px solid #b8dff5;
}

.badge-pending {
  background: #fffbeb;
  color: #d69e2e;
  border: 1px solid #fce9b8;
}

.badge-in-progress,
.badge-in_progress {
  background: #e6f7ff;
  color: #3182ce;
  border: 1px solid #b8dff5;
}

.badge-completed {
  background: #e6fffa;
  color: #319795;
  border: 1px solid #b8ede7;
}

.badge-prospecting,
.badge-qualification {
  background: #f0ecff;
  color: #6b5b95;
  border: 1px solid #e0d5f3;
}

.badge-proposal,
.badge-negotiation {
  background: #e8f4fd;
  color: #4a7ba7;
  border: 1px solid #d1e7f5;
}

.badge-closed-won,
.badge-won {
  background: #f0fdf4;
  color: #4a7c59;
  border: 1px solid #d1f4e0;
}

.badge-closed-lost,
.badge-lost {
  background: #fff0f0;
  color: #c53030;
  border: 1px solid #fcd0d0;
}

/* Task overdue styling */
.task-overdue {
  background: #fff5f5 !important;
}

.task-overdue:hover {
  background: #fed7d7 !important;
}

/* ============================================================================
   TABLE AVATARS AND BADGES
   ============================================================================ */

.table-avatar {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #f0ecff 0%, #f5f0ff 100%);
  color: #6b5b95;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid #e0d5f3;
}

/* Level badges */
.badge-level-platinum,
.badge-level-global {
  background: linear-gradient(135deg, #f0ecff 0%, #f5f0ff 100%);
  color: #6b5b95;
  border: 1px solid #e0d5f3;
}

.badge-level-gold,
.badge-level-regional {
  background: #fffbeb;
  color: #d69e2e;
  border: 1px solid #fce9b8;
}

.badge-level-silver,
.badge-level-national {
  background: #f7fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
}

.badge-level-bronze,
.badge-level-local {
  background: #fff7ed;
  color: #92693f;
  border: 1px solid #f5e6d3;
}

/* Type badges */
.badge-technology,
.badge-tech {
  background: #e8f4fd;
  color: #4a7ba7;
  border: 1px solid #d1e7f5;
}

.badge-finance,
.badge-financial {
  background: #f0fdf4;
  color: #4a7c59;
  border: 1px solid #d1f4e0;
}

/* Partner Type badges */
.badge-marketplace,
.badge-marketplace-partner {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.badge-solution,
.badge-solution-partner {
  background: #bee3f8;
  color: #2c5282;
  border: 1px solid #90cdf4;
}

.badge-customer {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

.badge-community {
  background: #e9d8fd;
  color: #553c9a;
  border: 1px solid #d6bcfa;
}

.badge-creator {
  background: #fed7e2;
  color: #97266d;
  border: 1px solid #fbb6ce;
}

.badge-other {
  background: #e2e8f0;
  color: #2d3748;
  border: 1px solid #cbd5e0;
}

.badge-healthcare,
.badge-medical {
  background: #fff0f0;
  color: #c53030;
  border: 1px solid #fcd0d0;
}

.badge-retail,
.badge-commerce {
  background: #fff7ed;
  color: #92693f;
  border: 1px solid #f5e6d3;
}

.badge-manufacturing,
.badge-industrial {
  background: #f0ecff;
  color: #6b5b95;
  border: 1px solid #e0d5f3;
}

.badge-other,
.badge-default {
  background: #f7fafc;
  color: #718096;
  border: 1px solid #e2e8f0;
}

/* ============================================================================
   INLINE FORMS
   ============================================================================ */

.inline-form-container {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.inline-form-header {
  padding: 2rem;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: white;
  border: 1px solid #cbd5e0;
  border-radius: 0.5rem;
  color: #4a5568;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: #f7fafc;
  border-color: #a0aec0;
  color: #2d3748;
  transform: translateX(-2px);
}

.btn-back i {
  font-size: 1rem;
}

.inline-form-title-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.inline-form-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.inline-form-subtitle {
  font-size: 0.875rem;
  color: #718096;
  margin: 0.25rem 0 0 0;
}

.inline-form-actions-header {
  display: flex;
  gap: 0.75rem;
}

.inline-form-body {
  padding: 2rem;
}

/* Entity Details Grid */
.entity-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.detail-card {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.detail-card:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.detail-card.full-width {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin-bottom: 0.5rem;
}

.detail-value {
  font-size: 1rem;
  font-weight: 500;
  color: #2d3748;
  line-height: 1.5;
  word-wrap: break-word;
}

.detail-value a {
  color: #4a7ba7;
  text-decoration: none;
  transition: color 0.2s ease;
}

.detail-value a:hover {
  color: #2c5282;
  text-decoration: underline;
}

/* Form styling within inline container */
.inline-form-body form {
  max-width: 100%;
}

.inline-form-body .form-group {
  margin-bottom: 1.5rem;
}

.inline-form-body .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.inline-form-body .form-input,
.inline-form-body .form-select,
.inline-form-body select,
.inline-form-body input[type="text"],
.inline-form-body input[type="email"],
.inline-form-body input[type="url"],
.inline-form-body input[type="tel"],
.inline-form-body input[type="number"],
.inline-form-body input[type="date"],
.inline-form-body input[type="datetime-local"],
.inline-form-body textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  color: #2d3748;
  background: white;
  transition: all 0.2s ease;
}

.inline-form-body .form-input:focus,
.inline-form-body .form-select:focus,
.inline-form-body select:focus,
.inline-form-body input:focus,
.inline-form-body textarea:focus {
  outline: none;
  border-color: #6b5b95;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

.inline-form-body textarea {
  min-height: 100px;
  resize: vertical;
}

.inline-form-body .form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}

.inline-form-body .btn-primary,
.inline-form-body button[type="submit"] {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #6b5b95 0%, #7a6ba5 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inline-form-body .btn-primary:hover,
.inline-form-body button[type="submit"]:hover {
  background: linear-gradient(135deg, #5a4a85 0%, #6b5b95 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.inline-form-body .btn-secondary,
.inline-form-body .modal-close {
  padding: 0.75rem 2rem;
  background: white;
  color: #4a5568;
  border: 1px solid #cbd5e0;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inline-form-body .btn-secondary:hover,
.inline-form-body .modal-close:hover {
  background: #f7fafc;
  border-color: #a0aec0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .inline-form-header {
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-form-title-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-form-body {
    padding: 1.5rem;
  }

  .entity-details-grid {
    grid-template-columns: 1fr;
  }

  .inline-form-actions-header {
    width: 100%;
    justify-content: flex-start;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }
}

/* ============================================================================
   TABLE FILTERS
   ============================================================================ */

.filterable-table {
  table-layout: fixed;
  width: 100%;
}

.filterable-table .filter-row {
  background: linear-gradient(135deg, #fafbfc 0%, #f3f4f6 100%);
  border-bottom: 2px solid #e2e8f0;
}

.filterable-table .filter-row th {
  padding: 0.75rem 1rem;
  vertical-align: top;
  position: relative;
}

.filterable-table th,
.filterable-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #2d3748;
  background: white;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #6b5b95;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

.filter-input::placeholder {
  color: #a0aec0;
  font-size: 0.8125rem;
}

.filter-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem 1.25rem;
  padding-right: 2rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.filter-select:hover {
  border-color: #a0aec0;
}

/* No results message */
.no-results-row td {
  background: linear-gradient(135deg, #fafbfc 0%, #f9fafb 100%);
}

/* Filter row responsive */
@media (max-width: 1024px) {
  .filter-input,
  .filter-select {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }

  .filterable-table .filter-row th {
    padding: 0.5rem 0.75rem;
  }

  .filter-select {
    padding-right: 1.75rem;
    background-size: 1rem 1rem;
  }
}

@media (max-width: 768px) {
  .filterable-table .filter-row {
    display: none;
  }
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #fafbfc 0%, #f3f4f6 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.pagination-container:last-child {
  margin-bottom: 0;
  margin-top: 1rem;
}

.pagination-info {
  font-size: 0.875rem;
  color: #4a5568;
}

.pagination-info strong {
  color: #2d3748;
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e0;
  background: white;
  color: #4a5568;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  background: #f7fafc;
  border-color: #a0aec0;
  color: #2d3748;
}

.pagination-btn.active {
  background: linear-gradient(135deg, #6b5b95 0%, #7a6ba5 100%);
  color: white;
  border-color: #6b5b95;
  font-weight: 600;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 0.25rem;
  color: #a0aec0;
  font-weight: 600;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .pagination-info {
    text-align: center;
    width: 100%;
  }

  .pagination-controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .pagination-btn {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.8125rem;
  }
}

/* ============================================================================
   PARTNER DETAIL VIEW WITH TABS
   ============================================================================ */

.partner-detail-view {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.partner-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-bottom: 2px solid #e9ecef;
}

.partner-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.partner-name {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #2d3748;
}

.partner-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  color: #718096;
}

.partner-header-actions {
  display: flex;
  gap: 0.75rem;
}

.partner-tabs {
  display: flex;
  gap: 0;
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  overflow-x: auto;
  padding: 0 1rem;
}

.partner-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.partner-tab i {
  font-size: 1.125rem;
}

.partner-tab:hover {
  color: #6b5b95;
  background: rgba(107, 91, 149, 0.05);
}

.partner-tab.active {
  color: #6b5b95;
  border-bottom-color: #6b5b95;
  background: white;
}

.partner-tab-content {
  padding: 2rem;
  min-height: 400px;
}

.partner-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
}

.partner-section-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
}

.partner-section-table {
  margin-top: 1rem;
}

.partner-section-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Communication Cards */
.communication-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.communication-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e0;
}

.communication-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.communication-date {
  font-size: 0.875rem;
  color: #718096;
}

.communication-subject {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #2d3748;
}

.communication-content {
  margin: 0 0 1rem;
  color: #4a5568;
  line-height: 1.6;
}

.communication-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

/* Note Cards */
.note-card {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.note-card:hover {
  box-shadow: 0 4px 6px rgba(245, 158, 11, 0.1);
}

.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.note-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #78350f;
}

.note-date {
  font-size: 0.875rem;
  color: #92400e;
}

.note-content {
  margin: 0 0 0.5rem;
  color: #78350f;
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-author {
  margin: 0;
  font-size: 0.875rem;
  color: #92400e;
  font-style: italic;
}

.note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #fbbf24;
}

/* Responsive Design */
@media (max-width: 768px) {
  .partner-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .partner-tabs {
    flex-wrap: wrap;
  }

  .partner-tab {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .partner-tab-content {
    padding: 1rem;
  }

  .partner-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ============================================================================
   SINGLE PANE OF GLASS - PARTNER DETAIL VIEW  
   ============================================================================ */

.partner-single-pane-view {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.partner-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #6b5b95 0%, #7a6ba5 100%);
  color: white;
  flex-shrink: 0;
}

.btn-back-compact,
.btn-edit-compact {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-back-compact:hover,
.btn-edit-compact:hover {
  background: rgba(255, 255, 255, 0.3);
}

.partner-compact-title {
  flex: 1;
  text-align: center;
}

.partner-compact-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: inline;
}

.partner-type-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.partner-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.625rem;
  padding: 0.625rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.partner-section {
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.partner-details-section {
  grid-column: 1 / -1;
  min-height: auto;
  overflow: visible;
  background: #ffffff;
  border: 1px solid #cbd5e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0 !important;
  margin-bottom: 0;
}

.partner-details-section .details-grid-improved {
  max-height: none;
}

.section-mini-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: #2d3748;
  flex-shrink: 0;
}

.section-mini-header i {
  color: #6b5b95;
  font-size: 0.875rem;
}

.count-badge {
  background: #e2e8f0;
  color: #64748b;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.btn-mini {
  background: #6b5b95;
  border: none;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.6875rem;
  margin-left: auto;
  transition: all 0.2s ease;
}

.btn-mini:hover {
  background: #7a6ba5;
}

.details-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.detail-item {
  font-size: 0.75rem;
  color: #4a5568;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-label-sm {
  font-weight: 600;
  color: #2d3748;
}

.compact-list {
  flex: 1;
  overflow-y: auto;
  min-height: 9.5rem;
  max-height: 9.5rem;
}

.compact-list-item {
  padding: 0.3125rem 0.4375rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 0.3125rem;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.compact-list-item:hover {
  border-color: #cbd5e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.compact-name {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-detail {
  font-size: 0.6875rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-list-item-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.compact-list-item-content {
  flex: 1;
  min-width: 0;
}

.compact-list-item-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.btn-icon-action {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}

.btn-icon-action:hover {
  background: #f1f5f9;
  color: #6b5b95;
}

.btn-icon-action.btn-icon-danger:hover {
  background: #fee;
  color: #dc2626;
}

.empty-compact {
  padding: 0.75rem;
  text-align: center;
  color: #a0aec0;
  font-size: 0.6875rem;
  font-style: italic;
}

.badge-sm {
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.badge-xs {
  padding: 0.0625rem 0.375rem;
  border-radius: 8px;
  font-size: 0.625rem;
  font-weight: 600;
  margin-right: 0.25rem;
}

/* Badge Colors */
.badge-platinum { background: #e5e7eb; color: #374151; }
.badge-gold { background: #fef3c7; color: #92400e; }
.badge-silver { background: #f3f4f6; color: #4b5563; }
.badge-bronze { background: #fed7aa; color: #7c2d12; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-trial { background: #dbeafe; color: #1e40af; }
.badge-email { background: #dbeafe; color: #1e40af; }
.badge-call { background: #d1fae5; color: #065f46; }
.badge-meeting { background: #fef3c7; color: #92400e; }
.badge-note { background: #e5e7eb; color: #374151; }
.badge-low { background: #d1fae5; color: #065f46; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-high { background: #fed7aa; color: #7c2d12; }
.badge-urgent { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #dbeafe; color: #1e40af; }
.badge-in_progress { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }

/* Responsive Adjustments */
@media (max-width: 1400px) {
  .partner-grid-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .partner-grid-container {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  
  .partner-single-pane-view {
    height: auto;
  }
}

/* Custom Scrollbar for Compact Lists */
.compact-list::-webkit-scrollbar {
  width: 4px;
}

.compact-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.compact-list::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 2px;
}

.compact-list::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* ============================================================================
   IMPROVED PARTNER DETAIL VIEW STYLES
   ============================================================================ */

/* Improved Header */
.partner-detail-header-improved {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  flex-shrink: 0;
  gap: 1rem;
}

.partner-header-left,
.partner-header-right {
  flex: 0 0 auto;
}

.partner-header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.btn-back-improved,
.btn-edit-improved {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #ffffff;
  color: #2d3748;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-back-improved:hover {
  background: #f7fafc;
  border-color: #a0aec0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-edit-improved {
  background: #6b5b95;
  color: #ffffff;
  border-color: #6b5b95;
}

.btn-edit-improved:hover {
  background: #7a6ba5;
  border-color: #7a6ba5;
  box-shadow: 0 2px 6px rgba(107, 91, 149, 0.3);
}

.partner-name-large {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.partner-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.partner-type-badge-improved,
.partner-industry-badge,
.partner-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.625rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.partner-type-badge-improved {
  background: linear-gradient(135deg, #6b5b95 0%, #7a6ba5 100%);
  color: #ffffff;
}

.partner-type-badge-improved.badge-marketplace,
.partner-type-badge-improved.badge-marketplace-partner {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.partner-type-badge-improved.badge-solution,
.partner-type-badge-improved.badge-solution-partner {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.partner-type-badge-improved.badge-customer {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.partner-type-badge-improved.badge-community {
  background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.partner-type-badge-improved.badge-creator {
  background: linear-gradient(135deg, #f687b3 0%, #d53f8c 100%);
}

.partner-type-badge-improved.badge-other {
  background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

.partner-industry-badge {
  background: #edf2f7;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}

.partner-location-badge {
  background: #e6fffa;
  color: #2c7a7b;
  border: 1px solid #81e6d9;
}

/* Improved Section Headers */
.section-header-improved {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin: -0.625rem -0.625rem 0.5rem -0.625rem;
  background: linear-gradient(to right, #f7fafc, #ffffff);
  border-bottom: 2px solid #6b5b95;
  flex-shrink: 0;
}

.partner-details-section .section-header-improved {
  background: linear-gradient(to right, #edf2f7, #ffffff);
  border-bottom: 3px solid #6b5b95;
  margin-bottom: 0;
}

.section-title-with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #2d3748;
}

.section-title-with-icon i {
  color: #6b5b95;
  font-size: 0.9375rem;
}

.section-title-with-icon strong {
  font-weight: 700;
  color: #1a202c;
}

.count-badge-improved {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3125rem;
  background: #6b5b95;
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.btn-add-improved {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: #6b5b95;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(107, 91, 149, 0.2);
}

.btn-add-improved:hover {
  background: #7a6ba5;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(107, 91, 149, 0.3);
}

.btn-add-improved i {
  font-size: 0.875rem;
}

/* Improved Details Grid */
.details-grid-improved {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem 1rem;
  padding: 0.75rem;
  background: #ffffff;
}

.detail-item-improved {
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.detail-item-full {
  grid-column: 1 / -1;
  padding-top: 0.375rem;
}

.detail-label-improved {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-value-improved {
  font-size: 0.8125rem;
  color: #1a202c;
  word-wrap: break-word;
  font-weight: 500;
}

.detail-description {
  line-height: 1.6;
  white-space: pre-wrap;
  font-size: 0.8125rem;
  color: #4a5568;
  font-weight: 400;
}

.text-muted {
  color: #a0aec0;
  font-style: italic;
  font-size: 0.75rem;
}

.link-primary {
  color: #3182ce;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-primary:hover {
  color: #2c5282;
  text-decoration: underline;
}

.link-primary i {
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

/* Badge Styles */
.badge-type,
.badge-level {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-type.badge-marketplace,
.badge-type.badge-marketplace-partner {
  background: #c6f6d5;
  color: #22543d;
}

.badge-type.badge-solution,
.badge-type.badge-solution-partner {
  background: #bee3f8;
  color: #2c5282;
}

.badge-type.badge-customer {
  background: #fed7d7;
  color: #742a2a;
}

.badge-type.badge-community {
  background: #e9d8fd;
  color: #553c9a;
}

.badge-type.badge-creator {
  background: #fed7e2;
  color: #97266d;
}

.badge-type.badge-other {
  background: #e2e8f0;
  color: #2d3748;
}

.badge-level.badge-platinum {
  background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
  color: #1a202c;
  font-weight: 600;
}

.badge-level.badge-gold {
  background: linear-gradient(135deg, #fbd38d 0%, #f6ad55 100%);
  color: #7c2d12;
  font-weight: 600;
}

.badge-level.badge-silver {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
  color: #2d3748;
  font-weight: 600;
}

.badge-level.badge-bronze {
  background: linear-gradient(135deg, #d69e76 0%, #c07850 100%);
  color: #ffffff;
  font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .partner-detail-header-improved {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .partner-header-center {
    flex: 1 1 100%;
    order: -1;
  }

  .partner-name-large {
    font-size: 1.125rem;
  }

  .details-grid-improved {
    grid-template-columns: repeat(2, 1fr);
  }

  .partner-grid-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .partner-detail-header-improved {
    padding: 0.75rem;
  }

  .btn-back-improved span,
  .btn-edit-improved span {
    display: none;
  }

  .partner-name-large {
    font-size: 1rem;
  }

  .partner-meta-row {
    font-size: 0.6875rem;
  }

  .details-grid-improved {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .partner-grid-container {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }
}

/* ============================================================================
   CARD EXPANSION & MODAL STYLES
   ============================================================================ */

/* Expand Button */
.btn-expand-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: #3182ce;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(49, 130, 206, 0.2);
}

.btn-expand-card:hover {
  background: #2c5282;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(49, 130, 206, 0.3);
}

.btn-expand-card i {
  font-size: 0.875rem;
}

/* Add Button */
.btn-add-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: #38a169;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(56, 161, 105, 0.2);
}

.btn-add-card:hover {
  background: #2f855a;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(56, 161, 105, 0.3);
}

.btn-add-card i {
  font-size: 0.875rem;
}

/* Delete Icon Button */
.btn-delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: transparent;
  color: #e53e3e;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-delete-icon:hover {
  background: #fed7d7;
  color: #c53030;
  transform: scale(1.1);
}

.btn-delete-icon i {
  font-size: 0.875rem;
}

/* Searchable Select Dropdown */
.searchable-select-wrapper {
  position: relative;
  width: 100%;
}

.searchable-select-input {
  width: 100%;
  padding: 0.625rem;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background-color: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s;
  cursor: text;
}

.searchable-select-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.searchable-select-input::placeholder {
  color: #a0aec0;
}

.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.searchable-select-options {
  padding: 0.25rem 0;
}

.searchable-select-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid #f7fafc;
}

.searchable-select-option:last-child {
  border-bottom: none;
}

.searchable-select-option:hover {
  background-color: #f7fafc;
}

.searchable-select-option:active {
  background-color: #edf2f7;
}

/* Custom scrollbar for dropdown */
.searchable-select-dropdown::-webkit-scrollbar {
  width: 8px;
}

.searchable-select-dropdown::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 0 6px 6px 0;
}

.searchable-select-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.searchable-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Enrich Button */
.btn-enrich {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.btn-enrich:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-enrich:active:not(:disabled) {
  transform: translateY(0);
}

.btn-enrich:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-enrich i {
  font-size: 1rem;
}

/* Modal Overlay */
.card-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

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

/* Modal Container */
.card-modal-container {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Header */
.card-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid #e2e8f0;
  background: linear-gradient(to right, #f7fafc, #ffffff);
}

.card-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a202c;
}

.card-modal-title i {
  color: #6b5b95;
  font-size: 1.25rem;
}

.card-modal-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  background: #6b5b95;
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.btn-close-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: transparent;
  color: #718096;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: #f7fafc;
  color: #2d3748;
}

.btn-close-modal i {
  font-size: 1.25rem;
}

/* Modal Body */
.card-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.card-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-modal-item {
  padding: 0.875rem 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.card-modal-item:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-modal-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.card-modal-item-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #2d3748;
  flex: 1;
}

.card-modal-item-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.card-modal-item-detail {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.card-modal-item-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-modal-item-value {
  color: #2d3748;
}

/* LinkedIn Icon in Contacts */
.contact-linkedin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: #0077b5;
  color: #ffffff;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.contact-linkedin-icon:hover {
  background: #006399;
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 119, 181, 0.3);
}

.contact-linkedin-icon i {
  font-size: 0.75rem;
}

.compact-list-item-with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compact-list-item-content {
  flex: 1;
  min-width: 0;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .card-modal-overlay {
    padding: 1rem;
  }

  .card-modal-container {
    max-height: 90vh;
  }

  .card-modal-item-details {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   ADD PRODUCT/CUSTOMER MODAL STYLES
   ============================================================================ */

.add-item-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

.add-item-modal-container {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

.add-item-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid #e2e8f0;
  background: linear-gradient(to right, #f7fafc, #ffffff);
}

.add-item-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a202c;
}

.add-item-modal-title i {
  color: #6b5b95;
  font-size: 1.25rem;
}

.add-item-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.add-item-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.add-item-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.add-item-form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3748;
}

.add-item-form-label .required {
  color: #e53e3e;
  margin-left: 0.25rem;
}

.add-item-form-input,
.add-item-form-select,
.add-item-form-textarea {
  padding: 0.625rem 0.875rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #2d3748;
  transition: all 0.2s ease;
}

.add-item-form-input:focus,
.add-item-form-select:focus,
.add-item-form-textarea:focus {
  outline: none;
  border-color: #6b5b95;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

.add-item-form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.add-item-form-select {
  background: #ffffff;
  cursor: pointer;
}

.add-item-form-help {
  font-size: 0.75rem;
  color: #718096;
  margin-top: 0.25rem;
}

/* Search Input with Icon */
.search-input-wrapper {
  position: relative;
}

.search-input-wrapper i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  font-size: 0.875rem;
}

.search-input-wrapper .add-item-form-input {
  padding-left: 2.5rem;
}

/* Product/Customer Dropdown List */
.item-dropdown-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  margin-top: 0.5rem;
  background: #ffffff;
}

.item-dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #e2e8f0;
}

.item-dropdown-item:last-child {
  border-bottom: none;
}

.item-dropdown-item:hover {
  background: #f7fafc;
}

.item-dropdown-item.selected {
  background: #edf2f7;
  border-left: 3px solid #6b5b95;
}

.item-dropdown-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.item-dropdown-item-details {
  font-size: 0.75rem;
  color: #718096;
}

.item-dropdown-empty {
  padding: 1rem;
  text-align: center;
  color: #a0aec0;
  font-size: 0.875rem;
}

/* Selected Item Display */
.selected-item-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: #edf2f7;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.selected-item-info {
  flex: 1;
}

.selected-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.selected-item-detail {
  font-size: 0.75rem;
  color: #718096;
}

.btn-remove-selection {
  background: transparent;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.btn-remove-selection:hover {
  color: #c53030;
}

/* Modal Footer */
.add-item-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #f7fafc;
}

.btn-modal-primary,
.btn-modal-secondary {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-modal-primary {
  background: #6b5b95;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(107, 91, 149, 0.2);
}

.btn-modal-primary:hover:not(:disabled) {
  background: #7a6ba5;
  box-shadow: 0 4px 8px rgba(107, 91, 149, 0.3);
}

.btn-modal-primary:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
}

.btn-modal-secondary {
  background: #ffffff;
  color: #2d3748;
  border: 1px solid #cbd5e0;
}

.btn-modal-secondary:hover {
  background: #f7fafc;
  border-color: #a0aec0;
}

/* Create New Button */
.btn-create-new {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: linear-gradient(to right, #f7fafc, #ffffff);
  border: 2px dashed #cbd5e0;
  border-radius: 6px;
  color: #4a5568;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.btn-create-new:hover {
  background: linear-gradient(to right, #edf2f7, #f7fafc);
  border-color: #6b5b95;
  color: #6b5b95;
}

.btn-create-new i {
  color: #6b5b95;
  font-size: 1rem;
}

/* Label/Tag Input Component */
.label-input-wrapper {
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 2.5rem;
  background: #ffffff;
  cursor: text;
}

.label-input-wrapper:focus-within {
  border-color: #6b5b95;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

.selected-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}

.label-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: linear-gradient(135deg, #6b5b95 0%, #7a6ba5 100%);
  color: #ffffff;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: default;
}

.label-tag-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.label-tag-remove:hover {
  color: #ffffff;
}

.label-input {
  border: none;
  outline: none;
  padding: 0.25rem;
  font-size: 0.875rem;
  min-width: 120px;
  flex: 1;
}

.label-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}

.label-suggestion {
  padding: 0.25rem 0.625rem;
  background: #f7fafc;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.2s ease;
}

.label-suggestion:hover {
  background: #edf2f7;
  border-color: #6b5b95;
  color: #6b5b95;
}

.label-suggestion.predefined {
  background: linear-gradient(to right, #f7fafc, #ffffff);
  border-color: #a0aec0;
  font-weight: 500;
}

.label-suggestion.predefined:hover {
  background: linear-gradient(to right, #edf2f7, #f7fafc);
}

.label-suggestions-title {
  width: 100%;
  font-size: 0.75rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.label-suggestion.hidden {
  display: none;
}

/* Loading State */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
}

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

/* Responsive */
@media (max-width: 640px) {
  .add-item-modal-overlay {
    padding: 1rem;
  }

  .add-item-modal-container {
    max-height: 90vh;
  }

  .add-item-modal-body {
    padding: 1rem;
  }
}

/* Multi-Select Dropdown Filter */
.multi-select-dropdown {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.multi-select-trigger:hover {
  border-color: #6b5b95;
}

.multi-select-trigger.active {
  border-color: #6b5b95;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

.multi-select-label {
  flex: 1;
  color: #4a5568;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select-label.has-selection {
  color: #2d3748;
  font-weight: 500;
}

.multi-select-count {
  background: #6b5b95;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

.multi-select-arrow {
  color: #718096;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.multi-select-trigger.active .multi-select-arrow {
  transform: rotate(180deg);
}

.multi-select-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  min-width: 200px;
  display: none;
  flex-direction: column;
}

.multi-select-dropdown-menu.show {
  display: flex;
}

.multi-select-search {
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.multi-select-search input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.875rem;
  outline: none;
}

.multi-select-search input:focus {
  border-color: #6b5b95;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

.multi-select-options {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: background 0.2s ease;
}

.multi-select-option:hover {
  background: #f7fafc;
}

.multi-select-option input[type="checkbox"] {
  cursor: pointer;
}

.multi-select-option-label {
  flex: 1;
  color: #2d3748;
}

.multi-select-option.checked {
  background: #edf2f7;
}

.multi-select-actions {
  padding: 0.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.multi-select-btn {
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.multi-select-btn-clear {
  background: #f7fafc;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}

.multi-select-btn-clear:hover {
  background: #edf2f7;
}

.multi-select-btn-apply {
  background: #6b5b95;
  color: #ffffff;
  flex: 1;
}

.multi-select-btn-apply:hover {
  background: #7a6ba5;
}

.multi-select-no-results {
  padding: 1rem;
  text-align: center;
  color: #a0aec0;
  font-size: 0.875rem;
  font-style: italic;
}

/* ============================================================================
   SETTINGS PAGE STYLES
   ============================================================================ */

/* Gradient for Settings icon */
.gradient-gray {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  color: #718096;
  border: 1px solid #e2e8f0;
}

/* Settings container */
.settings-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
}

/* Settings card */
.settings-card {
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: var(--border-width) solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.settings-card:hover {
  box-shadow: var(--shadow-md);
}

/* Settings card header */
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
  border-bottom: 1px solid #e2e8f0;
}

/* Settings icon wrapper */
.settings-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #f0ecff 0%, #f5f0ff 100%);
  color: #6b5b95;
  box-shadow: 0 2px 8px rgba(107, 91, 149, 0.15);
  flex-shrink: 0;
}

/* Settings card title */
.settings-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-800);
  margin: 0 0 0.25rem 0;
}

/* Settings card description */
.settings-card-description {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin: 0;
}

/* Settings card body */
.settings-card-body {
  padding: 1.5rem;
}

/* Manual Refresh button */
.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #6b5b95 0%, #7a6ba5 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(107, 91, 149, 0.25);
}

.btn-refresh:hover:not(:disabled) {
  background: linear-gradient(135deg, #7a6ba5 0%, #8b7cb5 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 91, 149, 0.35);
}

.btn-refresh:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(107, 91, 149, 0.25);
}

.btn-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-refresh i {
  font-size: 1rem;
}

.btn-refresh .fa-spin {
  animation: fa-spin 1s infinite linear;
}

/* Settings hint text */
.settings-hint {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--color-gray-500);
  margin-bottom: 0;
}

/* Info rows */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-row:first-child {
  padding-top: 0;
}

/* Info labels */
.info-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
}

/* Info values */
.info-value {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  font-weight: 400;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .settings-container {
    padding: 0;
  }

  .settings-card-header {
    padding: 1rem;
  }

  .settings-card-body {
    padding: 1rem;
  }

  .settings-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .settings-card-title {
    font-size: 1rem;
  }

  .settings-card-description {
    font-size: 0.8125rem;
  }

  .btn-refresh {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   TRANSACTIONS TAB STYLES
   ============================================================================ */

.transactions-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.transactions-header {
    margin-bottom: 2rem;
}

.transactions-header h2 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.transactions-header p {
    color: #666;
    font-size: 1rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: #2563eb;
    margin: 0;
    font-weight: 700;
}

.stat-card p {
    color: #666;
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sync-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1.5rem;
    align-items: end;
    margin: 2rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.sync-controls .form-group {
    margin-bottom: 0;
}

.sync-controls label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.sync-controls .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.sync-progress {
    margin: 2rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #2563eb;
}

.sync-progress h3 {
    margin-top: 0;
    color: #1a1a1a;
    font-size: 1.25rem;
}

.progress-bar {
    width: 100%;
    height: 32px;
    background: #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

#progressMessage {
    color: #555;
    font-size: 1rem;
    margin: 0;
}

.sync-logs {
    margin: 2rem 0;
}

.sync-logs h3 {
    color: #1a1a1a;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.log-viewer {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 12px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.log-entry {
    padding: 0.35rem 0;
    border-left: 3px solid transparent;
    padding-left: 0.5rem;
    margin-left: -0.5rem;
}

.log-info {
    color: #4fc3f7;
}

.log-warning {
    color: #ffb74d;
    border-left-color: #ffb74d;
}

.log-error {
    color: #f44336;
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.log-success {
    color: #66bb6a;
    border-left-color: #66bb6a;
}

/* Scrollbar styling for log viewer */
.log-viewer::-webkit-scrollbar {
    width: 8px;
}

.log-viewer::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.log-viewer::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.log-viewer::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Responsive design */
@media (max-width: 768px) {
    .sync-controls {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .transactions-container {
        padding: 1rem;
    }
}

/* ============================================
   Finance Collapsible Submenu Styles
   ============================================ */

/* Parent nav item with submenu */
.nav-item-parent {
  position: relative;
}

.nav-link-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

/* Chevron icon */
.nav-chevron {
  font-size: 0.75rem;
  transition: transform var(--transition-base);
  margin-left: auto;
}

.nav-item-parent.expanded .nav-chevron {
  transform: rotate(180deg);
}

/* Submenu container */
.nav-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base) ease-in-out;
  background-color: rgba(0, 0, 0, 0.2);
}

.nav-item-parent.expanded .nav-submenu {
  max-height: 200px;
}

/* Child nav items */
.nav-item-child {
  margin-bottom: 0;
}

.nav-link-child {
  padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-3xl);
  font-size: var(--font-size-sm);
}

.nav-link-child:hover {
  background-color: rgba(16, 114, 252, 0.12); /* view26 Brand: Subtle blue-600 tint */
}

.nav-link-child.active {
  background-color: rgba(16, 114, 252, 0.25); /* view26 Brand: Blue-600 with transparency */
}

.nav-link-child.active::before {
  left: var(--spacing-lg);
}

/* ============================================
   Finance Overview - Modern Filter Styles
   ============================================ */

/* Main filter container */
.finance-filters-container {
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F6F8 100%);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(30, 30, 30, 0.08);
  border: 1px solid #DEE1E6;
}

/* Filter header */
.finance-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #DEE1E6;
}

.filters-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #1E1E1E;
}

.filters-title i {
  color: #004BEC;
  font-size: 18px;
}

/* Reset button */
.btn-reset-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #BEC2CC;
  border-radius: 6px;
  color: #4F545C;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-filters:hover {
  background: #F5F6F8;
  border-color: #8C9199;
  color: #1E1E1E;
}

.btn-reset-filters i {
  font-size: 12px;
}

/* Filters grid */
.finance-filters-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .finance-filters-grid {
    grid-template-columns: 1fr;
  }
}

/* Individual filter group */
.filter-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Filter labels with icons */
.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #4F545C;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-label i {
  color: #004BEC;
  font-size: 14px;
}

/* Date range specific styling */
.date-range-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.date-separator {
  color: #8C9199;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

/* Enhanced form inputs for filters */
.finance-filters-container .form-input,
.finance-filters-container .form-select {
  border: 1.5px solid #DEE1E6;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #1E1E1E;
  background: #FFFFFF;
  transition: all 0.2s ease;
}

.finance-filters-container .form-input:focus,
.finance-filters-container .form-select:focus {
  outline: none;
  border-color: #004BEC;
  box-shadow: 0 0 0 3px rgba(0, 75, 236, 0.1);
}

.finance-filters-container .form-input:hover,
.finance-filters-container .form-select:hover {
  border-color: #8C9199;
}

/* Filter actions */
.finance-filters-actions {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.btn-apply-filters {
  min-width: 200px;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 75, 236, 0.25);
  transition: all 0.3s ease;
}

.btn-apply-filters:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 75, 236, 0.35);
}

.btn-apply-filters:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 75, 236, 0.2);
}

.btn-apply-filters i {
  font-size: 15px;
}

/* ============================================
   Revenue Source Toggle Buttons
   ============================================ */

.revenue-source-toggles {
  display: flex;
  gap: 8px;
  align-items: center;
}

.revenue-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #F5F6F8;
  border: 1.5px solid #DEE1E6;
  border-radius: 20px;
  color: #4F545C;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.revenue-toggle:hover {
  background: #DEE1E6;
  border-color: #BEC2CC;
}

.revenue-toggle.active {
  background: #004BEC;
  border-color: #004BEC;
  color: white;
}

.toggle-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #BEC2CC;
  transition: all 0.2s ease;
}

.revenue-toggle.active .toggle-indicator {
  background: #FFFFFF;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.toggle-label {
  user-select: none;
}

/* Color variations for different sources */
.revenue-toggle[data-source="atlassian"].active {
  background: linear-gradient(135deg, #004BEC, #2C78F0);
  border-color: #004BEC;
}

.revenue-toggle[data-source="consulting"].active {
  background: linear-gradient(135deg, #237085, #2E8CA8);
  border-color: #237085;
}

.revenue-toggle[data-source="other"].active {
  background: linear-gradient(135deg, #6B51B9, #896EE2);
  border-color: #6B51B9;
}

/* ============================================
   Date Range Preset Buttons
   ============================================ */

.date-range-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.date-preset-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .date-preset-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

.date-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: #FFFFFF;
  border: 1.5px solid #DEE1E6;
  border-radius: 8px;
  color: #4F545C;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.date-preset-btn:hover {
  background: #F5F6F8;
  border-color: #BEC2CC;
  color: #1E1E1E;
}

.date-preset-btn.active {
  background: linear-gradient(135deg, #004BEC, #2C78F0);
  border-color: #004BEC;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 75, 236, 0.25);
}

.date-preset-btn i {
  font-size: 16px;
  opacity: 0.7;
}

.date-preset-btn.active i {
  opacity: 1;
}

.date-preset-btn span {
  font-size: 11px;
  white-space: nowrap;
}

/* Additional date range input styling */
#customDateRange {
  animation: slideDown 0.3s ease;
}

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

/* ========== Finance Overview Redesign ========== */

@keyframes skeletonPulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.chart-skeleton {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-radius: 8px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    width: 100%;
    height: 100%;
}

.chart-loading-container {
    position: relative;
}

.chart-loading-container.is-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* KPI Summary Cards */
.kpi-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

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

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

.kpi-card {
    background: #ffffff;
    border: 1px solid #DEE1E6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.kpi-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.kpi-card-icon.blue { background: linear-gradient(135deg, #005BCC, #1072FC); }
.kpi-card-icon.green { background: linear-gradient(135deg, #287B1E, #72A55B); }
.kpi-card-icon.purple { background: linear-gradient(135deg, #5E40B2, #8D70CB); }
.kpi-card-icon.teal { background: linear-gradient(135deg, #288B00, #42B2A7); }

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

.kpi-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 4px;
}

.kpi-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a202c;
    line-height: 1.2;
    margin-bottom: 4px;
}

.kpi-card-trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-card-trend.positive { color: #287B1E; }
.kpi-card-trend.negative { color: #D93742; }
.kpi-card-trend.neutral { color: #64748b; }

.kpi-card-skeleton .kpi-card-value,
.kpi-card-skeleton .kpi-card-trend {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-radius: 4px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    color: transparent;
}

.kpi-card-skeleton .kpi-card-value {
    width: 120px;
    height: 28px;
}

.kpi-card-skeleton .kpi-card-trend {
    width: 80px;
    height: 16px;
}

/* Empty States */
.chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #94a3b8;
    gap: 12px;
}

.chart-empty-state i {
    font-size: 2.5rem;
    opacity: 0.5;
}

.chart-empty-state span {
    font-size: 14px;
    font-weight: 500;
}

/* Compact Filters */
.finance-filters-container.compact {
    padding: 16px;
}

.finance-filters-container.compact .finance-filters-grid {
    gap: 16px;
}

.finance-filters-container .filters-active-badge {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1072FC;
    display: none;
    margin-left: 6px;
}

.finance-filters-container.has-active-filters .filters-active-badge {
    display: inline-block;
}

.finance-filters-container.has-active-filters .btn-reset-filters {
    color: #1072FC;
    border-color: #1072FC;
}

/* Dynamic panel subtitle */
.panel-subtitle-dynamic {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    margin-top: 2px;
}
