/**
 * PREMIUM SIDEBAR THEME - Macula Design System
 *
 * A refined enterprise layout with collapsible sidebar navigation.
 * Based on MACULA-DESIGN-GUIDE.md specifications.
 * Typography: Inter (as per design guide)
 */

/* ============================================
   FONT IMPORTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   CSS VARIABLES - MACULA DESIGN SYSTEM
   Based on MACULA-DESIGN-GUIDE.md
   ============================================ */
:root {
  /* ========== MACULA BRAND COLORS (from Design Guide) ========== */
  --macula-main: #333333;
  --macula-bg: #FFFFFF;
  --macula-primary: #45BDD6;
  --macula-secondary: #674EA7;

  /* Derived Brand Colors (from Design Guide) */
  --macula-primary-dark: #3AA5BD;
  --macula-secondary-dark: #5A4491;
  --macula-gray-light: #F8F9FA;
  --macula-gray: #6C757D;
  --macula-gray-dark: #495057;

  /* R4S Legacy Variables (for backward compatibility) */
  --r4s-teal: #45BDD6;
  --r4s-teal-light: #6DD0E3;
  --r4s-teal-dark: #3AA5BD;
  --r4s-purple: #674EA7;
  --r4s-purple-dark: #5A4491;
  --r4s-purple-light: #8872C2;
  --r4s-main: #333333;
  --r4s-main-dark: #1A1A1A;
  --r4s-main-light: #4A4A4A;

  /* Gradients (from Design Guide) */
  --macula-gradient-primary: linear-gradient(135deg, #45BDD6 0%, #3AA5BD 100%);
  --macula-gradient-secondary: linear-gradient(135deg, #674EA7 0%, #5A4491 100%);
  --macula-gradient-dark: linear-gradient(135deg, #333333 0%, #1A1A1A 100%);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --header-height: 64px;

  /* Core Colors - Using Brand */
  --pe-bg-base: var(--macula-gray-light);
  --pe-bg-surface: var(--macula-bg);
  --pe-bg-elevated: #f1f3f5;
  --pe-bg-hover: #e9ecef;

  /* Sidebar Colors - Premium Dark with Brand Accent */
  --sidebar-bg: #1A1A1A;
  --sidebar-hover: var(--macula-main);
  --sidebar-active: #4a4a4a;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-text: rgba(255, 255, 255, 0.75);
  --sidebar-text-active: #ffffff;
  --sidebar-section: rgba(255, 255, 255, 0.45);

  /* Brand Colors - Primary = Purple (for buttons/accents) */
  --pe-primary: var(--macula-secondary);
  --pe-primary-light: #8872C2;
  --pe-primary-dark: var(--macula-secondary-dark);
  --pe-primary-subtle: #f3f0f9;

  /* Accent - Secondary (Purple) */
  --pe-accent: var(--macula-secondary);
  --pe-accent-light: #8872C2;
  --pe-accent-dark: var(--macula-secondary-dark);
  --pe-accent-subtle: #f3f0f9;

  /* Status Colors (from Design Guide) */
  --pe-success: #28A745;
  --pe-success-bg: #ecfdf5;
  --pe-warning: #FFC107;
  --pe-warning-bg: #fffbeb;
  --pe-error: #DC3545;
  --pe-error-bg: #fef2f2;
  --pe-info: var(--macula-primary);
  --pe-info-bg: #e8f7fa;

  /* Text Colors - Using Main Brand */
  --pe-text-primary: var(--macula-main);
  --pe-text-secondary: var(--macula-gray-dark);
  --pe-text-muted: var(--macula-gray);

  /* Borders */
  --pe-border-light: #E5E7EB;
  --pe-border-default: #D1D5DB;

  /* Typography (from Design Guide) */
  --pe-font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --pe-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Shadows (from Design Guide) */
  --pe-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --pe-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --pe-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --pe-shadow-primary: 0 4px 15px rgba(103, 78, 167, 0.3);

  /* Spacing (from Design Guide) */
  --pe-radius-sm: 4px;
  --pe-radius-md: 8px;
  --pe-radius-lg: 12px;
  --pe-radius-pill: 50px;

  /* Transitions */
  --pe-transition: 0.3s ease;
}

/* ============================================
   GLOBAL RESETS
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--pe-font-body);
  background: var(--pe-bg-base);
  color: var(--pe-text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--pe-font-display);
  font-weight: 700;
  color: var(--pe-text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

/* Allow text color classes to override heading colors */
.text-white h1, .text-white h2, .text-white h3,
.text-white h4, .text-white h5, .text-white h6,
.text-white { color: inherit; }

.card-header.bg-primary h5,
.card-header.bg-secondary h5,
.card-header.bg-info h5,
.card-header.bg-success h5,
.card-header.bg-warning h5,
.card-header.bg-danger h5,
.card-header.bg-dark h5 {
  color: #fff;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width var(--pe-transition), transform var(--pe-transition);
  overflow: hidden;
}

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

/* Sidebar Brand */
.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--pe-radius-sm);
}

.sidebar-brand-text {
  font-family: var(--pe-font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  transition: opacity var(--pe-transition);
}

.sidebar.collapsed .sidebar-brand-text {
  opacity: 0;
  width: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  display: block;
  font-family: var(--pe-font-display);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-section);
  padding: 0 12px;
  margin-bottom: 8px;
  white-space: nowrap;
  transition: opacity var(--pe-transition);
}

.sidebar.collapsed .nav-section-title {
  opacity: 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--pe-radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--pe-transition);
  margin-bottom: 4px;
  position: relative;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  transition: transform var(--pe-transition);
}

