/* ================================================
   The HigherSelf Network - Modern UI Stylesheet
   ================================================ */

:root {
    /* ================================================
       BRAND COLORS - HigherSelf Network Identity
       Inspired by UtakWest.com Premium Design System
       ================================================ */
    --primary-blue: #31B2E0;
    --higherself-blue: #31B2E0;
    --primary-dark: #2a9ec8;
    --primary-light: #5BC4E8;
    --primary-teal: #4ECDC4;
    --secondary-teal: #4ECDC4;
    --secondary-teal-dark: #3DBDB4;
    --secondary-teal-light: #6ED7D0;
    --primary-pink: #FF6B6B;
    --primary-gold: #FFD700;
    --primary-purple: #9B59B6;
    --accent-purple: #9B59B6;
    --accent-purple-dark: #8B4CA6;
    --accent-purple-light: #B19CD9;
    --lavender: #B19CD9;
    --earth-brown: #8B4513;

    /* ================================================
       PREMIUM DARK MODE PALETTE - UtakWest Style
       Deep Slate Colors for Sophisticated Aesthetic
       ================================================ */
    --bg-darker: #020617;          /* Slate 950 - Main background */
    --bg-dark: #0F172A;            /* Slate 900 - Secondary background */
    --bg-card: #1E293B;            /* Slate 800 - Card/component background */
    --bg-hover: #334155;           /* Slate 700 - Interactive hover state */
    --bg-elevated: #475569;        /* Slate 600 - Elevated components */

    /* Premium Text Colors (Dark Mode - WCAG AA) */
    --text-dark: #F1F5F9;          /* Slate 100 - Primary text */
    --text-medium: #CBD5E1;        /* Slate 300 - Secondary text */
    --text-light: #94A3B8;         /* Slate 400 - Tertiary text */

    /* ================================================
       TERMINAL THEME - Updated for Premium Look
       ================================================ */
    --terminal-bg: #020617;
    --terminal-surface: #0F172A;
    --terminal-border: #334155;
    --terminal-text: #F1F5F9;
    --terminal-text-muted: #94A3B8;
    --terminal-accent: #31B2E0;

    /* Grace Theme Colors */
    --grace-primary: #9B59B6;
    --grace-secondary: #B19CD9;
    --grace-gradient: linear-gradient(135deg, #9B59B6 0%, #B19CD9 100%);

    /* ================================================
       SIDEBAR CONFIGURATION
       ================================================ */
    --sidebar-width-expanded: 256px;
    --sidebar-width-collapsed: 64px;
    --sidebar-transition: 0.3s ease-in-out;

    /* ================================================
       TYPOGRAPHY - Premium Inter Font Stack
       ================================================ */
    --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Font Weights - Thinner for modern look */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    /* ================================================
       SEMANTIC COLOR SYSTEM - Light Mode (WCAG AA Compliant)
       ================================================ */
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;

    /* Text Colors - WCAG AA Compliant (4.5:1 minimum for normal text) */
    --text-primary: #1a1a1a;           /* Contrast ratio: 16.1:1 on white */
    --text-secondary: #4a5568;         /* Contrast ratio: 7.5:1 on white */
    --text-tertiary: #718096;          /* Contrast ratio: 4.6:1 on white */
    --text-on-white: #1a1a1a;          /* Always dark on white backgrounds */
    --text-on-brand: #ffffff;          /* White text on brand colors */

    /* Interactive Colors - WCAG AA Compliant */
    --link-color: #0066cc;             /* Contrast ratio: 7.0:1 on white */
    --link-hover: #004499;             /* Contrast ratio: 10.7:1 on white */
    --link-visited: #551a8b;           /* Contrast ratio: 8.6:1 on white */

    /* Borders & Dividers */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    --border-dark: #a0aec0;

    /* Status Colors - WCAG AA Compliant */
    --success-bg: #d4edda;
    --success-text: #155724;           /* Contrast ratio: 7.2:1 on success-bg */
    --success-border: #c3e6cb;

    --warning-bg: #fff3cd;
    --warning-text: #856404;           /* Contrast ratio: 6.5:1 on warning-bg */
    --warning-border: #ffeaa7;

    --error-bg: #f8d7da;
    --error-text: #721c24;             /* Contrast ratio: 8.1:1 on error-bg */
    --error-border: #f5c6cb;

    --info-bg: #d1ecf1;
    --info-text: #0c5460;              /* Contrast ratio: 7.8:1 on info-bg */
    --info-border: #bee5eb;

    /* ================================================
       GRADIENTS
       ================================================ */
    --gradient-primary: linear-gradient(135deg, #31B2E0 0%, #4ECDC4 100%);
    --gradient-warm: linear-gradient(135deg, #FF6B6B 0%, #FFD700 100%);
    --gradient-cool: linear-gradient(135deg, #9B59B6 0%, #31B2E0 100%);
    --gradient-grace: linear-gradient(135deg, #9B59B6 0%, #B19CD9 100%);

    /* ================================================
       SPACING SYSTEM - Consistent & Responsive
       ================================================ */
    --spacing-xs: 0.5rem;      /* 8px */
    --spacing-sm: 0.75rem;     /* 12px */
    --spacing-md: 1rem;        /* 16px */
    --spacing-lg: 1.5rem;      /* 24px */
    --spacing-xl: 2rem;        /* 32px */
    --spacing-2xl: 3rem;       /* 48px */
    --spacing-3xl: 4rem;       /* 64px */

    /* Component-specific spacing */
    --nav-padding-y: 1rem;     /* Reduced from 25px */
    --nav-padding-x: 1.5rem;   /* Reduced from 20px */
    --hero-padding-y: 3rem;    /* Reduced from 60px */
    --hero-padding-x: 1.5rem;  /* Reduced from 25px */
    --card-padding: 1.5rem;
    --section-gap: 2rem;

    /* ================================================
       BORDER RADIUS - Graduated Scale Design
       ================================================ */
    --radius-sm: 4px;          /* Small elements, badges */
    --radius-md: 8px;          /* Buttons, inputs */
    --radius-lg: 8px;          /* Cards, containers */
    --radius-xl: 12px;         /* Large cards, modals */
    --radius-full: 9999px;

    /* ================================================
       SHADOWS - Premium Depth System
       ================================================ */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Premium Glow Effects - UtakWest Style */
    --shadow-glow: 0 8px 20px rgba(49, 178, 224, 0.25);
    --shadow-glow-hover: 0 12px 28px rgba(49, 178, 224, 0.35);
    --shadow-glow-purple: 0 8px 20px rgba(155, 89, 182, 0.25);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 20px rgba(49, 178, 224, 0.25);

    /* ================================================
       TRANSITIONS - Premium Timing
       ================================================ */
    --transition-fast: 0.2s ease-in-out;
    --transition-base: 0.2s ease-in-out;
    --transition-slow: 0.3s ease-in-out;

    /* ================================================
       TYPOGRAPHY SCALE
       ================================================ */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Letter Spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;

    /* ================================================
       ENHANCED COLOR SYSTEM
       ================================================ */
    /* Neutral Gray Scale (9 steps) */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Surface Colors for Layered Depth */
    --surface-1: var(--bg-primary);
    --surface-2: var(--bg-secondary);
    --surface-3: var(--bg-tertiary);

    /* Interactive State Colors */
    --color-interactive: var(--primary-blue);
    --color-interactive-hover: #2a9ec8;
    --color-disabled: var(--gray-400);
    --color-disabled-bg: var(--gray-100);
    --color-focus: var(--primary-blue);

    /* Icon Colors */
    --icon-color-primary: var(--primary-blue);
    --icon-color-secondary: var(--text-secondary);
    --icon-color-muted: var(--gray-400);
    --icon-color-success: #10b981;
    --icon-color-warning: #f59e0b;
    --icon-color-error: #ef4444;
    --icon-color-info: #3b82f6;

    /* ================================================
       ICON SIZES
       ================================================ */
    --icon-xs: 0.875rem;   /* 14px */
    --icon-sm: 1rem;       /* 16px */
    --icon-md: 1.25rem;    /* 20px */
    --icon-lg: 1.5rem;     /* 24px */
    --icon-xl: 2rem;       /* 32px */
    --icon-2xl: 2.5rem;    /* 40px */
    --icon-3xl: 3rem;      /* 48px */

    /* ================================================
       ENHANCED SHADOWS
       ================================================ */
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-focus: 0 0 0 3px rgba(49, 178, 224, 0.3);

    /* ================================================
       SECTION SPACING
       ================================================ */
    --section-spacing-sm: 2rem;
    --section-spacing-md: 3rem;
    --section-spacing-lg: 4rem;
    --section-spacing-xl: 6rem;

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

    /* ================================================
       BOOTSTRAP VARIABLE OVERRIDES - Dark Mode
       Override Bootstrap's default variables for dark theme
       ================================================ */
    --bs-body-bg: #020617;
    --bs-body-color: #F1F5F9;
    --bs-card-bg: #1E293B;
    --bs-card-border-color: rgba(51, 65, 85, 0.5);
    --bs-border-color: #334155;
    --bs-secondary-bg: #0F172A;
    --bs-tertiary-bg: #1E293B;
    --bs-emphasis-color: #F1F5F9;
    --bs-secondary-color: #CBD5E1;
    --bs-link-color: #31B2E0;
    --bs-link-hover-color: #5BC4E8;
}

/* ================================================
   Base Styles - Premium UtakWest Style
   ================================================ */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-family-body, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif) !important;
    font-weight: var(--font-weight-regular, 400);
    background: #020617 !important;
    background-color: #020617 !important;
    color: #F1F5F9 !important;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Dark mode body - explicit override */
body.dark-mode {
    background: #020617 !important;
    background-color: #020617 !important;
    color: #F1F5F9 !important;
}

/* Headings use Inter with proper weight hierarchy */
h1, h2, h3, h4, h5, h6,
.section-title,
.terminal-heading {
    font-family: var(--font-family-heading, 'Inter', sans-serif);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text-dark, #F1F5F9);
}

h1 { font-size: 3rem; }     /* 48px */
h2 { font-size: 2.5rem; }   /* 40px */
h3 { font-size: 1.75rem; }  /* 28px */
h4 { font-size: 1.5rem; }   /* 24px */
h5 { font-size: 1.25rem; }  /* 20px */
h6 { font-size: 1rem; }     /* 16px */

/* Ensure text on white backgrounds is always black/dark */
.card,
.metric-card,
.agent-card,
.feature-card,
.glass-card,
.bg-white,
[style*="background: white"],
[style*="background: #fff"],
[style*="background-color: white"],
[style*="background-color: #fff"] {
    color: var(--text-on-white, #000000) !important;
}

.card *:not(.badge):not(.btn):not(.text-white):not(.text-light),
.metric-card *:not(.badge):not(.btn):not(.text-white):not(.text-light),
.agent-card *:not(.badge):not(.btn):not(.text-white):not(.text-light),
.feature-card *:not(.badge):not(.btn):not(.text-white):not(.text-light) {
    color: var(--text-on-white, #000000);
}

/* ================================================
   Hero Section - Improved Spacing & Accessibility
   ================================================ */

.hero {
    background: linear-gradient(135deg, #44d4e4 0%, #3aa8b5 100%);
    color: white;
    padding: var(--hero-padding-y) var(--hero-padding-x);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--section-gap);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>') repeat;
    animation: float 20s linear infinite;
    pointer-events: none;
}

@keyframes float {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) 0;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto var(--spacing-xl) auto;
    line-height: 1.6;
}

/* Hero button container with proper spacing */
.hero .btn-container {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
}

/* ================================================
   Navigation - Improved Spacing & Accessibility
   ================================================ */

.navbar {
    background: var(--bg-primary) !important;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-light);
    padding: var(--nav-padding-y) var(--nav-padding-x);
    margin-bottom: 0;
    transition: all var(--transition-base);
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    min-height: 70px;
    max-height: 70px;
}

.navbar .container-fluid {
    max-width: 100%;
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-collapse {
    flex-grow: 0;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: var(--spacing-sm);
    transition: transform var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 60px;
    min-height: 60px;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    transition: transform var(--transition-base);
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0;
}

.navbar-brand:hover img {
    transform: rotate(5deg);
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
    padding: var(--spacing-sm) var(--spacing-lg) !important;
    margin: 0 var(--spacing-xs);
    border-radius: var(--radius-md);
    /* Minimum touch target for mobile accessibility */
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grace Fields navigation link - special lavender/purple styling */
.nav-link.grace-link,
.nav-link[href*="grace"] {
    position: relative;
}

.nav-link.grace-link i,
.nav-link[href*="grace"] i {
    color: var(--lavender);
    margin-right: 0.25rem;
    transition: all var(--transition-base);
}

.nav-link.grace-link:hover i,
.nav-link[href*="grace"]:hover i {
    color: var(--primary-purple);
    transform: scale(1.1);
}

/* Ensure Grace link icon is visible in dark mode */
body.dark-mode .nav-link.grace-link i,
body.dark-mode .nav-link[href*="grace"] i {
    color: #B19CD9;
}

body.dark-mode .nav-link.grace-link:hover i,
body.dark-mode .nav-link[href*="grace"]:hover i {
    color: #c7b3e5;
}

/* Animated underline for navigation links */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #31B2E0;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Light mode - WCAG AA compliant navigation */
body:not(.dark-mode) .nav-link {
    color: var(--text-primary) !important;
}

body:not(.dark-mode) .nav-link:hover {
    color: var(--link-hover) !important;
    background: rgba(49, 178, 224, 0.1);
    transform: translateY(-2px);
}

body:not(.dark-mode) .nav-link.active {
    color: var(--primary-blue) !important;
    background: rgba(49, 178, 224, 0.15);
    font-weight: 600;
}

/* Dark mode navigation */
body.dark-mode .navbar {
    background: var(--bg-primary-dark) !important;
    border-bottom-color: var(--border-dark);
}

body.dark-mode .nav-link {
    color: var(--text-primary-dark) !important;
}

body.dark-mode .nav-link:hover {
    color: #ffffff !important;
    background: rgba(49, 178, 224, 0.2);
}

body.dark-mode .nav-link.active {
    color: var(--primary-teal) !important;
    background: rgba(78, 205, 196, 0.2);
    font-weight: 600;
}

.nav-link.active::after,
.nav-link[aria-current="true"]::after {
    width: 100%;
}

.navbar-toggler {
    border: none;
    padding: var(--spacing-sm);
    transition: all var(--transition-base);
    min-width: 44px;
    min-height: 44px;
}

.navbar-toggler:hover {
    background: rgba(49, 178, 224, 0.1);
    transform: scale(1.05);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(49, 178, 224, 0.3);
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.navbar-collapse {
    transition: all var(--transition-slow);
}

/* Mobile menu improvements */
@media (max-width: 991px) {
    .navbar {
        padding: var(--spacing-md) var(--spacing-md);
    }

    .navbar-collapse {
        margin-top: var(--spacing-md);
        padding: var(--spacing-md);
        background: var(--bg-secondary);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
    }

    .nav-link {
        margin: var(--spacing-xs) 0;
        padding: var(--spacing-md) var(--spacing-lg) !important;
    }
}

/* ================================================
   Keyboard Focus Indicators (WCAG 2.1 Level AA)
   ================================================ */

/* Universal focus-visible for all interactive elements */
*:focus-visible {
    outline: 2px solid #31B2E0;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Global focus styles for all interactive elements */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
    outline: 3px solid #31B2E0;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.2);
}

/* Focus visible for keyboard navigation only */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #31B2E0;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.2);
}

/* Remove focus outline for mouse clicks */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Dark mode focus indicators - Enhanced contrast */
body.dark-mode *:focus-visible {
    outline-color: #60d4f7;
}

body.dark-mode a:focus,
body.dark-mode button:focus,
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus,
body.dark-mode [tabindex]:focus {
    outline: 3px solid #60d4f7;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(96, 212, 247, 0.3);
}

body.dark-mode a:focus-visible,
body.dark-mode button:focus-visible,
body.dark-mode input:focus-visible,
body.dark-mode textarea:focus-visible,
body.dark-mode select:focus-visible,
body.dark-mode [tabindex]:focus-visible {
    outline: 3px solid #60d4f7;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(96, 212, 247, 0.3);
}

/* Card focus states */
.card:focus-within {
    box-shadow: 0 0 0 3px rgba(49, 178, 224, 0.3);
    transform: translateY(-2px);
}

/* Navigation link focus */
.nav-link:focus {
    outline: 3px solid #31B2E0;
    outline-offset: 2px;
}

/* Button focus states */
.btn:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline: 3px solid #31B2E0;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.2);
}

/* Icon button focus */
.btn-icon:focus {
    outline: 3px solid #B19CD9;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(177, 156, 217, 0.2);
}

/* Skip to main content link (accessibility) */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #31B2E0;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-to-main:focus {
    top: 0;
}

/* ================================================
   Mobile Touch Target Accessibility (44x44px minimum)
   ================================================ */

@media (max-width: 768px) {
    /* Ensure all buttons meet minimum touch target size */
    .btn, button, .btn-icon, .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    /* Ensure all links meet minimum touch target size */
    .nav-link, a.btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Card action buttons */
    .card .btn, .card button {
        min-width: 44px;
        min-height: 44px;
    }

    /* Icon-only buttons */
    .btn-icon, button[title]:not([title=""]) {
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
    }

    /* Form controls */
    input[type="checkbox"], input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
        margin: 10px; /* Add margin to reach 44px total touch area */
    }

    /* Dropdown toggles */
    .dropdown-toggle {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    /* Close buttons */
    .btn-close {
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
    }

    /* Pagination buttons */
    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Tab buttons */
    .nav-tabs .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    /* Modal close buttons */
    .modal-header .btn-close {
        min-width: 44px;
        min-height: 44px;
    }

    /* Chat interface buttons */
    .chat-actions button, .input-actions button {
        min-width: 44px;
        min-height: 44px;
    }

    /* Agent cards - ensure clickable areas are large enough */
    .agent-card {
        min-height: 44px;
    }

    /* Suggestion chips */
    .suggestion-chip {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
}

/* ================================================
   Agent Cards
   ================================================ */

.agent-grid,
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.agent-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-left: none;
    border-right: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0.8;
}

.agent-card.grace::before { background: linear-gradient(135deg, #9B59B6, #B19CD9); }
.agent-card.nyra::before { background: var(--primary-blue); }
.agent-card.solari::before { background: var(--primary-gold); }
.agent-card.ruvo::before { background: var(--earth-brown); }
.agent-card.liora::before { background: var(--primary-pink); }
.agent-card.sage::before { background: var(--primary-teal); }
.agent-card.elan::before { background: var(--primary-purple); }
.agent-card.zevi::before { background: #34495e; }
.agent-card.atlas::before { background: var(--primary-blue); }

.agent-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-xl);
}

.agent-card:active {
    transform: translateY(-2px);
}

.agent-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    color: white;
    transition: transform 0.3s ease;
}

.agent-card:hover .agent-icon {
    transform: scale(1.05);
}

.agent-card.grace .agent-icon { background: linear-gradient(135deg, #9B59B6, #B19CD9); }
.agent-card.nyra .agent-icon { background: linear-gradient(135deg, #31B2E0, #4ECDC4); }
.agent-card.solari .agent-icon { background: linear-gradient(135deg, #FFD700, #FFE44D); }
.agent-card.ruvo .agent-icon { background: linear-gradient(135deg, #8B4513, #A0522D); }
.agent-card.liora .agent-icon { background: linear-gradient(135deg, #FF6B6B, #FF8E8E); }
.agent-card.sage .agent-icon { background: linear-gradient(135deg, #4ECDC4, #6EDDD5); }
.agent-card.elan .agent-icon { background: linear-gradient(135deg, #9B59B6, #B370CF); }
.agent-card.zevi .agent-icon {
    background: linear-gradient(135deg, #31B2E0, #4ECDC4);
    box-shadow: 0 4px 12px rgba(49, 178, 224, 0.3);
}
.agent-card.atlas .agent-icon {
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.agent-name {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.agent-role {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.agent-tagline,
.agent-personality {
    text-align: center;
    font-style: normal;
    font-weight: 500;
    color: var(--primary-blue);
    background: rgba(49, 178, 224, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: inline-block;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.agent-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.agent-stats {
    display: flex;
    justify-content: space-around;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

.agent-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid #10b981;
}

.agent-status.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border: 1px solid #dc2626;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Agent card update animation */
.agent-updated {
    animation: agentPulse 1s ease-in-out;
}

@keyframes agentPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(49, 178, 224, 0.3);
    }
    animation: pulse 2s ease-in-out infinite;
}

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

/* Dark mode agent card styles - WCAG AA compliant */
body.dark-mode .agent-card {
    background: var(--bg-secondary-dark);
    border-color: var(--border-dark);
}

body.dark-mode .agent-name {
    color: var(--text-primary-dark);
}

body.dark-mode .agent-role {
    color: var(--text-secondary-dark);
}

body.dark-mode .agent-tagline,
body.dark-mode .agent-personality {
    color: #7dd3fc;
    background: rgba(49, 178, 224, 0.15);
}

body.dark-mode .agent-description {
    color: var(--text-secondary-dark);
}

body.dark-mode .stat-value {
    color: #7dd3fc;
}

body.dark-mode .stat-label {
    color: var(--text-secondary-dark);
}

body.dark-mode .agent-stats {
    border-top-color: var(--border-dark);
}

/* ================================================
   Metrics Cards - Improved Spacing & Accessibility
   ================================================ */

.metrics-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-lg) 0;
}

@media (max-width: 768px) {
    .metrics-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: var(--bg-card, #1E293B);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease-in-out;
    text-align: left;
    border: 1px solid rgba(51, 65, 85, 0.5);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-height: 160px;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-blue, #31B2E0);
    box-shadow: var(--shadow-card-hover);
}

/* Left borders removed - using top/bottom only */
/* Metric card color accents now on icon backgrounds instead */

.metric-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-blue);
    transition: transform 0.3s ease, color 0.3s ease;
}

.metric-card:hover .metric-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Enhanced Metric Card Components */
.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-xs);
}

.metric-trend.up {
    color: var(--icon-color-success);
    background: rgba(16, 185, 129, 0.1);
}

.metric-trend.down {
    color: var(--icon-color-error);
    background: rgba(239, 68, 68, 0.1);
}

.metric-trend.neutral {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.metric-comparison {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: var(--spacing-xs);
}

.metric-sparkline {
    width: 100%;
    height: 40px;
    margin-top: var(--spacing-sm);
}

/* Progress bar for metrics */
.metric-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--spacing-sm);
}

.metric-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-teal));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* Dark mode metric icons - should be white for visibility */
body.dark-mode .metric-icon {
    color: #ffffff;
}

.metric-value {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.metric-change {
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

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

.metric-change.negative {
    color: var(--error-text);
}

/* Animation delays for metric cards */
.metric-card-delay-1 {
    animation-delay: 0.1s;
}

.metric-card-delay-2 {
    animation-delay: 0.2s;
}

.metric-card-delay-3 {
    animation-delay: 0.3s;
}

/* Dark mode metric cards */
body.dark-mode .metric-card {
    background: var(--bg-secondary-dark);
    border-color: var(--border-dark);
}

body.dark-mode .metric-value {
    color: var(--text-primary-dark);
}

body.dark-mode .metric-label {
    color: var(--text-secondary-dark);
}

body.dark-mode .metric-change {
    color: var(--text-secondary-dark);
}

body.dark-mode .metric-change.positive {
    color: #34d399;
}

body.dark-mode .metric-change.negative {
    color: #f87171;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0;
    z-index: 9999;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Metrics section spacing */
.metrics-section {
    margin-top: 1rem;
    position: relative;
    z-index: 10;
}

/* Grace Chat Section Styles */
.grace-chat-section {
    margin-top: 3rem;
}

.grace-chat-header {
    background: linear-gradient(135deg, #31B2E0 0%, #4ECDC4 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.grace-chat-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.grace-icon {
    color: #B19CD9;
}

.grace-chat-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.chat-body-container {
    padding: 0;
}

.grace-capabilities-list {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.chat-input-border {
    border-top: 1px solid var(--border-light);
    padding: 1rem;
}

body.dark-mode .chat-input-border {
    border-top-color: var(--border-dark);
}

.chat-input-form {
    display: flex;
    gap: 0.5rem;
}

.chat-input-field {
    flex: 1;
}

.chat-send-btn {
    min-width: 100px;
}

.chat-help-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

.chat-full-link {
    color: var(--primary-blue);
    text-decoration: none;
}

.chat-full-link:hover {
    text-decoration: underline;
}

/* Features Section */
.features-section {
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.feature-card {
    height: 100%;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-left: none;
    border-right: none;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

/* Dark mode feature icons - white for visibility */
body.dark-mode .feature-icon {
    color: #ffffff;
}

body.dark-mode .feature-icon i {
    color: #ffffff;
}

.feature-card h5 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Dark mode feature cards */
body.dark-mode .feature-card h5 {
    color: var(--text-primary-dark);
}

body.dark-mode .feature-card p {
    color: var(--text-secondary-dark);
}

/* Footer Styles */
footer {
    background: var(--bg-secondary);
    padding: var(--spacing-2xl) 0;
    margin-top: var(--spacing-3xl);
    border-top: 1px solid var(--border-light);
}

.footer-copyright {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

body.dark-mode footer {
    background: var(--bg-secondary-dark);
    border-top-color: var(--border-dark);
}

body.dark-mode .footer-copyright {
    color: var(--text-primary-dark);
}

body.dark-mode .footer-tagline {
    color: var(--text-secondary-dark);
}

/* ================================================
   Reduced Motion Support (WCAG 2.1 Level AAA)
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep essential transforms but remove animations */
    .hover-lift:hover {
        transform: none !important;
    }

    .navbar-brand:hover,
    .navbar-brand:hover img {
        transform: none !important;
    }

    .nav-link:hover {
        transform: none !important;
    }

    .metric-card:hover {
        transform: none !important;
    }

    .btn:hover {
        transform: none !important;
    }
}

/* ================================================
   Cards & Containers - Premium UtakWest Style
   ================================================ */

.card {
    background: #1E293B !important;
    background-color: #1E293B !important;
    border: 1px solid rgba(51, 65, 85, 0.5) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
    transition: all 0.3s ease-in-out;
    padding: var(--spacing-lg);
    color: #F1F5F9 !important;
}

.card:hover {
    border-color: #31B2E0 !important;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(49, 178, 224, 0.25) !important;
}

.card-header {
    background: transparent;
    color: var(--text-dark, #F1F5F9);
    padding: 0 0 var(--spacing-md) 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: var(--text-dark, #F1F5F9);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark, #F1F5F9);
    margin-bottom: var(--spacing-xs);
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-medium, #CBD5E1);
    margin: 0;
}

.card-body {
    padding: var(--spacing-md) 0;
    color: var(--text-dark, #F1F5F9);
}

/* Ensure proper text contrast in cards */
.card-body p,
.card-body span,
.card-body div {
    color: var(--text-medium, #CBD5E1);
}

.card-body .text-secondary {
    color: var(--text-light, #94A3B8) !important;
}

.card-content {
    padding: var(--spacing-md) 0;
}

.card-footer {
    padding: var(--spacing-md) 0 0 0;
    border-top: 1px solid rgba(51, 65, 85, 0.3);
    margin-top: var(--spacing-md);
}

/* Dark mode cards - Default for HigherSelf */
body.dark-mode .card {
    background: var(--bg-card, #1E293B);
    border-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .card:hover {
    border-color: var(--primary-blue, #31B2E0);
    box-shadow: var(--shadow-card-hover);
}

body.dark-mode .card-body {
    color: var(--text-dark, #F1F5F9);
}

body.dark-mode .card-body p,
body.dark-mode .card-body span,
body.dark-mode .card-body div {
    color: var(--text-medium, #CBD5E1);
}

body.dark-mode .card-body .text-secondary,
body.dark-mode .text-secondary {
    color: var(--text-light, #94A3B8) !important;
}

body.dark-mode .card-body h1,
body.dark-mode .card-body h2,
body.dark-mode .card-body h3,
body.dark-mode .card-body h4,
body.dark-mode .card-body h5,
body.dark-mode .card-body h6 {
    color: var(--text-dark, #F1F5F9);
}

/* ================================================
   Forms
   ================================================ */

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.form-control,
.form-select {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    transition: all var(--transition-base);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(49, 178, 224, 0.1);
    outline: none;
}

/* Enhanced Form States */
.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--icon-color-success);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310b981'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--icon-color-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--icon-color-error);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ef4444'%3e%3cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--icon-color-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.valid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--icon-color-success);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--icon-color-error);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Disabled form controls */
.form-control:disabled,
.form-select:disabled {
    background-color: var(--color-disabled-bg);
    border-color: var(--border-light);
    color: var(--color-disabled);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .input-group-text:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 2px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--text-secondary);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* ================================================
   Buttons - Premium UtakWest Style
   ================================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-family: var(--font-family-body);
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1.4;
}

/* Primary Button - Solid HigherSelf Blue */
.btn-primary {
    background: var(--primary-blue, #31B2E0);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark, #2a9ec8);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: white;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.3);
}

/* Secondary Button - Outline Style */
.btn-secondary {
    background: transparent;
    color: var(--primary-blue, #31B2E0);
    border: 2px solid var(--primary-blue, #31B2E0);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--primary-blue, #31B2E0);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.3);
}

/* Outline Button - Gray Border */
.btn-outline {
    background: transparent;
    color: var(--text-dark, #F1F5F9);
    border: 2px solid var(--text-light, #94A3B8);
}

.btn-outline:hover {
    border-color: var(--primary-blue, #31B2E0);
    color: var(--primary-blue, #31B2E0);
    transform: translateY(-2px);
}

.btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.3);
}

/* Ghost Button - Transparent */
.btn-ghost {
    background: transparent;
    color: var(--text-dark, #F1F5F9);
    border: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--bg-hover, #334155);
}

.btn-ghost:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.3);
}

/* Agent Button */
.btn-agent {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-agent:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ================================================
   BUTTON SIZES - UtakWest Style
   ================================================ */

.btn-xs {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
}

/* Default: md */
.btn-md {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: var(--font-size-xl);
}

/* ================================================
   ADDITIONAL BUTTON VARIANTS
   ================================================ */

.btn-outline-primary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-medium, #CBD5E1);
    border: 2px solid var(--text-light, #94A3B8);
}

.btn-outline-secondary:hover {
    background: var(--bg-hover, #334155);
    border-color: var(--text-medium, #CBD5E1);
}

.btn-text {
    background: transparent;
    color: var(--primary-blue);
    border: none;
    box-shadow: none;
    padding: 0.5rem 0.75rem;
}

.btn-text:hover {
    background: rgba(49, 178, 224, 0.1);
}

/* Grace Purple Button */
.btn-grace {
    background: var(--accent-purple, #9B59B6);
    color: white;
}

.btn-grace:hover {
    background: var(--accent-purple-dark, #8B4CA6);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-purple);
    color: white;
}

/* Success/Error/Warning Buttons */
.btn-success {
    background: #10B981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

.btn-danger,
.btn-error {
    background: #EF4444;
    color: white;
}

.btn-danger:hover,
.btn-error:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.btn-warning {
    background: #F59E0B;
    color: white;
}

.btn-warning:hover {
    background: #D97706;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

/* Icon-only buttons */
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.btn-icon-sm {
    width: 36px;
    height: 36px;
}

.btn-icon-lg {
    width: 52px;
    height: 52px;
}

/* Button Active State - Press Effect */
.btn:active {
    transform: scale(0.98) !important;
}

/* Button Disabled State */
.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
    box-shadow: none;
}

.btn:disabled:hover,
.btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Button Loading State */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    color: white;
}

.btn-outline-primary.loading::after,
.btn-outline-secondary.loading::after,
.btn-ghost.loading::after,
.btn-text.loading::after {
    color: var(--primary-blue);
}

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

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

.btn-group .btn {
    margin: 0;
}

/* ================================================
   Charts Container
   ================================================ */

.chart-container {
    position: relative;
    height: 300px;
    padding: var(--spacing-md);
}

/* ================================================
   Loading States
   ================================================ */

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 144, 226, 0.2);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

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

/* ================================================
   Footer
   ================================================ */

footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    text-align: center;
    color: var(--text-secondary);
}

/* ================================================
   Responsive Design - Mobile-First Approach
   ================================================ */

/* Tablet and below */
@media (max-width: 991px) {
    .container-custom {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: var(--spacing-lg);
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    :root {
        --hero-padding-y: 2rem;
        --hero-padding-x: 1rem;
        --nav-padding-y: 0.75rem;
        --nav-padding-x: 1rem;
    }

    .container-custom {
        padding: var(--spacing-md);
    }

    .hero {
        padding: var(--hero-padding-y) var(--hero-padding-x);
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-lg);
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }

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

    .agent-grid {
        grid-template-columns: 1fr;
        padding: var(--spacing-md);
        gap: var(--spacing-lg);
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md) 0;
    }

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

    .chart-container {
        height: 250px;
        padding: var(--spacing-sm);
    }

    .section-title {
        font-size: 1.5rem;
        margin-top: var(--spacing-xl);
        margin-bottom: var(--spacing-xl);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

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

    .metric-card {
        padding: var(--spacing-md);
    }
}

/* ================================================
   Utility Classes
   ================================================ */

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: var(--spacing-2xl);
    margin-top: var(--spacing-2xl);
    text-align: center;
    color: var(--text-primary);
    line-height: 1.2;
}

.container-custom {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

/* Dark mode section titles */
body.dark-mode .section-title {
    color: var(--text-primary-dark);
}

/* ================================================
   Animations
   ================================================ */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================================================
   EMPTY STATES
   ================================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--text-secondary);
}

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

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

.empty-state-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto var(--spacing-lg);
    line-height: var(--line-height-relaxed);
}

.empty-state-action {
    margin-top: var(--spacing-lg);
}

/* ================================================
   ENHANCED MICRO-INTERACTIONS
   ================================================ */

/* Smooth hover lift for interactive cards */
.interactive-card {
    transition: all var(--transition-base);
    cursor: pointer;
}

.interactive-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

/* Ripple effect on click */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Shimmer loading effect */
@keyframes shimmer-animation {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer-animation 2s infinite;
}

/* Pulsing animation for loading states */
@keyframes pulse-animation {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Bounce animation for alerts/notifications */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s ease-in-out;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

/* Rotate on hover for action buttons */
.rotate-on-hover {
    transition: transform var(--transition-base);
}

.rotate-on-hover:hover {
    transform: rotate(90deg);
}

/* Scale on hover */
.scale-on-hover {
    transition: transform var(--transition-base);
}

.scale-on-hover:hover {
    transform: scale(1.1);
}

/* ================================================
   BADGES & LABELS - Premium UtakWest Style
   ================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: rgba(49, 178, 224, 0.1);
    color: var(--primary-blue, #31B2E0);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.badge-error,
.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.badge-info {
    background: rgba(49, 178, 224, 0.1);
    color: var(--primary-blue, #31B2E0);
}

.badge-neutral,
.badge-default {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-light, #94A3B8);
}

.badge-purple,
.badge-grace {
    background: rgba(155, 89, 182, 0.1);
    color: var(--accent-purple, #9B59B6);
}

/* ================================================
   KPI CARDS - Premium UtakWest Style
   ================================================ */

.kpi-card {
    background: var(--bg-card, #1E293B);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s ease-in-out;
    box-shadow: var(--shadow-card);
}

.kpi-card:hover {
    border-color: var(--primary-blue, #31B2E0);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.kpi-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--spacing-xs);
}

.kpi-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-medium, #CBD5E1);
    margin: 0;
}

.kpi-card-icon {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card-icon.icon-primary {
    background: rgba(49, 178, 224, 0.1);
    color: var(--primary-blue, #31B2E0);
}

.kpi-card-icon.icon-secondary {
    background: rgba(78, 205, 196, 0.1);
    color: var(--primary-teal, #4ECDC4);
}

.kpi-card-icon.icon-purple {
    background: rgba(155, 89, 182, 0.1);
    color: var(--accent-purple, #9B59B6);
}

.kpi-card-icon.icon-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.kpi-card-icon.icon-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.kpi-card-icon.icon-error {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.kpi-card-content {
    padding-top: var(--spacing-sm);
}

.kpi-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark, #F1F5F9);
    margin: 0;
    line-height: 1.2;
}

.kpi-card-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

.kpi-card-change.positive {
    color: #10B981;
}

.kpi-card-change.negative {
    color: #EF4444;
}

.kpi-card-change.neutral {
    color: var(--text-light, #94A3B8);
}

/* ================================================
   TOOLTIPS
   ================================================ */

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: var(--gray-900);
    color: white;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: var(--z-index-tooltip);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--gray-900);
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
}

/* ================================================
   DIVIDERS
   ================================================ */

.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--spacing-lg) 0;
}

.divider-vertical {
    width: 1px;
    background: var(--border-light);
    height: 100%;
    margin: 0 var(--spacing-lg);
}

.divider-text {
    display: flex;
    align-items: center;
    margin: var(--spacing-lg) 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.divider-text::before {
    margin-right: var(--spacing-md);
}

.divider-text::after {
    margin-left: var(--spacing-md);
}

/* ================================================
   ALERTS & NOTIFICATIONS
   ================================================ */

.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: start;
    gap: var(--spacing-md);
}

.alert-icon {
    font-size: var(--icon-lg);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-content {
    flex: 1;
}

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

.alert-message {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

.alert-success {
    background: var(--success-bg);
    border-left-color: var(--icon-color-success);
}

.alert-success .alert-icon,
.alert-success .alert-title {
    color: var(--success-text);
}

.alert-warning {
    background: var(--warning-bg);
    border-left-color: var(--icon-color-warning);
}

.alert-warning .alert-icon,
.alert-warning .alert-title {
    color: var(--warning-text);
}

.alert-error {
    background: var(--error-bg);
    border-left-color: var(--icon-color-error);
}

.alert-error .alert-icon,
.alert-error .alert-title {
    color: var(--error-text);
}

.alert-info {
    background: var(--info-bg);
    border-left-color: var(--icon-color-info);
}

.alert-info .alert-icon,
.alert-info .alert-title {
    color: var(--info-text);
}

/* ================================================
   IMPROVED CARD VARIANTS
   ================================================ */

.card-outlined {
    background: transparent;
    border: 2px solid var(--border-light);
    box-shadow: none;
}

.card-elevated {
    box-shadow: var(--shadow-xl);
    border: none;
}

.card-flat {
    box-shadow: none;
    border: none;
    background: var(--bg-secondary);
}

.card-clickable {
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

.card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-blue);
}

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

/* ================================================
   ENHANCED NAVIGATION
   ================================================ */

.nav-link.active {
    background: rgba(49, 178, 224, 0.15);
    color: var(--primary-blue) !important;
    font-weight: var(--font-weight-semibold);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: var(--primary-blue);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ================================================
   IMPROVED MOBILE TOUCH TARGETS
   ================================================ */

@media (max-width: 768px) {
    .btn, button, .btn-icon {
        min-width: 48px;
        min-height: 48px;
    }

    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* ================================================
   DASHBOARD-SPECIFIC CLASSES
   ================================================ */

/* Navigation logo */
.nav-logo {
    width: 40px;
    height: 40px;
}

/* Metrics offset for dashboard */
.metrics-offset {
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}

/* Animation delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }

.metric-card-delay-1 { animation-delay: 0.1s; }
.metric-card-delay-2 { animation-delay: 0.2s; }
.metric-card-delay-3 { animation-delay: 0.3s; }

/* Grace Featured Full-Width Card */
.grace-featured-card {
    width: 100%;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border: 2px solid #B19CD9;
    box-shadow: 0 8px 24px rgba(155, 89, 182, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.grace-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(155, 89, 182, 0.3);
    border-color: #9B59B6;
}

.grace-featured-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.grace-featured-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.grace-featured-avatar {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #9B59B6, #B19CD9);
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.grace-featured-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.grace-featured-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.grace-featured-role {
    font-size: 0.95rem;
    color: #9B59B6;
    font-weight: 500;
    margin: 0;
}

.grace-featured-tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

.grace-featured-stats {
    display: flex;
    gap: 2rem;
}

.grace-stat {
    text-align: center;
}

.grace-stat .stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.grace-stat .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Responsive Grace Card */
@media (max-width: 991.98px) {
    .grace-featured-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .grace-featured-stats {
        width: 100%;
        justify-content: space-between;
        margin-top: 1rem;
    }
}

@media (max-width: 575.98px) {
    .grace-featured-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .grace-featured-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .grace-stat {
        flex: 1 1 45%;
    }
}

/* Grace card - full width layout */
.grace-featured-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 0 0 var(--spacing-3xl) 0;
}

.agent-card.grace-featured {
    max-width: 100%;
    border: 3px solid #B19CD9;
    box-shadow: 0 8px 24px rgba(155, 89, 182, 0.3);
}

/* Badge orchestrator */
.badge-orchestrator {
    display: inline-block;
    background: linear-gradient(135deg, #9B59B6, #B19CD9);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Specialist agents title */
.specialist-agents-title {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 1.5rem 0 1.25rem 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Quick action icons */
.quick-action-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--icon-color-primary);
}

/* Quick action icons should be white in dark mode */
body.dark-mode .quick-action-icon,
body.dark-mode .quick-action-icon i {
    color: #ffffff !important;
}

/* Card clickable quick actions in dark mode */
body.dark-mode .card-clickable .card-body i {
    color: #ffffff;
}

/* Footer subtext */
.footer-subtext {
    font-size: 0.875rem;
    color: #999;
}

/* Dark mode adjustments */
body.dark-mode .specialist-agents-title {
    color: var(--text-secondary-dark);
}

body.dark-mode .footer-subtext {
    color: var(--text-tertiary-dark);
}

/* ================================================
   WORKFLOWS PAGE CLASSES
   ================================================ */

.subtitle-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 1rem auto;
}

.template-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--icon-color-primary);
}

.template-icon i {
    color: var(--icon-color-primary);
}

body.dark-mode .subtitle-text {
    color: var(--text-secondary-dark);
}

body.dark-mode .template-icon,
body.dark-mode .template-icon i {
    color: var(--icon-color-primary);
}

/* ================================================
   GRACE CHAT PAGE CLASSES
   ================================================ */

.grace-icon {
    color: var(--grace-icon-color, #B19CD9);
}

/* ================================================
   COMPREHENSIVE UI ENHANCEMENTS - November 2025
   Modern, Human-Centered Design System
   ================================================ */

/* Modern Typography - Inter Font */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Enhanced Hero Section with Organic Shapes */
.hero-enhanced {
    background: linear-gradient(135deg, #31B2E0 0%, #4ECDC4 50%, #9B59B6 100%);
    position: relative;
    overflow: hidden;
    padding: var(--spacing-3xl) var(--spacing-xl);
}

.hero-organic-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-organic-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    background: white;
}

.hero-organic-shapes .shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation: float-shape 20s ease-in-out infinite;
}

.hero-organic-shapes .shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation: float-shape 15s ease-in-out infinite reverse;
}

.hero-organic-shapes .shape-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-shape 10s ease-in-out infinite;
}

@keyframes float-shape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

@keyframes pulse-shape {
    0%, 100% { opacity: 0.1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.15; transform: translate(-50%, -50%) scale(1.1); }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-trust-badges {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* CTA Button - Bold Primary Action */
.btn-cta {
    background: linear-gradient(135deg, #FFD700 0%, #FF6B6B 100%);
    color: #1a1a1a;
    border: none;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all var(--transition-base);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    color: #1a1a1a;
}

.btn-cta:focus {
    outline: 3px solid rgba(255, 215, 0, 0.5);
    outline-offset: 2px;
}

/* Pill-shaped Buttons */
.btn-pill {
    border-radius: var(--radius-full);
    padding: 0.625rem 1.5rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

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

/* Section Titles */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
}

body.dark-mode .section-title {
    color: var(--text-primary-dark);
}

body.dark-mode .section-subtitle {
    color: var(--text-secondary-dark);
}

/* Enhanced Feature Cards */
.feature-card-enhanced {
    border: none;
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    height: 100%;
}

.feature-card-enhanced:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

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

.feature-card-enhanced h3 {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.feature-card-enhanced p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

/* Feature Icon Color Variants */
.feature-icon-teal {
    background: linear-gradient(135deg, #4ECDC4 0%, #31B2E0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-icon-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FF6B6B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-icon-purple {
    background: linear-gradient(135deg, #9B59B6 0%, #B19CD9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-icon-teal i,
.feature-icon-gold i,
.feature-icon-purple i {
    font-size: 3rem;
}

/* Enhanced Footer */
.footer-enhanced {
    background: var(--bg-secondary);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    margin-top: var(--spacing-3xl);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

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

.footer-logo {
    border-radius: var(--radius-md);
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-brand-name {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
}

.footer-brand-tagline {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary-blue);
}

.footer-bottom {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer-bottom .footer-copyright {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

/* Dark mode footer */
body.dark-mode .footer-enhanced {
    background: var(--bg-secondary-dark);
    border-top-color: var(--border-dark);
}

body.dark-mode .footer-brand-name {
    color: var(--text-primary-dark);
}

body.dark-mode .footer-brand-tagline {
    color: var(--text-secondary-dark);
}

body.dark-mode .footer-link {
    color: var(--text-secondary-dark);
}

body.dark-mode .footer-link:hover {
    color: var(--primary-teal);
}

body.dark-mode .footer-bottom {
    border-top-color: var(--border-dark);
}

body.dark-mode .footer-bottom .footer-copyright {
    color: var(--text-tertiary-dark);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        flex-direction: column;
    }

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

/* ================================================
   PAGE HEADER SECTIONS
   ================================================ */

.page-header-section {
    margin-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.page-header {
    margin-bottom: var(--spacing-2xl);
}

/* Filter Card Styling */
.filter-card {
    margin-bottom: var(--spacing-xl);
    border-radius: var(--radius-lg);
}

.filter-card .input-group-text {
    background: transparent;
    border-right: none;
}

.filter-card .form-control {
    border-left: none;
}

.filter-card .form-control:focus {
    box-shadow: none;
    border-color: var(--primary-blue);
}

.filter-card .form-select {
    border-radius: var(--radius-md);
}

/* Filter Card - Dark Background Text Contrast */
.filter-card .form-control,
.filter-card .form-select {
    background: var(--terminal-surface);
    color: var(--terminal-text);
    border-color: var(--terminal-border);
}

.filter-card .form-control::placeholder {
    color: var(--terminal-text-muted);
}

.filter-card .form-control:focus,
.filter-card .form-select:focus {
    background: var(--terminal-surface);
    color: var(--terminal-text);
    border-color: var(--terminal-accent);
}

.filter-card .form-select option {
    background: var(--terminal-surface);
    color: var(--terminal-text);
}

.filter-card .input-group-text {
    background: var(--terminal-surface);
    color: var(--terminal-text-muted);
    border-color: var(--terminal-border);
}

/* Dark Mode Filter Fix - Ensure White Text */
body.dark-mode .filter-card .form-control,
body.dark-mode .filter-card .form-select {
    background: var(--terminal-surface, #161b22) !important;
    color: #f0f6fc !important;
    border-color: var(--terminal-border, #30363d) !important;
}

body.dark-mode .filter-card .form-control::placeholder {
    color: #8b949e !important;
}

body.dark-mode .filter-card .form-select option {
    background: #161b22 !important;
    color: #f0f6fc !important;
}

body.dark-mode .filter-card .input-group-text {
    background: var(--terminal-surface, #161b22) !important;
    color: #8b949e !important;
    border-color: var(--terminal-border, #30363d) !important;
}

/* Light Mode Filter Fix - Ensure Dark Text */
body:not(.dark-mode) .filter-card .form-control,
body:not(.dark-mode) .filter-card .form-select {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-color: #e2e8f0 !important;
}

body:not(.dark-mode) .filter-card .form-control::placeholder {
    color: #6b7280 !important;
}

body:not(.dark-mode) .filter-card .form-select option {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

body:not(.dark-mode) .filter-card .input-group-text {
    background: #f8f9fa !important;
    color: #4a5568 !important;
    border-color: #e2e8f0 !important;
}

/* ================================================
   BUSINESS PAGE - Dark Mode Tables & Cards
   ================================================ */

/* Table dark mode styling */
.table {
    --bs-table-bg: var(--terminal-surface);
    --bs-table-color: var(--terminal-text);
    --bs-table-border-color: var(--terminal-border);
    --bs-table-striped-bg: rgba(49, 178, 224, 0.05);
    --bs-table-hover-bg: rgba(49, 178, 224, 0.1);
    --bs-table-hover-color: var(--terminal-text);
    color: var(--terminal-text);
    border-color: var(--terminal-border);
}

.table thead {
    background: var(--terminal-bg);
    color: var(--terminal-text);
}

.table thead th {
    background: var(--terminal-bg);
    color: var(--terminal-text);
    border-color: var(--terminal-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr {
    background: var(--terminal-surface);
    color: var(--terminal-text);
}

.table tbody td {
    border-color: var(--terminal-border);
    color: var(--terminal-text);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(49, 178, 224, 0.08);
    color: var(--terminal-text);
}

/* Dark Mode Table Text - Explicit White */
body.dark-mode .table,
body.dark-mode .table thead,
body.dark-mode .table thead th,
body.dark-mode .table tbody tr,
body.dark-mode .table tbody td {
    color: #f0f6fc !important;
    background-color: var(--terminal-surface, #161b22);
}

body.dark-mode .table thead th {
    background-color: var(--terminal-bg, #0d1117) !important;
    color: #f0f6fc !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(49, 178, 224, 0.05) !important;
}

/* Light Mode Table Text - Explicit Dark */
body:not(.dark-mode) .table,
body:not(.dark-mode) .table thead,
body:not(.dark-mode) .table thead th,
body:not(.dark-mode) .table tbody tr,
body:not(.dark-mode) .table tbody td {
    color: #1a1a1a !important;
    background-color: #ffffff;
}

body:not(.dark-mode) .table thead th {
    background-color: #f8f9fa !important;
    color: #1a1a1a !important;
}

body:not(.dark-mode) .table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa !important;
}

/* Card dark mode overrides - Premium UtakWest Style */
/* Note: Main card styles defined above with !important */

/* Modal dark mode styling - Premium UtakWest Style */
.modal-content {
    background: #0F172A !important;
    border-color: var(--terminal-border);
    color: var(--terminal-text);
}

.modal-header {
    background: var(--terminal-bg);
    border-color: var(--terminal-border);
    color: var(--terminal-text);
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body {
    background: var(--terminal-surface);
    color: var(--terminal-text);
}

.modal-footer {
    background: var(--terminal-surface);
    border-color: var(--terminal-border);
}

/* Form labels dark mode */
.form-label {
    color: var(--terminal-text);
}

/* Text muted override */
.text-muted {
    color: var(--terminal-text-muted) !important;
}

/* Quick Action Cards */
.quick-action-card {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.quick-action-card:hover {
    color: inherit;
    transform: translateY(-4px);
}

.quick-action-card .quick-action-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--terminal-accent, #31B2E0);
}

.quick-action-card .quick-action-icon i {
    font-size: 1.75rem;
}

/* Grace icon special styling */
.quick-action-card .quick-action-icon.grace-icon-bg {
    background: linear-gradient(135deg, rgba(177, 156, 217, 0.15), rgba(155, 89, 182, 0.15));
    color: #B19CD9;
}

body.dark-mode .quick-action-card .quick-action-icon {
    color: var(--terminal-accent, #31B2E0);
}

body.dark-mode .quick-action-card .quick-action-icon.grace-icon-bg {
    background: linear-gradient(135deg, rgba(177, 156, 217, 0.2), rgba(155, 89, 182, 0.2));
    color: #B19CD9;
}

/* ================================================
   AGENT CAROUSEL NAVIGATION
   ================================================ */

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

.agent-carousel-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.carousel-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--terminal-border, #30363d);
    background: var(--terminal-surface, #161b22);
    color: var(--terminal-text, #c9d1d9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background: var(--terminal-accent, #31B2E0);
    color: white;
    border-color: var(--terminal-accent, #31B2E0);
}

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

.carousel-indicator {
    font-size: 0.875rem;
    color: var(--terminal-text-muted, #8b949e);
    min-width: 50px;
    text-align: center;
}

/* Light mode carousel styles */
body:not(.dark-mode) .carousel-btn {
    border-color: var(--border-light, #e2e8f0);
    background: #ffffff;
    color: var(--text-primary, #1a1a1a);
}

body:not(.dark-mode) .carousel-btn:hover {
    background: var(--terminal-accent, #31B2E0);
    color: white;
}

body:not(.dark-mode) .carousel-indicator {
    color: var(--text-secondary, #4a5568);
}

/* Agent carousel grid - show 3 at a time */
.agent-carousel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.agent-carousel .agent-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.agent-carousel .agent-card.hidden {
    display: none;
}

@media (max-width: 992px) {
    .agent-carousel {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .agent-carousel {
        grid-template-columns: 1fr;
    }

    .specialist-agents-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
}

/* ================================================
   GRACE ORCHESTRATOR SECTION (Agents Page)
   ================================================ */

.grace-orchestrator-section {
    margin-bottom: var(--spacing-2xl);
}

.grace-orchestrator {
    position: relative;
    overflow: visible;
}

.grace-glow-effect {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(177, 156, 217, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: graceGlow 3s ease-in-out infinite alternate;
}

@keyframes graceGlow {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.grace-pulse {
    animation: gracePulse 2s ease-in-out infinite;
}

@keyframes gracePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.grace-collaboration-note {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    background: rgba(177, 156, 217, 0.1);
    border-radius: var(--radius-md);
    border-left: 3px solid #B19CD9;
    font-size: 0.9rem;
    color: var(--terminal-text-muted, #8b949e);
}

.grace-collaboration-note i {
    color: #B19CD9;
    font-size: 1.1rem;
    margin-top: 2px;
}

body:not(.dark-mode) .grace-collaboration-note {
    background: rgba(177, 156, 217, 0.08);
    color: var(--text-secondary, #4a5568);
}

/* Specialist Grid for Agents Page - 3 per row */
.specialist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

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

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

/* Super admin badge styling moved to WORKFLOWS section below */

/* ================================================
   GRACE CHAT ENHANCEMENTS
   ================================================ */

.grace-avatar-enhanced {
    background: linear-gradient(135deg, #B19CD9 0%, #9B59B6 100%);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(177, 156, 217, 0.4);
}

.grace-avatar-enhanced .grace-icon {
    color: white;
    font-size: 1.5rem;
}

/* Suggestion Chips Enhancement */
.quick-suggestions {
    padding: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.suggestion-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.suggestion-chip:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.suggestion-chip:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

body.dark-mode .suggestion-chip {
    background: var(--bg-secondary-dark);
    border-color: var(--border-dark);
    color: var(--text-secondary-dark);
}

body.dark-mode .suggestion-chip:hover {
    background: var(--primary-teal);
    color: white;
    border-color: var(--primary-teal);
}

/* ================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================ */

/* Focus indicators for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    z-index: 100;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Visually hidden but accessible */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-cta {
        border: 2px solid currentColor;
    }

    .card {
        border: 2px solid var(--text-primary);
    }

    .suggestion-chip {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-organic-shapes .shape {
        animation: none;
    }
}

/* ================================================
   SPLINE 3D BACKGROUND CONTAINER
   ================================================ */

.spline-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -10;
    pointer-events: none;
    overflow: hidden;
}

.spline-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Layered Effects over Spline */
.spline-overlay-effects {
    position: fixed;
    inset: 0;
    z-index: -9;
    pointer-events: none;
}

/* Dot pattern overlay */
.spline-dots-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image: radial-gradient(#101010 1px, transparent 1px);
    background-size: 16px 16px;
}

/* Grid lines overlay */
.spline-grid-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 120px 1px, 1px 120px;
}

/* Vignette overlay - Enhanced for terminal aesthetic */
.spline-vignette-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(13, 17, 23, 0.9) 0%,
        rgba(13, 17, 23, 0.4) 15%,
        transparent 40%,
        rgba(13, 17, 23, 0.4) 85%,
        rgba(13, 17, 23, 0.9) 100%
    );
}

/* Dark overlay for terminal-style dashboard */
.spline-dark-overlay {
    position: fixed;
    inset: 0;
    z-index: -8;
    background: rgba(13, 17, 23, 0.85);
    pointer-events: none;
    transition: background 0.3s ease;
}

/* Light mode: Use light overlay for better visibility */
body:not(.dark-mode) .spline-dark-overlay {
    background: rgba(255, 255, 255, 0.88);
}

/* Light mode: Adjust spline overlay effects */
body:not(.dark-mode) .spline-vignette-overlay {
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(255, 255, 255, 0.6) 100%
    );
}

body:not(.dark-mode) .spline-dots-overlay {
    opacity: 0.15;
}

body:not(.dark-mode) .spline-grid-overlay {
    opacity: 0.1;
}

/* Performance: Disable Spline on reduced motion */
@media (prefers-reduced-motion: reduce) {
    .spline-container {
        display: none;
    }

    .spline-overlay-effects {
        display: none;
    }
}

/* ================================================
   TERMINAL-STYLE BUTTONS - Zero Border Radius
   ================================================ */

.btn {
    border-radius: 0;
    font-family: var(--font-family-body);
    font-weight: var(--font-weight-regular);
    transition: all 0.2s ease;
    border: 1px solid var(--terminal-border);
}

.btn:hover {
    /* No border effects on hover */
    transform: translateY(-1px);
}

.btn-primary,
.btn-cta {
    background: var(--terminal-accent);
    border: 1px solid var(--terminal-accent);
    border-radius: 0;
    color: white;
}

.btn-primary:hover,
.btn-cta:hover {
    background: #2a9ec7;
    border-color: #2a9ec7;
    color: white;
}

.btn-outline-primary {
    border-radius: 0;
    border: 1px solid var(--terminal-border);
    background: transparent;
    color: var(--terminal-text);
}

.btn-outline-primary:hover {
    border-color: var(--terminal-accent);
    background: rgba(49, 178, 224, 0.1);
    color: var(--terminal-accent);
}

/* Grace-themed button */
.btn-grace {
    background: var(--grace-gradient);
    border: none;
    border-radius: 0;
    color: white;
}

.btn-grace:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    color: white;
}

/* ================================================
   TERMINAL-STYLE QUICK ACTIONS
   ================================================ */

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

.quick-action-card {
    position: relative;
    padding: 1.5rem;
    background: var(--terminal-surface);
    border: 1px solid var(--terminal-border);
    border-radius: 0;
    display: flex;
    gap: 1.25rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.quick-action-card:hover {
    border-color: var(--terminal-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    color: inherit;
    text-decoration: none;
}

.quick-action-card.grace-card {
    border-color: rgba(155, 89, 182, 0.3);
}

.quick-action-card.grace-card:hover {
    border-color: var(--grace-secondary);
    box-shadow: 0 8px 24px rgba(155, 89, 182, 0.2);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(49, 178, 224, 0.1);
    border: 1px solid rgba(49, 178, 224, 0.2);
    border-radius: 0;
    font-size: 1.25rem;
    color: var(--terminal-accent);
    flex-shrink: 0;
}

.quick-action-icon.grace-icon-bg {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.2);
    color: var(--grace-secondary);
}

.quick-action-content h5 {
    font-family: var(--font-family-heading);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--terminal-text);
}

.quick-action-content p {
    color: var(--terminal-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.quick-action-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.example-tag {
    padding: 0.25rem 0.5rem;
    background: rgba(49, 178, 224, 0.1);
    border: 1px solid rgba(49, 178, 224, 0.2);
    border-radius: 0;
    font-size: 0.75rem;
    color: var(--terminal-text-muted);
}

.example-tag.grace-tag {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.2);
    color: var(--grace-secondary);
}

/* ================================================
   TERMINAL-STYLE WORKFLOW TEMPLATES
   ================================================ */

.workflow-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.workflow-template-card {
    background: var(--terminal-surface);
    border: 1px solid var(--terminal-border);
    border-radius: 0;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-template-card:hover {
    border-color: var(--terminal-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.template-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.template-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

/* Agent-specific icon backgrounds */
.template-icon.nyra { background: linear-gradient(135deg, #31B2E0, #4ECDC4); }
.template-icon.solari { background: linear-gradient(135deg, #FFD700, #FFE44D); color: #1a1a1a; }
.template-icon.elan { background: linear-gradient(135deg, #9B59B6, #B370CF); }
.template-icon.sage { background: linear-gradient(135deg, #4ECDC4, #6EDDD5); }
.template-icon.zevi { background: linear-gradient(135deg, #31B2E0, #4ECDC4); }
.template-icon.liora { background: linear-gradient(135deg, #FF6B6B, #FF8E8E); }
.template-icon.ruvo { background: linear-gradient(135deg, #8B4513, #A0522D); }
.template-icon.grace { background: var(--grace-gradient); }

.template-meta {
    flex: 1;
}

.template-category {
    font-size: 0.7rem;
    color: var(--terminal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-name {
    font-family: var(--font-family-heading);
    font-size: 1.1rem;
    color: var(--terminal-text);
    margin: 0.25rem 0 0 0;
}

.template-description {
    color: var(--terminal-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.template-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--terminal-border);
    border-bottom: 1px solid var(--terminal-border);
    margin-bottom: 1rem;
}

.template-detail {
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 0.65rem;
    color: var(--terminal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--terminal-text);
    font-weight: var(--font-weight-medium);
}

.template-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.requirement-tag {
    padding: 0.25rem 0.5rem;
    background: rgba(49, 178, 224, 0.1);
    border: 1px solid rgba(49, 178, 224, 0.2);
    border-radius: 0;
    font-size: 0.7rem;
    color: var(--terminal-accent);
}

/* ================================================
   TERMINAL GLASS CARDS - Light/Dark Mode Support
   ================================================ */

/* Dark mode glass card (default terminal theme) */
.glass-card {
    background: rgba(22, 27, 34, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(48, 54, 61, 0.6);
    border-radius: 8px;
}

.glass-card:hover {
    background: rgba(22, 27, 34, 0.92);
    border-color: rgba(49, 178, 224, 0.3);
}

/* Light mode glass card - switch to lighter glass effect */
body:not(.dark-mode) .glass-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body:not(.dark-mode) .glass-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(49, 178, 224, 0.4);
    box-shadow: 0 8px 30px rgba(49, 178, 224, 0.12);
}

/* Glass effect utility class */
.glass-effect {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(22, 27, 34, 0.75);
    border: 1px solid rgba(48, 54, 61, 0.5);
    border-radius: 8px;
}

body:not(.dark-mode) .glass-effect {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ================================================
   NAV ITEM OVERRIDES - Remove borders and radius
   ================================================ */

.nav-link,
.navbar-nav .nav-link {
    border-radius: 0 !important;
    border: none !important;
}

.nav-link:hover,
.navbar-nav .nav-link:hover {
    border: none !important;
}

.nav-link.active,
.navbar-nav .nav-link.active {
    border: none !important;
    border-left: none !important;
}

/* ================================================
   HERO SECTION - Animated & Visually Engaging
   ================================================ */

.hero-animated {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(49, 178, 224, 0.15) 0%, rgba(13, 17, 23, 0.95) 50%, rgba(155, 89, 182, 0.1) 100%);
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--terminal-accent);
    border-radius: 50%;
    opacity: 0.6;
    animation: float-particle 15s infinite ease-in-out;
}

.particle-1 { top: 20%; left: 10%; animation-delay: 0s; }
.particle-2 { top: 60%; left: 25%; animation-delay: 2s; }
.particle-3 { top: 30%; left: 70%; animation-delay: 4s; }
.particle-4 { top: 80%; left: 85%; animation-delay: 6s; }
.particle-5 { top: 50%; left: 50%; animation-delay: 8s; }

@keyframes float-particle {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.6; }
    25% { transform: translateY(-30px) translateX(15px); opacity: 0.8; }
    50% { transform: translateY(-10px) translateX(-10px); opacity: 0.4; }
    75% { transform: translateY(-40px) translateX(20px); opacity: 0.7; }
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(49, 178, 224, 0.2) 0%, transparent 70%);
    animation: pulse-glow 4s infinite ease-in-out;
    pointer-events: none;
}

@keyframes pulse-glow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(49, 178, 224, 0.15);
    border: 1px solid rgba(49, 178, 224, 0.3);
    border-radius: 0;
    color: var(--terminal-accent);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.hero-title-accent {
    display: block;
    background: linear-gradient(135deg, var(--terminal-accent) 0%, #4ECDC4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-up-delay {
    animation: slideUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

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

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

/* ================================================
   BUTTON FIXES - Remove gold glow, blue background
   ================================================ */

.btn-grace {
    background: var(--grace-gradient);
    border: none;
    border-radius: 0;
    color: white;
    box-shadow: none;
}

.btn-grace:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    color: white;
}

/* Remove gold glow from CTA */
.btn-cta {
    background: var(--terminal-accent);
    border: 1px solid var(--terminal-accent);
    border-radius: 0;
    color: white;
    box-shadow: none;
}

.btn-cta:hover {
    background: #2a9ec7;
    border-color: #2a9ec7;
    box-shadow: 0 4px 15px rgba(49, 178, 224, 0.3);
    color: white;
}

/* ================================================
   QUICK ACTIONS - Smaller icons, more padding
   ================================================ */

.quick-action-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(49, 178, 224, 0.1);
    border: 1px solid rgba(49, 178, 224, 0.2);
    border-radius: 0;
    font-size: 1rem;
    color: var(--terminal-accent);
    flex-shrink: 0;
    padding: 1rem;
}

.quick-action-icon.grace-icon-bg {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.2);
    color: var(--grace-secondary);
}

.quick-action-card {
    padding: 1.75rem;
    gap: 1.5rem;
}

/* ================================================
   SECTION HEADER ROW
   ================================================ */

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chart-period-select {
    background: var(--terminal-surface);
    border: 1px solid var(--terminal-border);
    color: var(--terminal-text);
    border-radius: 0;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.85rem;
}

.chart-period-select:focus {
    border-color: var(--terminal-accent);
    box-shadow: 0 0 0 2px rgba(49, 178, 224, 0.2);
}

/* ================================================
   CHARTS GRID
   ================================================ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 991.98px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    padding: 1.5rem;
    min-height: 280px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--terminal-text-muted);
}

.chart-title i {
    color: var(--terminal-accent);
}

.chart-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--terminal-text);
    font-family: var(--font-family-heading);
}

.chart-container {
    position: relative;
    height: 220px;
    min-height: 180px;
}

.chart-container canvas {
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

/* ================================================
   TEAM AGENTS GRID
   ================================================ */

.team-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.team-agent-card {
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.team-agent-card:hover {
    transform: translateY(-4px);
    border-color: var(--terminal-accent);
}

.team-agent-card.grace-agent {
    border-color: rgba(155, 89, 182, 0.3);
}

.team-agent-card.grace-agent:hover {
    border-color: var(--grace-secondary);
}

.agent-status-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    color: var(--terminal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-status-badge.active .status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

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

.team-agent-avatar {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    font-size: 1.25rem;
    color: white;
}

.team-agent-avatar.grace { background: var(--grace-gradient); }
.team-agent-avatar.nyra { background: linear-gradient(135deg, #31B2E0, #4ECDC4); }
.team-agent-avatar.solari { background: linear-gradient(135deg, #FFD700, #FFE44D); color: #1a1a1a; }
.team-agent-avatar.liora { background: linear-gradient(135deg, #FF6B6B, #FF8E8E); }
.team-agent-avatar.elan { background: linear-gradient(135deg, #9B59B6, #B370CF); }
.team-agent-avatar.zevi { background: linear-gradient(135deg, #31B2E0, #4ECDC4); }
.team-agent-avatar.sage { background: linear-gradient(135deg, #4ECDC4, #6EDDD5); }
.team-agent-avatar.ruvo { background: linear-gradient(135deg, #8B4513, #A0522D); }
.team-agent-avatar.atlas { background: linear-gradient(135deg, #2c3e50, #3498db); }

.team-agent-name {
    font-family: var(--font-family-heading);
    font-size: 1rem;
    color: var(--terminal-text);
    margin-bottom: 0.25rem;
}

.team-agent-role {
    font-size: 0.75rem;
    color: var(--terminal-text-muted);
    margin-bottom: 0.75rem;
}

.team-agent-stats {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--terminal-border);
}

.agent-stat {
    text-align: center;
}

.agent-stat .stat-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--terminal-accent);
}

.agent-stat .stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--terminal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ================================================
   TERMINAL HEADING - Blue Background with Black & White Text
   ================================================ */

.terminal-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--terminal-accent), #4ECDC4);
    padding: 0.5rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    border-radius: 0;
    margin-bottom: 0;
    text-align: left;
    color: white;
}

/* Black accent text within heading */
.terminal-heading .heading-accent {
    color: #0d1117;
    font-weight: 600;
}

/* White text (default) */
.terminal-heading .heading-text {
    color: white;
}

.section-header-row .terminal-heading {
    margin-bottom: 0;
}

/* Terminal heading with icon - black icon for contrast */
.terminal-heading i {
    color: #0d1117;
    margin-right: 0.25rem;
    opacity: 1;
}

/* Variant: Smaller terminal heading */
.terminal-heading-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--terminal-accent), #4ECDC4);
    padding: 0.375rem 1rem;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    border-radius: 0;
    color: white;
}

.terminal-heading-sm i {
    color: #0d1117;
}

/* Grace-themed terminal heading */
.terminal-heading.grace {
    background: var(--grace-gradient);
}

.terminal-heading.grace i {
    color: #2a1238;
}

/* Inverted variant - black background with blue/white text */
.terminal-heading.inverted {
    background: #0d1117;
    border: 1px solid var(--terminal-accent);
    color: var(--terminal-accent);
}

.terminal-heading.inverted i {
    color: white;
}

/* ================================================
   PRODUCT COST CALCULATOR
   Agnes's Vegan Bakery
   ================================================ */

/* Calculator Card */
.calculator-card {
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.calculator-header {
    background: linear-gradient(135deg, #9B59B6 0%, #B19CD9 100%);
    color: white;
    border-bottom: none;
}

.calculator-header h5 {
    color: white;
}

.calculator-header .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.calculator-header .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Calculator Tabs - Modern Pill Style */
.calculator-tabs {
    border: none;
    background: rgba(155, 89, 182, 0.08);
    border-radius: 12px;
    padding: 6px;
    display: inline-flex;
    gap: 4px;
    width: 100%;
}

.calculator-tabs .nav-item {
    flex: 1;
}

.calculator-tabs .nav-link {
    color: var(--terminal-text-muted);
    border: none;
    background: transparent;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.calculator-tabs .nav-link:hover {
    color: var(--terminal-text);
    background: rgba(155, 89, 182, 0.12);
}

.calculator-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #9B59B6 0%, #B19CD9 100%);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.calculator-tabs .nav-link i {
    font-size: 0.9rem;
}

.calculator-tabs .nav-link.active i {
    color: white;
}

/* Calculate Button */
.calculate-btn {
    background: linear-gradient(135deg, #9B59B6 0%, #B19CD9 100%);
    border: none;
    padding: 0.75rem 2.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.4);
}

/* Ingredient List */
.ingredient-list {
    min-height: 100px;
}

.ingredient-header {
    display: grid;
    grid-template-columns: 2fr 1fr 100px 80px 40px;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--terminal-border);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--terminal-text-muted);
}

.ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr 100px 80px 40px;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--terminal-border);
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.ingredient-row:last-of-type {
    border-bottom: none;
}

.ingredient-row .form-control,
.ingredient-row .form-select {
    background: var(--terminal-surface);
    color: var(--terminal-text);
    border-color: var(--terminal-border);
    font-size: 0.875rem;
}

.ingredient-row .form-control:focus,
.ingredient-row .form-select:focus {
    border-color: #9B59B6;
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.2);
}

.ingredient-row .input-group-text {
    background: var(--terminal-surface);
    color: var(--terminal-text-muted);
    border-color: var(--terminal-border);
    font-size: 0.875rem;
}

.ingredient-row .btn-outline-danger {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.ingredient-total,
.packaging-total,
.labor-total,
.overhead-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--terminal-text);
}

/* Mini Metric Cards for Results */
.metric-mini-card {
    border: 1px solid var(--terminal-border);
    transition: all 0.3s ease;
}

.metric-mini-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(49, 178, 224, 0.15);
    border-color: var(--terminal-accent);
}

.metric-mini-card .metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--terminal-accent);
    line-height: 1.2;
}

.metric-mini-card .metric-label {
    font-size: 0.7rem;
    color: var(--terminal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 280px;
    padding: 1rem;
}

/* Detailed Breakdown */
.detailed-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--terminal-border);
    align-items: center;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-total {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    padding: 1rem 0 0;
    margin-top: 0.5rem;
    border-top: 2px solid var(--terminal-accent);
    align-items: center;
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--terminal-text);
}

.breakdown-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.breakdown-value {
    font-weight: 600;
    color: var(--terminal-text);
    text-align: right;
    min-width: 70px;
}

.breakdown-percent {
    font-size: 0.875rem;
    color: var(--terminal-text-muted);
    text-align: right;
    min-width: 50px;
}

/* Viability Score Display */
.viability-score-display {
    font-size: 1rem;
}

.viability-score-value {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.viability-score-max {
    font-size: 1.5rem;
    color: var(--terminal-text-muted);
    font-weight: 400;
}

.viability-score-value.excellent {
    color: #10b981;
}

.viability-score-value.good {
    color: #31B2E0;
}

.viability-score-value.fair {
    color: #f59e0b;
}

.viability-score-value.poor {
    color: #ef4444;
}

/* Viability Card States */
#viabilityCard {
    transition: all 0.3s ease;
}

#viabilityCard.viability-excellent {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
}

#viabilityCard.viability-good {
    border-left: 4px solid #31B2E0;
    background: linear-gradient(135deg, rgba(49, 178, 224, 0.1) 0%, transparent 100%);
}

#viabilityCard.viability-fair {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
}

#viabilityCard.viability-poor {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%);
}

.viability-recommendation {
    max-width: 600px;
    margin: 0 auto;
    color: var(--terminal-text);
    font-size: 1rem;
}

/* Calculator Form Inputs */
#costCalculatorSection .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--terminal-text);
    margin-bottom: 0.375rem;
}

#costCalculatorSection .form-control,
#costCalculatorSection .form-select {
    background: var(--terminal-surface);
    color: var(--terminal-text);
    border-color: var(--terminal-border);
}

#costCalculatorSection .form-control:focus,
#costCalculatorSection .form-select:focus {
    border-color: #9B59B6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.15);
}

#costCalculatorSection .input-group-text {
    background: var(--terminal-surface);
    color: var(--terminal-text-muted);
    border-color: var(--terminal-border);
}

#costCalculatorSection .alert-info {
    background: rgba(49, 178, 224, 0.1);
    border: 1px solid rgba(49, 178, 224, 0.3);
    color: var(--terminal-text);
}

/* Responsive Calculator */
@media (max-width: 992px) {
    .ingredient-header,
    .ingredient-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .ingredient-header {
        display: none;
    }

    .ingredient-row {
        padding: 1rem;
        background: var(--terminal-surface);
        border-radius: var(--radius-md);
        margin-bottom: 0.5rem;
        border: 1px solid var(--terminal-border);
    }

    .ingredient-row .btn-outline-danger {
        justify-self: end;
    }

    .breakdown-item,
    .breakdown-total {
        grid-template-columns: 1fr auto;
    }

    .breakdown-percent {
        display: none;
    }

    .metric-mini-card .metric-value {
        font-size: 1.1rem;
    }

    .metric-mini-card .metric-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .calculator-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .calculator-tabs .nav-link span {
        display: none;
    }

    .viability-score-value {
        font-size: 2.5rem;
    }

    .viability-score-max {
        font-size: 1rem;
    }
}

/* ================================================
   LIGHT MODE - COST CALCULATOR
   ================================================ */

/* Light mode calculator styles */
body.light-mode .calculator-card,
body:not(.dark-mode) .calculator-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(155, 89, 182, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.light-mode .calculator-tabs,
body:not(.dark-mode) .calculator-tabs {
    background: rgba(155, 89, 182, 0.06);
}

body.light-mode .calculator-tabs .nav-link,
body:not(.dark-mode) .calculator-tabs .nav-link {
    color: #64748b;
}

body.light-mode .calculator-tabs .nav-link:hover,
body:not(.dark-mode) .calculator-tabs .nav-link:hover {
    color: #1e293b;
    background: rgba(155, 89, 182, 0.1);
}

body.light-mode .calculator-tabs .nav-link.active,
body:not(.dark-mode) .calculator-tabs .nav-link.active {
    color: white;
}

body.light-mode #costCalculatorSection .form-control,
body.light-mode #costCalculatorSection .form-select,
body:not(.dark-mode) #costCalculatorSection .form-control,
body:not(.dark-mode) #costCalculatorSection .form-select {
    background: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}

body.light-mode #costCalculatorSection .form-control:focus,
body.light-mode #costCalculatorSection .form-select:focus,
body:not(.dark-mode) #costCalculatorSection .form-control:focus,
body:not(.dark-mode) #costCalculatorSection .form-select:focus {
    border-color: #9B59B6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.15);
}

body.light-mode #costCalculatorSection .input-group-text,
body:not(.dark-mode) #costCalculatorSection .input-group-text {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

body.light-mode #costCalculatorSection .form-label,
body:not(.dark-mode) #costCalculatorSection .form-label {
    color: #334155;
}

body.light-mode .ingredient-header,
body:not(.dark-mode) .ingredient-header {
    color: #64748b;
    border-bottom-color: #e2e8f0;
}

body.light-mode .ingredient-row,
body:not(.dark-mode) .ingredient-row {
    border-bottom-color: #f1f5f9;
}

body.light-mode .ingredient-row .form-control,
body.light-mode .ingredient-row .form-select,
body:not(.dark-mode) .ingredient-row .form-control,
body:not(.dark-mode) .ingredient-row .form-select {
    background: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}

body.light-mode .ingredient-row .input-group-text,
body:not(.dark-mode) .ingredient-row .input-group-text {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

body.light-mode .ingredient-total,
body.light-mode .packaging-total,
body.light-mode .labor-total,
body.light-mode .overhead-total,
body:not(.dark-mode) .ingredient-total,
body:not(.dark-mode) .packaging-total,
body:not(.dark-mode) .labor-total,
body:not(.dark-mode) .overhead-total {
    color: #1e293b;
}

body.light-mode .metric-mini-card,
body:not(.dark-mode) .metric-mini-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-mode .metric-mini-card:hover,
body:not(.dark-mode) .metric-mini-card:hover {
    border-color: #9B59B6;
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.12);
}

body.light-mode .metric-mini-card .metric-value,
body:not(.dark-mode) .metric-mini-card .metric-value {
    color: #9B59B6;
}

body.light-mode .metric-mini-card .metric-label,
body:not(.dark-mode) .metric-mini-card .metric-label {
    color: #64748b;
}

body.light-mode .breakdown-label,
body.light-mode .breakdown-value,
body:not(.dark-mode) .breakdown-label,
body:not(.dark-mode) .breakdown-value {
    color: #1e293b;
}

body.light-mode .breakdown-percent,
body:not(.dark-mode) .breakdown-percent {
    color: #64748b;
}

body.light-mode .breakdown-item,
body:not(.dark-mode) .breakdown-item {
    border-bottom-color: #f1f5f9;
}

body.light-mode .breakdown-total,
body:not(.dark-mode) .breakdown-total {
    border-top-color: #9B59B6;
}

body.light-mode #viabilityCard,
body:not(.dark-mode) #viabilityCard {
    background: #ffffff;
}

body.light-mode .viability-recommendation,
body:not(.dark-mode) .viability-recommendation {
    color: #334155;
}

body.light-mode .viability-score-max,
body:not(.dark-mode) .viability-score-max {
    color: #94a3b8;
}

body.light-mode #costCalculatorSection .alert-info,
body:not(.dark-mode) #costCalculatorSection .alert-info {
    background: rgba(155, 89, 182, 0.08);
    border-color: rgba(155, 89, 182, 0.2);
    color: #334155;
}

body.light-mode #costCalculatorSection .card-header,
body:not(.dark-mode) #costCalculatorSection .card-header {
    background: rgba(155, 89, 182, 0.05);
    border-bottom-color: #e2e8f0;
}

body.light-mode #costCalculatorSection .card-header h6,
body:not(.dark-mode) #costCalculatorSection .card-header h6 {
    color: #1e293b;
}

/* Light mode responsive ingredient rows */
@media (max-width: 992px) {
    body.light-mode .ingredient-row,
    body:not(.dark-mode) .ingredient-row {
        background: #f8fafc;
        border-color: #e2e8f0;
    }
}

/* ================================================
   DARK MODE - COST CALCULATOR (Explicit)
   ================================================ */

/* Ensure all text is visible in dark mode */
body.dark-mode .calculator-card {
    background: rgba(22, 27, 34, 0.95);
    border-color: rgba(155, 89, 182, 0.3);
}

body.dark-mode .calculator-tabs {
    background: rgba(155, 89, 182, 0.15);
}

body.dark-mode .calculator-tabs .nav-link {
    color: #c9d1d9;
}

body.dark-mode .calculator-tabs .nav-link:hover {
    color: #ffffff;
    background: rgba(155, 89, 182, 0.2);
}

body.dark-mode #costCalculatorSection .form-label {
    color: #c9d1d9;
}

body.dark-mode #costCalculatorSection .form-control,
body.dark-mode #costCalculatorSection .form-select {
    background: #21262d;
    color: #f0f6fc;
    border-color: #30363d;
}

body.dark-mode #costCalculatorSection .form-control::placeholder {
    color: #8b949e;
}

body.dark-mode #costCalculatorSection .input-group-text {
    background: #21262d;
    color: #8b949e;
    border-color: #30363d;
}

body.dark-mode .ingredient-header {
    color: #8b949e;
    border-bottom-color: #30363d;
}

body.dark-mode .ingredient-row {
    border-bottom-color: #21262d;
}

body.dark-mode .ingredient-row .form-control,
body.dark-mode .ingredient-row .form-select {
    background: #21262d;
    color: #f0f6fc;
    border-color: #30363d;
}

body.dark-mode .ingredient-row .input-group-text {
    background: #161b22;
    color: #8b949e;
    border-color: #30363d;
}

body.dark-mode .ingredient-total,
body.dark-mode .packaging-total,
body.dark-mode .labor-total,
body.dark-mode .overhead-total {
    color: #f0f6fc;
}

body.dark-mode .ingredient-total .text-primary,
body.dark-mode .packaging-total .text-primary,
body.dark-mode .labor-total .text-primary,
body.dark-mode .overhead-total .text-primary {
    color: #B19CD9 !important;
}

/* Dark mode metric cards */
body.dark-mode .metric-mini-card {
    background: #161b22;
    border-color: #30363d;
}

body.dark-mode .metric-mini-card:hover {
    border-color: #9B59B6;
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.25);
}

body.dark-mode .metric-mini-card .metric-value {
    color: #B19CD9;
}

body.dark-mode .metric-mini-card .metric-label {
    color: #8b949e;
}

/* Dark mode breakdown section - EXPLICIT TEXT COLORS */
body.dark-mode .breakdown-label {
    color: #f0f6fc;
}

body.dark-mode .breakdown-value {
    color: #f0f6fc;
    font-weight: 600;
}

body.dark-mode .breakdown-percent {
    color: #8b949e;
}

body.dark-mode .breakdown-item {
    border-bottom-color: #21262d;
}

body.dark-mode .breakdown-total {
    border-top-color: #9B59B6;
}

body.dark-mode .breakdown-total .breakdown-label,
body.dark-mode .breakdown-total .breakdown-value {
    color: #f0f6fc;
}

/* Dark mode detailed breakdown card */
body.dark-mode #costCalculatorSection .card {
    background: #161b22;
    border-color: #30363d;
}

body.dark-mode #costCalculatorSection .card-header {
    background: rgba(155, 89, 182, 0.1);
    border-bottom-color: #30363d;
}

body.dark-mode #costCalculatorSection .card-header h6 {
    color: #f0f6fc;
}

/* Dark mode viability card */
body.dark-mode #viabilityCard {
    background: #161b22;
    border-color: #30363d;
}

body.dark-mode #viabilityCard h5 {
    color: #f0f6fc;
}

body.dark-mode .viability-recommendation {
    color: #c9d1d9;
}

body.dark-mode .viability-score-max {
    color: #8b949e;
}

/* Dark mode chart container */
body.dark-mode .chart-container {
    background: transparent;
}

/* Dark mode alert */
body.dark-mode #costCalculatorSection .alert-info {
    background: rgba(155, 89, 182, 0.15);
    border-color: rgba(155, 89, 182, 0.3);
    color: #c9d1d9;
}

/* Dark mode responsive ingredient rows */
@media (max-width: 992px) {
    body.dark-mode .ingredient-row {
        background: #21262d;
        border-color: #30363d;
    }
}

/* ================================================
   AGENT MODAL - Improved Design
   ================================================ */
#agentModal .modal-dialog {
    max-width: 680px;
}

#agentModal .modal-content {
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
}

#agentModal .modal-header {
    background: var(--bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--border-light, #e2e8f0);
    padding: 1.25rem 1.5rem;
}

#agentModal .modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-family-heading, 'GFS Didot', Georgia, serif);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
}

.agent-modal-icon {
    font-size: 1.75rem;
}

.agent-modal-name {
    font-weight: 500;
}

#agentModal .modal-body {
    padding: 0;
}

.agent-modal-content {
    padding: 1.5rem;
}

/* Hero Section */
.agent-modal-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid;
    border-color: inherit;
}

.agent-modal-hero-left {
    flex: 1;
}

.agent-modal-role {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.agent-modal-tagline {
    font-style: italic;
    color: var(--text-secondary, #4a5568);
    margin-bottom: 0.75rem;
}

.agent-modal-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #10b981;
}

.agent-modal-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.agent-modal-status .status-dot.inactive {
    background: #6b7280;
    animation: none;
}

.agent-modal-icon-large {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 2.5rem;
}

/* Modal Sections */
.agent-modal-section {
    margin-bottom: 1.5rem;
}

.agent-modal-section:last-of-type {
    margin-bottom: 0;
}

.agent-modal-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #4a5568);
    margin-bottom: 1rem;
}

.agent-modal-section-title i {
    color: var(--terminal-accent, #31B2E0);
}

.agent-modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary, #1a1a1a);
    margin: 0;
}

/* Performance Metrics */
.agent-modal-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.agent-metric-card {
    padding: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border-left: 3px solid var(--agent-color, var(--terminal-accent));
    text-align: center;
}

.agent-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--agent-color, var(--terminal-accent));
    margin-bottom: 0.25rem;
}

.agent-metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary, #4a5568);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Capabilities */
.agent-modal-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.capability-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: rgba(49, 178, 224, 0.08);
    border: 1px solid rgba(49, 178, 224, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary, #1a1a1a);
}

.capability-tag i {
    color: var(--agent-color, #10b981);
    font-size: 0.75rem;
}

/* Use Cases / Quick Actions */
.agent-modal-usecases {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.usecase-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.usecase-btn:hover {
    background: rgba(49, 178, 224, 0.08);
    border-color: var(--agent-color, var(--terminal-accent));
    transform: translateX(4px);
}

.usecase-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--agent-color, var(--terminal-accent))20, var(--agent-color, var(--terminal-accent))40);
    border-radius: 10px;
    color: var(--agent-color, var(--terminal-accent));
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.usecase-name {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.125rem;
}

.usecase-description {
    font-size: 0.85rem;
    color: var(--text-secondary, #4a5568);
}

.usecase-arrow {
    color: var(--text-tertiary, #718096);
    transition: transform 0.2s ease;
}

.usecase-btn:hover .usecase-arrow {
    transform: translateX(4px);
    color: var(--agent-color, var(--terminal-accent));
}

/* Action Buttons */
.agent-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-light, #e2e8f0);
}

/* Remove default modal footer since we have custom actions */
#agentModal .modal-footer {
    display: none;
}

/* Dark Mode Support for Agent Modal */
body.dark-mode #agentModal .modal-content {
    background: var(--terminal-surface, #161b22);
    border-color: var(--terminal-border, #30363d);
}

body.dark-mode #agentModal .modal-header {
    background: var(--terminal-bg, #0d1117);
    border-color: var(--terminal-border, #30363d);
}

body.dark-mode #agentModal .modal-title,
body.dark-mode .agent-modal-name {
    color: var(--terminal-text, #c9d1d9);
}

body.dark-mode .agent-modal-hero {
    border-color: var(--terminal-border, #30363d);
}

body.dark-mode .agent-modal-tagline,
body.dark-mode .agent-modal-description {
    color: var(--terminal-text, #c9d1d9);
}

body.dark-mode .agent-modal-section-title {
    color: var(--terminal-text-muted, #8b949e);
}

body.dark-mode .agent-metric-card {
    background: var(--terminal-bg, #0d1117);
}

body.dark-mode .agent-metric-label {
    color: var(--terminal-text-muted, #8b949e);
}

body.dark-mode .capability-tag {
    background: rgba(49, 178, 224, 0.1);
    border-color: rgba(49, 178, 224, 0.3);
    color: var(--terminal-text, #c9d1d9);
}

body.dark-mode .usecase-btn {
    background: var(--terminal-bg, #0d1117);
    border-color: var(--terminal-border, #30363d);
}

body.dark-mode .usecase-btn:hover {
    background: rgba(49, 178, 224, 0.1);
}

body.dark-mode .usecase-name {
    color: var(--terminal-text, #c9d1d9);
}

body.dark-mode .usecase-description {
    color: var(--terminal-text-muted, #8b949e);
}

body.dark-mode .agent-modal-actions {
    border-color: var(--terminal-border, #30363d);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .agent-modal-hero {
        flex-direction: column-reverse;
        gap: 1rem;
        text-align: center;
    }

    .agent-modal-icon-large {
        margin: 0 auto;
    }

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

    .usecase-btn {
        padding: 0.875rem 1rem;
    }

    .usecase-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .agent-modal-actions {
        flex-direction: column;
    }

    .agent-modal-actions .btn {
        width: 100%;
    }
}

/* ================================================
   WORKFLOWS PAGE - Equal Height Layout
   ================================================ */
.text-accent {
    color: var(--terminal-accent, #31B2E0) !important;
}

.text-teal {
    color: var(--primary-teal, #4ECDC4) !important;
}

/* Workflows Quota Badge */
.workflows-quota-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.workflows-quota-badge .quota-label {
    color: var(--text-secondary, #4a5568);
}

.workflows-quota-badge .quota-value {
    color: var(--primary-teal, #4ECDC4);
    font-weight: 600;
}

.workflows-main-row {
    align-items: stretch;
}

.workflow-card {
    display: flex;
    flex-direction: column;
}

.workflow-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.workflows-list-container {
    flex: 1;
    min-height: 400px;
    max-height: 600px;
    overflow: hidden;
}

.workflows-scroll-area {
    height: 100%;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for workflows list */
.workflows-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.workflows-scroll-area::-webkit-scrollbar-track {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 3px;
}

.workflows-scroll-area::-webkit-scrollbar-thumb {
    background: var(--terminal-accent, #31B2E0);
    border-radius: 3px;
}

.workflows-scroll-area::-webkit-scrollbar-thumb:hover {
    background: var(--primary-teal, #4ECDC4);
}

/* Workflow Card Item Styles */
.workflow-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-item:hover {
    background: rgba(49, 178, 224, 0.08);
    border-color: var(--terminal-accent, #31B2E0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 178, 224, 0.15);
}

.workflow-item:last-child {
    margin-bottom: 0;
}

.workflow-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.workflow-item-name {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0;
    font-size: 1rem;
}

.workflow-item-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.workflow-item-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.workflow-item-status.inactive {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.workflow-item-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.workflow-item-description {
    font-size: 0.875rem;
    color: var(--text-secondary, #4a5568);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.workflow-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-tertiary, #718096);
}

.workflow-item-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.workflow-item-meta i {
    color: var(--terminal-accent, #31B2E0);
}

.workflow-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light, #e2e8f0);
}

.workflow-item-actions .btn {
    flex: 1;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Dark mode support for workflows */
body.dark-mode .workflow-item {
    background: var(--terminal-bg, #0d1117);
    border-color: var(--terminal-border, #30363d);
}

body.dark-mode .workflow-item:hover {
    background: rgba(49, 178, 224, 0.1);
}

body.dark-mode .workflow-item-name {
    color: var(--terminal-text, #c9d1d9);
}

body.dark-mode .workflow-item-description {
    color: var(--terminal-text-muted, #8b949e);
}

body.dark-mode .workflow-item-actions {
    border-color: var(--terminal-border, #30363d);
}

body.dark-mode .workflows-scroll-area::-webkit-scrollbar-track {
    background: var(--terminal-bg, #0d1117);
}

/* Super Admin Badge - Subtle indicator */
.super-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.super-admin-badge i {
    font-size: 0.55rem;
    opacity: 0.8;
}

/* Dark mode super admin badge */
body.dark-mode .super-admin-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}

/* Workflow Empty State */
.workflow-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary, #4a5568);
}

.workflow-empty-state .empty-icon {
    font-size: 3rem;
    color: var(--terminal-accent, #31B2E0);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.workflow-empty-state p {
    margin: 0;
    font-size: 1rem;
}

.workflow-empty-state .empty-hint {
    font-size: 0.9rem;
    color: var(--text-tertiary, #718096);
    margin-top: 0.5rem;
}

body.dark-mode .workflow-empty-state {
    color: var(--terminal-text-muted, #8b949e);
}

body.dark-mode .workflow-empty-state .empty-hint {
    color: var(--terminal-text-muted, #8b949e);
    opacity: 0.7;
}

/* Grace Button Style */
.btn-grace {
    background: linear-gradient(135deg, #9B59B6, #B19CD9);
    color: white;
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-grace:hover {
    background: linear-gradient(135deg, #8E44AD, #9B59B6);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.btn-grace:focus {
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.4);
}

.btn-grace i {
    margin-right: 0.375rem;
}

/* ================================================
   WCAG AAA ACCESSIBILITY ENHANCEMENTS
   ================================================ */

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background: var(--terminal-accent, #31B2E0);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-to-main:focus {
    top: 0;
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* Enhanced Focus Indicators - AAA Compliant (3px solid, high contrast) */
:focus-visible {
    outline: 3px solid var(--terminal-accent, #31B2E0) !important;
    outline-offset: 3px !important;
}

/* Button focus states */
.btn:focus-visible,
button:focus-visible {
    outline: 3px solid var(--terminal-accent, #31B2E0) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(49, 178, 224, 0.25) !important;
}

/* Link focus states */
a:focus-visible {
    outline: 3px solid var(--terminal-accent, #31B2E0) !important;
    outline-offset: 2px !important;
    border-radius: 2px;
}

/* Form input focus states */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--terminal-accent, #31B2E0) !important;
    outline-offset: 0 !important;
    border-color: var(--terminal-accent, #31B2E0) !important;
    box-shadow: 0 0 0 4px rgba(49, 178, 224, 0.2) !important;
}

/* Card/interactive element focus */
.card:focus-visible,
.workflow-item:focus-visible,
.agent-card:focus-visible {
    outline: 3px solid var(--terminal-accent, #31B2E0) !important;
    outline-offset: 2px !important;
}

/* Enhanced Text Contrast - WCAG AAA (7:1 ratio) */
.text-aaa-primary {
    color: #000000 !important; /* Maximum contrast on white */
}

.text-aaa-secondary {
    color: #333333 !important; /* 12.6:1 on white */
}

body.dark-mode .text-aaa-primary {
    color: #ffffff !important;
}

body.dark-mode .text-aaa-secondary {
    color: #e0e0e0 !important;
}

/* Ensure sufficient text contrast in key areas */
.form-label {
    color: var(--text-primary, #1a1a1a);
    font-weight: 500;
}

body.dark-mode .form-label {
    color: var(--terminal-text, #c9d1d9);
}

/* Error states with AAA contrast */
.form-control.is-invalid {
    border-color: #c41e3a !important; /* Darker red for better contrast */
}

.invalid-feedback {
    color: #a91b2e; /* 7:1 contrast on white background */
    font-weight: 500;
}

body.dark-mode .invalid-feedback {
    color: #ff6b6b; /* High contrast on dark */
}

/* Success states with AAA contrast */
.form-control.is-valid {
    border-color: #0d6832 !important; /* Darker green for better contrast */
}

.valid-feedback {
    color: #0d6832;
    font-weight: 500;
}

body.dark-mode .valid-feedback {
    color: #4ade80;
}

/* Ensure links are distinguishable */
a:not(.btn) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:not(.btn):hover {
    text-decoration-thickness: 2px;
}

/* Navigation items don't need underline */
.sidebar-nav-item,
.footer-link,
.nav-link {
    text-decoration: none;
}

/* Minimum touch target size (44x44px for AAA) */
.btn,
button,
[role="button"],
a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 1rem;
}

.btn-sm {
    min-height: 36px;
    min-width: 36px;
    padding: 0.375rem 0.75rem;
}

/* Interactive cards should have clear keyboard interaction */
[tabindex="0"] {
    cursor: pointer;
}

[tabindex="0"]:focus-visible {
    outline: 3px solid var(--terminal-accent, #31B2E0);
    outline-offset: 2px;
}

/* Status indicators should not rely solely on color */
.agent-status::before,
.workflow-item-status::before {
    content: "";
}

.agent-status.active::before {
    content: "✓ ";
}

.agent-status.inactive::before {
    content: "○ ";
}

/* Screen reader only text utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Visible focus ring for high contrast mode */
@media (forced-colors: active) {
    :focus-visible {
        outline: 3px solid CanvasText !important;
    }

    .btn:focus-visible {
        outline: 3px solid ButtonText !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .health-dot {
        animation: none !important;
    }

    .grace-pulse {
        animation: none !important;
    }
}

/* Large text option (AAA recommends at least 18px or 14px bold) */
.text-large {
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Ensure proper line height for readability (AAA: 1.5 minimum) */
p, li, dd, dt {
    line-height: 1.6;
}

/* Paragraph spacing (AAA: at least 1.5x font size) */
p + p {
    margin-top: 1.5em;
}

/* Letter spacing for readability */
body {
    letter-spacing: 0.01em;
}

/* Word spacing for readability */
p, li {
    word-spacing: 0.05em;
}