.sidebar-nav .nav-link span {
  white-space: nowrap;
  transition: opacity var(--pe-transition);
}

.sidebar.collapsed .sidebar-nav .nav-link span {
  opacity: 0;
  width: 0;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link:hover i {
  transform: scale(1.1);
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, var(--r4s-purple-dark) 0%, var(--r4s-purple) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(103, 78, 167, 0.4);
}

.sidebar-nav .nav-link.active i {
  color: #fff;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--pe-radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--pe-transition);
  margin-bottom: 4px;
}

.sidebar-footer .nav-link i {
  font-size: 1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer .nav-link span {
  white-space: nowrap;
  transition: opacity var(--pe-transition);
}

.sidebar.collapsed .sidebar-footer .nav-link span {
  opacity: 0;
}

.sidebar-footer .nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

/* Sidebar Scrollbar */
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: 2px;
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--pe-transition);
}

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

/* ============================================
   TOP HEADER
   ============================================ */
.top-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--pe-bg-surface);
  border-bottom: 1px solid var(--pe-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--pe-shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pe-bg-elevated);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-md);
  color: var(--pe-text-secondary);
  cursor: pointer;
  transition: all var(--pe-transition);
}

.sidebar-toggle:hover {
  background: var(--pe-accent-subtle);
  color: var(--r4s-purple);
  border-color: var(--r4s-purple);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Customer Selector */
.customer-selector .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--pe-bg-elevated);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-md);
  color: var(--pe-text-secondary);
  font-family: var(--pe-font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--pe-transition);
}

.customer-selector .dropdown-toggle:hover {
  background: var(--pe-bg-hover);
  border-color: var(--pe-border-default);
}

.customer-selector .dropdown-toggle::after {
  display: none;
}

.customer-selector .fa-chevron-down {
  font-size: 0.7rem;
  opacity: 0.6;
}

.customer-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User Menu */
.user-menu .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--pe-text-primary);
  font-family: var(--pe-font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--pe-transition);
  border-radius: var(--pe-radius-md);
}

.user-menu .dropdown-toggle:hover {
  background: var(--pe-bg-elevated);
}

.user-menu .dropdown-toggle::after {
  display: none;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--r4s-teal) 0%, var(--r4s-purple) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
}

/* Dropdown Menus */
.dropdown-menu {
  background: var(--pe-bg-surface);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-md);
  box-shadow: var(--pe-shadow-lg);
  padding: 8px;
  margin-top: 8px;
  min-width: 200px;
}

.dropdown-item {
  font-family: var(--pe-font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--pe-radius-sm);
  color: var(--pe-text-secondary);
  transition: all var(--pe-transition);
}

.dropdown-item:hover {
  background: var(--pe-primary-subtle);
  color: var(--pe-primary);
}

.dropdown-item.active {
  background: var(--pe-primary);
  color: #fff;
}

.dropdown-item i {
  color: var(--pe-text-muted);
  width: 20px;
}

.dropdown-item:hover i {
  color: var(--pe-primary);
}

.dropdown-divider {
  border-color: var(--pe-border-light);
  margin: 6px 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  padding: 24px;
}

.main-content .container {
  max-width: 1400px;
  padding: 0;
}

/* Alerts Container */
.alerts-container {
  padding: 16px 24px 0;
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
  background: var(--pe-bg-surface);
  border-top: 1px solid var(--pe-border-light);
  padding: 16px 24px;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--pe-text-muted);
}

.footer-content a {
  color: var(--pe-primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-content a:hover {
  color: var(--pe-primary-dark);
}

/* ============================================
   CARDS - Dashboard Style
   ============================================ */
.card {
  background: var(--pe-bg-surface);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-lg);
  box-shadow: var(--pe-shadow-sm);
  transition: all var(--pe-transition);
  overflow: hidden;
}

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

.card-header {
  background: var(--pe-bg-elevated);
  border-bottom: 1px solid var(--pe-border-light);
  padding: 16px 20px;
  font-family: var(--pe-font-display);
}

.card-header h5 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header.bg-primary {
  background: linear-gradient(135deg, var(--r4s-teal-dark) 0%, var(--r4s-teal) 100%);
  color: #fff;
  border-bottom: none;
}

.card-header.bg-secondary {
  background: linear-gradient(135deg, var(--r4s-main-dark) 0%, var(--r4s-main) 100%);
  color: #fff;
  border-bottom: none;
}

.card-header.bg-info {
  background: linear-gradient(135deg, var(--r4s-teal-dark) 0%, var(--r4s-teal-light) 100%);
  color: #fff;
  border-bottom: none;
}

.card-header.bg-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  border-bottom: none;
}

.card-header.bg-purple,
.card-header.bg-accent {
  background: linear-gradient(135deg, var(--r4s-purple-dark) 0%, var(--r4s-purple) 100%);
  color: #fff;
  border-bottom: none;
}

.card-body {
  padding: 20px;
}

/* Stat Cards */
.clickable-stat {
  cursor: pointer;
  transition: all var(--pe-transition);
  border-radius: var(--pe-radius-lg);
}

.card.clickable-stat {
  border: none;
  position: relative;
  overflow: hidden;
}

.card.bg-primary.clickable-stat { background: linear-gradient(135deg, var(--r4s-teal-dark) 0%, var(--r4s-teal) 100%); }
.card.bg-info.clickable-stat { background: linear-gradient(135deg, var(--r4s-teal) 0%, var(--r4s-teal-light) 100%); }
.card.bg-success.clickable-stat { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }
.card.bg-warning.clickable-stat { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.card.bg-secondary.clickable-stat { background: linear-gradient(135deg, var(--r4s-main-dark) 0%, var(--r4s-main) 100%); }
.card.bg-dark.clickable-stat { background: linear-gradient(135deg, var(--r4s-main-dark) 0%, var(--r4s-main-light) 100%); }
.card.bg-purple.clickable-stat { background: linear-gradient(135deg, var(--r4s-purple-dark) 0%, var(--r4s-purple) 100%); }

.card.clickable-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.card.clickable-stat:hover::before {
  left: 100%;
}

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

.card.clickable-stat .card-body {
  padding: 24px;
  position: relative;
  z-index: 1;
}

.card.clickable-stat i {
  font-size: 2rem;
  opacity: 0.9;
}

.card.clickable-stat h3 {
  font-family: var(--pe-font-display);
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0;
  color: #fff;
}

.card.clickable-stat small {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Inner stat cards */
.card-body .clickable-stat {
  background: var(--pe-bg-elevated);
  border-radius: var(--pe-radius-md);
  padding: 16px;
}

.card-body .clickable-stat:hover {
  background: var(--pe-bg-hover);
  transform: translateY(-2px);
}

.card-body .clickable-stat h4 {
  font-family: var(--pe-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  margin: 8px 0;
}

.card-body .clickable-stat small {
  color: var(--pe-text-muted);
  font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-family: var(--pe-font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--pe-radius-md);
  transition: all var(--pe-transition);
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--r4s-purple);
  color: #fff;
}

.btn-primary:hover {
  background: var(--r4s-purple-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(103, 78, 167, 0.35);
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--r4s-purple);
  color: var(--r4s-purple);
}

.btn-outline-primary:hover {
  background: var(--r4s-purple);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline-info { border-color: #0891b2; color: #0891b2; }
.btn-outline-info:hover { background: #0891b2; color: #fff; }

.btn-outline-success { border-color: var(--pe-success); color: var(--pe-success); }
.btn-outline-success:hover { background: var(--pe-success); color: #fff; }

.btn-outline-warning { border-color: var(--pe-warning); color: var(--pe-warning); }
.btn-outline-warning:hover { background: var(--pe-warning); color: #fff; }

.btn-outline-secondary { border-color: var(--pe-text-muted); color: var(--pe-text-secondary); }
.btn-outline-secondary:hover { background: var(--pe-text-secondary); color: #fff; }

.btn-outline-danger { border-color: var(--pe-error); color: var(--pe-error); }
.btn-outline-danger:hover { background: var(--pe-error); color: #fff; }

/* Make outline buttons more visually distinct without hover */
.btn-outline-primary,
.btn-outline-info,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-secondary,
.btn-outline-danger {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-outline-primary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.btn i { margin-right: 8px; }

/* Code blocks with bg-light should have dark readable text */
.bg-light,
.bg-light code,
.bg-light pre,
pre.bg-light,
code.bg-light {
  color: var(--pe-text-primary) !important;
  background-color: #f8f9fa !important;
}

pre code,
.pre-scrollable code {
  color: #1e293b !important;
}

/* Ensure pre-scrollable blocks have proper styling */
.pre-scrollable {
  max-height: 300px;
  overflow-y: auto;
  background: #f8f9fa;
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-md);
}

.pre-scrollable code {
  color: #1e293b;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* JSON Display with Syntax Highlighting */
.json-display {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--pe-radius-md);
  padding: 1rem;
  max-height: 400px;
  overflow: auto;
  margin: 0;
}

.json-display code {
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

/* JSON Syntax Highlighting */
.json-key {
  color: #7dd3fc;
  font-weight: 500;
}

.json-string {
  color: #86efac;
}

.json-number {
  color: #fbbf24;
}

.json-boolean {
  color: #f472b6;
  font-weight: 600;
}

/* Text selection in JSON display */
.json-display ::selection,
.json-display code::selection,
.json-display .json-key::selection,
.json-display .json-string::selection,
.json-display .json-number::selection,
.json-display .json-boolean::selection {
  background: #7c3aed;
  color: #ffffff;
}

.json-display ::-moz-selection,
.json-display code::-moz-selection,
.json-display .json-key::-moz-selection,
.json-display .json-string::-moz-selection,
.json-display .json-number::-moz-selection,
.json-display .json-boolean::-moz-selection {
  background: #7c3aed;
  color: #ffffff;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  font-family: var(--pe-font-body);
  border: none;
  border-radius: var(--pe-radius-md);
  padding: 16px 20px;
  border-left: 4px solid;
}

.alert-success { background: var(--pe-success-bg); color: #065f46; border-left-color: var(--pe-success); }
.alert-danger { background: var(--pe-error-bg); color: #991b1b; border-left-color: var(--pe-error); }
.alert-warning { background: var(--pe-warning-bg); color: #92400e; border-left-color: var(--pe-warning); }
.alert-info { background: var(--pe-info-bg); color: #1e40af; border-left-color: var(--pe-info); }

/* ============================================
   TABLES
   ============================================ */
.table {
  font-family: var(--pe-font-body);
}

.table thead th {
  font-family: var(--pe-font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pe-text-muted);
  background: var(--pe-bg-elevated);
  border-bottom: 2px solid var(--pe-border-light);
  padding: 14px;
}

.table tbody td {
  padding: 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--pe-border-light);
}

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

/* ============================================
   FORMS
   ============================================ */
.form-control,
.form-select {
  font-family: var(--pe-font-body);
  border: 2px solid var(--pe-border-light);
  border-radius: var(--pe-radius-md);
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all var(--pe-transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--pe-primary);
  box-shadow: 0 0 0 4px rgba(103, 78, 167, 0.1);
  outline: none;
}

.form-label {
  font-family: var(--pe-font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--pe-text-secondary);
  margin-bottom: 8px;
}

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

::-webkit-scrollbar-track {
  background: var(--pe-bg-elevated);
}

::-webkit-scrollbar-thumb {
  background: var(--pe-border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pe-text-muted);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.main-content {
  animation: fadeIn 0.3s ease-out;
}

.card {
  animation: slideUp 0.4s ease-out both;
}

.row .col-lg-2:nth-child(1) .card { animation-delay: 0.05s; }
.row .col-lg-2:nth-child(2) .card { animation-delay: 0.1s; }
.row .col-lg-2:nth-child(3) .card { animation-delay: 0.15s; }
.row .col-lg-2:nth-child(4) .card { animation-delay: 0.2s; }
.row .col-lg-2:nth-child(5) .card { animation-delay: 0.25s; }
.row .col-lg-2:nth-child(6) .card { animation-delay: 0.3s; }
.row .col-lg-2:nth-child(7) .card { animation-delay: 0.35s; }

/* ============================================
   STATUS COLORS
   ============================================ */
.text-success { color: var(--pe-success) !important; }
.text-danger { color: var(--pe-error) !important; }
.text-warning { color: #b45309 !important; } /* Darker amber for better contrast */
.text-info { color: #0369a1 !important; } /* Darker blue for better contrast */
.text-primary { color: var(--pe-primary) !important; }
.text-secondary { color: var(--pe-text-secondary) !important; }
.text-muted { color: var(--pe-text-muted) !important; }

/* ============================================
   LIST PAGE STANDARDS
   ============================================ */

/* Standard list page container */
.list-page {
  margin-top: 1.5rem;
}

/* Page title - centered */
.list-page-title {
  text-align: center;
  margin-bottom: 1.5rem;
  font-family: var(--pe-font-display);
  font-weight: 700;
  color: var(--pe-text-primary);
}

/* Action buttons row - space between back and create buttons */
.list-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.list-actions-left,
.list-actions-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Filter card - minimal style without header */
.filter-card {
  background: var(--pe-bg-surface);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-lg) !important;
  margin-bottom: 1rem;
  overflow: hidden;
}

.filter-card .card-body {
  padding: 1rem 1.25rem;
}

/* All cards in list pages should be rounded */
.list-page .card {
  border-radius: var(--pe-radius-lg) !important;
  overflow: hidden;
  border: 1px solid var(--pe-border-light);
}

/* Standard table styling - rounded, modern look */
.list-table {
  margin-bottom: 0;
}

.list-table thead th {
  font-family: var(--pe-font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--pe-text-secondary);
  background: var(--pe-bg-elevated);
  border-bottom: 1px solid var(--pe-border-light);
  padding: 1rem;
  white-space: nowrap;
}

.list-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--pe-border-light);
}

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

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

/* Card with table - rounded corners on card */
.card-table {
  border-radius: var(--pe-radius-lg);
  overflow: hidden;
}

.card-table .card-body {
  padding: 0;
}

.card-table .table-responsive {
  border-radius: var(--pe-radius-lg);
  overflow: hidden;
}

/* Action buttons in tables - icon only */
.action-buttons {
  display: flex;
  gap: 0.25rem;
}

.action-buttons .btn {
  padding: 0.375rem 0.5rem;
  line-height: 1;
}

.action-buttons .btn i {
  margin: 0;
}

/* Progress bar standard sizes */
.progress-sm {
  height: 6px;
  width: 60px;
  border-radius: 3px;
}

.progress-md {
  height: 8px;
  width: 80px;
  border-radius: 4px;
}

/* Empty state */
.list-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--pe-text-muted);
}

.list-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.list-empty h5 {
  color: var(--pe-text-secondary);
  margin-bottom: 0.5rem;
}

/* Pagination standardization */
.list-pagination {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pe-border-light);
}

.list-pagination .pagination {
  margin-bottom: 0.5rem;
}

.list-pagination .page-link {
  font-family: var(--pe-font-body);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--pe-radius-sm);
  margin: 0 0.125rem;
  border: 1px solid var(--pe-border-light);
  color: var(--pe-text-secondary);
  transition: all var(--pe-transition);
}

.list-pagination .page-link:hover {
  background: var(--pe-primary-subtle);
  border-color: var(--pe-primary);
  color: var(--pe-primary);
}

.list-pagination .page-item.active .page-link {
  background: var(--pe-primary);
  border-color: var(--pe-primary);
  color: #fff;
}

.list-pagination .page-item.disabled .page-link {
  background: var(--pe-bg-elevated);
  color: var(--pe-text-muted);
}

/* Results count text */
.list-results-count {
  text-align: center;
  font-size: 0.85rem;
  color: var(--pe-text-muted);
  margin-top: 0.5rem;
}

/* ============================================
   BADGE ENHANCEMENTS
   ============================================ */
.badge {
  font-family: var(--pe-font-body);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  border-radius: var(--pe-radius-sm);
}

/* Type badges with consistent colors */
.badge-rest { background: var(--pe-primary); color: #fff; }
.badge-soap { background: #0891b2; color: #fff; }
.badge-email { background: var(--pe-success); color: #fff; }
.badge-ftp { background: var(--pe-warning); color: #fff; }

/* Status badges */
.badge-active { background: var(--pe-success); color: #fff; }
.badge-inactive { background: #64748b; color: #fff; }
.badge-completed { background: var(--pe-success); color: #fff; }
.badge-failed { background: var(--pe-error); color: #fff; }
.badge-running { background: var(--pe-warning); color: #fff; }
.badge-pending { background: var(--pe-info); color: #fff; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
  }

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

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

  /* Show overlay when sidebar is open */
  .sidebar:not(.collapsed)::after {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }

  .top-header {
    padding: 0 16px;
  }

  .customer-selector .dropdown-toggle {
    padding: 8px 12px;
  }

  .customer-name {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ============================================
   REFINED TABLE DESIGN
   Softer striping, better readability
   ============================================ */

/* Bootstrap striped table override - softer contrast */
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(0, 0, 0, 0.015);
  --bs-table-accent-bg: rgba(0, 0, 0, 0.015);
}

.table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent;
}

/* Hover takes precedence over stripes */
.table-striped > tbody > tr:hover > * {
  background-color: rgba(103, 78, 167, 0.04);
  --bs-table-accent-bg: rgba(103, 78, 167, 0.04);
}

/* Table header refinement */
.table > thead {
  border-bottom: 2px solid var(--pe-border-light);
}

.table > thead th {
  font-family: var(--pe-font-body);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pe-text-muted);
  background: linear-gradient(180deg, var(--pe-bg-elevated) 0%, #f8f9fb 100%);
  border-bottom: none;
  padding: 14px 16px;
  white-space: nowrap;
  position: relative;
}

/* Subtle header cell dividers */
.table > thead th:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--pe-border-light);
}

/* Table body cells */
.table > tbody td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--pe-text-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background-color 0.15s ease;
}

/* Remove last row border */
.table > tbody tr:last-child td {
  border-bottom: none;
}

/* Table row hover effect - subtle purple tint */
.table > tbody tr {
  transition: all 0.15s ease;
}

.table > tbody tr:hover {
  background-color: rgba(103, 78, 167, 0.04);
}

.table > tbody tr:hover td {
  color: var(--pe-text-primary);
}

/* Table action column alignment */
.table td:last-child,
.table th:last-child {
  text-align: right;
}

/* Table links */
.table a:not(.btn) {
  color: var(--r4s-purple);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.table a:not(.btn):hover {
  color: var(--r4s-purple-dark);
  text-decoration: underline;
}

/* Clickable table rows */
tr[data-href] {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

tr[data-href]:hover {
  background-color: rgba(103, 78, 167, 0.06) !important;
}

tr[data-href]:active {
  background-color: rgba(103, 78, 167, 0.1) !important;
}

/* ============================================
   REFINED BADGES
   Pill-shaped with subtle backgrounds
   ============================================ */
.badge {
  font-family: var(--pe-font-body);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.4em 0.85em;
  border-radius: 50px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Softer badge colors with backgrounds */
.badge.bg-success,
.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff;
}

.badge.bg-danger,
.badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #fff;
}

.badge.bg-warning,
.badge-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff;
}

.badge.bg-info,
.badge-info {
  background: linear-gradient(135deg, #45BDD6 0%, #3AA5BD 100%) !important;
  color: #fff;
}

.badge.bg-primary,
.badge-primary {
  background: linear-gradient(135deg, var(--r4s-purple) 0%, var(--r4s-purple-dark) 100%) !important;
  color: #fff;
}

.badge.bg-secondary,
.badge-secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
  color: #fff;
}

/* Light/outline badge variants */
.badge.bg-success-subtle,
.badge-success-subtle {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #059669;
}

.badge.bg-danger-subtle,
.badge-danger-subtle {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626;
}

.badge.bg-warning-subtle,
.badge-warning-subtle {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #b45309;
}

.badge.bg-info-subtle,
.badge-info-subtle {
  background: rgba(69, 189, 214, 0.1) !important;
  color: #0e7490;
}

/* ============================================
   ENHANCED CARDS
   Subtle depth and polish
   ============================================ */
.card {
  background: var(--pe-bg-surface);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-lg);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.03);
}

/* Card header refinement */
.card-header {
  background: linear-gradient(180deg, var(--pe-bg-elevated) 0%, #f5f7f9 100%);
  border-bottom: 1px solid var(--pe-border-light);
  padding: 16px 20px;
  font-family: var(--pe-font-display);
}

.card-header h5,
.card-header .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--pe-text-primary);
}

.card-header h5 i,
.card-header .card-title i {
  font-size: 1rem;
}

/* Icons in colored card headers should inherit white color */
.card-header.bg-primary h5 i,
.card-header.bg-secondary h5 i,
.card-header.bg-info h5 i,
.card-header.bg-success h5 i,
.card-header.bg-warning h5 i,
.card-header.bg-danger h5 i,
.card-header.bg-dark h5 i,
.card-header.text-white h5 i {
  color: inherit;
}

/* Default card header icons (no colored background) use primary color */
.card-header:not(.bg-primary):not(.bg-secondary):not(.bg-info):not(.bg-success):not(.bg-warning):not(.bg-danger):not(.bg-dark):not(.text-white) h5 i,
.card-header:not(.bg-primary):not(.bg-secondary):not(.bg-info):not(.bg-success):not(.bg-warning):not(.bg-danger):not(.bg-dark):not(.text-white) .card-title i {
  color: var(--pe-primary);
}

/* Card footer */
.card-footer {
  background: var(--pe-bg-elevated);
  border-top: 1px solid var(--pe-border-light);
  padding: 12px 20px;
}

/* ============================================
   POLISHED FORM ELEMENTS
   ============================================ */
.form-control,
.form-select {
  font-family: var(--pe-font-body);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-md);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--pe-text-primary);
  background-color: var(--pe-bg-surface);
  transition: all 0.2s ease;
}

.form-control:hover,
.form-select:hover {
  border-color: var(--pe-border-default);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--pe-primary);
  box-shadow: 0 0 0 3px rgba(103, 78, 167, 0.08);
  outline: none;
  background-color: #fff;
}

.form-control::placeholder {
  color: var(--pe-text-muted);
  opacity: 0.7;
}

/* Input groups */
.input-group .form-control {
  border-radius: var(--pe-radius-md);
}

.input-group .btn {
  border-radius: var(--pe-radius-md);
}

/* Checkboxes and radios */
.form-check-input {
  width: 1.1em;
  height: 1.1em;
  border: 2px solid var(--pe-border-default);
  transition: all 0.15s ease;
}

.form-check-input:checked {
  background-color: var(--pe-primary);
  border-color: var(--pe-primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(103, 78, 167, 0.15);
}

/* ============================================
   ENHANCED BUTTONS
   ============================================ */
.btn {
  font-family: var(--pe-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 10px 18px;
  border-radius: var(--pe-radius-md);
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

/* Button hover shine effect */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.4s ease;
}

.btn:hover::before {
  left: 100%;
}

/* Button sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
}

/* Secondary button */
.btn-secondary {
  background: var(--pe-bg-elevated);
  border-color: var(--pe-border-default);
  color: var(--pe-text-secondary);
}

.btn-secondary:hover {
  background: var(--pe-bg-hover);
  border-color: var(--pe-border-default);
  color: var(--pe-text-primary);
  transform: translateY(-1px);
}

/* Light button */
.btn-light {
  background: var(--pe-bg-surface);
  border-color: var(--pe-border-light);
  color: var(--pe-text-secondary);
}

.btn-light:hover {
  background: var(--pe-bg-elevated);
  border-color: var(--pe-border-default);
}

/* Success button */
.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #fff;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Danger button */
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #fff;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* Warning button */
.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: #fff;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Info button */
.btn-info {
  background: linear-gradient(135deg, #45BDD6 0%, #3AA5BD 100%);
  border: none;
  color: #fff;
}

.btn-info:hover {
  background: linear-gradient(135deg, #3AA5BD 0%, #2d8a9e 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(69, 189, 214, 0.35);
}

/* ============================================
   REFINED PAGINATION
   ============================================ */
.pagination {
  gap: 4px;
}

.page-item .page-link {
  font-family: var(--pe-font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--pe-radius-md);
  border: 1px solid var(--pe-border-light);
  color: var(--pe-text-secondary);
  background: var(--pe-bg-surface);
  transition: all 0.15s ease;
  min-width: 38px;
  text-align: center;
}

.page-item .page-link:hover {
  background: var(--pe-primary-subtle);
  border-color: var(--pe-primary);
  color: var(--pe-primary);
  transform: translateY(-1px);
}

.page-item.active .page-link {
  background: var(--pe-primary);
  border-color: var(--pe-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(103, 78, 167, 0.3);
}

.page-item.disabled .page-link {
  background: var(--pe-bg-elevated);
  border-color: var(--pe-border-light);
  color: var(--pe-text-muted);
  opacity: 0.6;
}

/* ============================================
   REFINED ALERTS
   ============================================ */
.alert {
  font-family: var(--pe-font-body);
  font-size: 0.9rem;
  border: none;
  border-radius: var(--pe-radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.alert::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.08) 100%);
  color: #065f46;
  border-left: 4px solid #10b981;
}

.alert-success::before {
  content: '\f058';
  color: #10b981;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.08) 100%);
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.alert-danger::before {
  content: '\f057';
  color: #ef4444;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.08) 100%);
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.alert-warning::before {
  content: '\f071';
  color: #f59e0b;
}

.alert-info {
  background: linear-gradient(135deg, rgba(69, 189, 214, 0.1) 0%, rgba(58, 165, 189, 0.08) 100%);
  color: #0e7490;
  border-left: 4px solid #45BDD6;
}

.alert-info::before {
  content: '\f05a';
  color: #45BDD6;
}

/* ============================================
   REFINED MODALS
   ============================================ */
.modal-content {
  border: none;
  border-radius: var(--pe-radius-lg);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.modal-header {
  background: var(--pe-bg-elevated);
  border-bottom: 1px solid var(--pe-border-light);
  padding: 20px 24px;
}

.modal-title {
  font-family: var(--pe-font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pe-text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  background: var(--pe-bg-elevated);
  border-top: 1px solid var(--pe-border-light);
  padding: 16px 24px;
}

.btn-close {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

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

/* ============================================
   REFINED DROPDOWNS
   ============================================ */
.dropdown-menu {
  background: var(--pe-bg-surface);
  border: 1px solid var(--pe-border-light);
  border-radius: var(--pe-radius-lg);
  box-shadow:
    0 10px 40px -10px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  padding: 8px;
  margin-top: 8px;
  min-width: 200px;
  animation: dropdownFadeIn 0.15s ease-out;
}

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

.dropdown-item {
  font-family: var(--pe-font-body);
  font-size: 0.875rem;
  padding: 10px 14px;
  border-radius: var(--pe-radius-sm);
  color: var(--pe-text-secondary);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:hover {
  background: var(--pe-primary-subtle);
  color: var(--pe-primary);
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--pe-primary);
  color: #fff;
}

.dropdown-item i {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
  opacity: 0.7;
}

.dropdown-item:hover i {
  opacity: 1;
}

.dropdown-divider {
  border-color: var(--pe-border-light);
  margin: 6px 0;
  opacity: 0.5;
}

/* ============================================
   REFINED TOOLTIPS
   ============================================ */
.tooltip .tooltip-inner {
  background: var(--r4s-main);
  font-family: var(--pe-font-body);
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: var(--pe-radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip .tooltip-arrow::before {
  border-top-color: var(--r4s-main);
}

/* ============================================
   UTILITY ENHANCEMENTS
   ============================================ */

/* Subtle divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pe-border-light), transparent);
  margin: 24px 0;
}

/* Section title */
.section-title {
  font-family: var(--pe-font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pe-text-muted);
  margin-bottom: 16px;
}

/* Subtle link styling */
a {
  color: var(--pe-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--pe-primary-dark);
}

/* Code/pre styling */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--pe-bg-elevated);
  padding: 2px 6px;
  border-radius: var(--pe-radius-sm);
  color: var(--pe-primary);
}

pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: var(--r4s-main);
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--pe-radius-lg);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Loading spinner enhancement */
.spinner-border {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2px;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Selection styling */
::selection {
  background: rgba(103, 78, 167, 0.2);
  color: var(--pe-text-primary);
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--pe-primary);
  outline-offset: 2px;
}
