/* ═══════════════════════════════════════════════════════════════════════════════════
   FINANCIAL PLANNING & ANALYSIS — UNIFIED DESIGN SYSTEM
   Enterprise-Grade Design inspired by Oracle EPM, SAP Analytics Cloud, Anaplan
   
   Version: 2.0.0
   Last Updated: 2026-03-10
   
   USAGE:
   - Include this file in App.razor or _Host.cshtml
   - Use fp-* prefix for all Financial Planning components
   - Supports light/dark themes via data-theme attribute
   ═══════════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════════
   1. DESIGN TOKENS — Core Variables
   ═══════════════════════════════════════════════════════════════════════════════════ */

:root {
    /* ─── Brand Colors ─── */
    --fp-brand-primary: #0f172a;
    --fp-brand-secondary: #1e293b;
    --fp-brand-accent: #3b82f6;
    --fp-brand-accent-hover: #2563eb;
    --fp-brand-accent-light: #dbeafe;

    /* ─── Semantic Colors ─── */
    --fp-success: #10b981;
    --fp-success-light: #d1fae5;
    --fp-warning: #f59e0b;
    --fp-warning-light: #fef3c7;
    --fp-danger: #ef4444;
    --fp-danger-light: #fee2e2;
    --fp-info: #06b6d4;
    --fp-info-light: #cffafe;

    /* ─── Neutral Palette ─── */
    --fp-gray-50: #f8fafc;
    --fp-gray-100: #f1f5f9;
    --fp-gray-200: #e2e8f0;
    --fp-gray-300: #cbd5e1;
    --fp-gray-400: #94a3b8;
    --fp-gray-500: #64748b;
    --fp-gray-600: #475569;
    --fp-gray-700: #334155;
    --fp-gray-800: #1e293b;
    --fp-gray-900: #0f172a;

    /* ─── Surface & Background ─── */
    --fp-surface: #ffffff;
    --fp-surface-elevated: #ffffff;
    --fp-surface-sunken: #f8fafc;
    --fp-background: #f1f5f9;
    --fp-backdrop: rgba(15, 23, 42, 0.5);

    /* ─── Text Colors ─── */
    --fp-text-primary: #0f172a;
    --fp-text-secondary: #475569;
    --fp-text-tertiary: #94a3b8;
    --fp-text-inverse: #ffffff;
    --fp-text-link: #3b82f6;

    /* ─── Sidebar / NavMenu Colors ─── */
    --fp-sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --fp-sidebar-surface: #1e293b;
    --fp-sidebar-border: rgba(255,255,255,0.08);
    --fp-sidebar-text: #e2e8f0;
    --fp-sidebar-text-muted: #94a3b8;
    --fp-sidebar-text-dim: #64748b;
    --fp-sidebar-accent: #3b82f6;
    --fp-sidebar-highlight: #fbbf24;

    /* ─── Border Colors ─── */
    --fp-border: #e2e8f0;
    --fp-border-strong: #cbd5e1;
    --fp-border-accent: #3b82f6;

    /* ─── Spacing Scale ─── */
    --fp-space-1: 0.25rem;   /* 4px */
    --fp-space-2: 0.5rem;    /* 8px */
    --fp-space-3: 0.75rem;   /* 12px */
    --fp-space-4: 1rem;      /* 16px */
    --fp-space-5: 1.25rem;   /* 20px */
    --fp-space-6: 1.5rem;    /* 24px */
    --fp-space-8: 2rem;      /* 32px */
    --fp-space-10: 2.5rem;   /* 40px */
    --fp-space-12: 3rem;     /* 48px */

    /* ─── Typography ─── */
    --fp-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fp-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    
    --fp-text-xs: 0.75rem;
    --fp-text-sm: 0.875rem;
    --fp-text-base: 1rem;
    --fp-text-lg: 1.125rem;
    --fp-text-xl: 1.25rem;
    --fp-text-2xl: 1.5rem;
    --fp-text-3xl: 1.875rem;
    --fp-text-4xl: 2.25rem;

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

    --fp-leading-tight: 1.25;
    --fp-leading-normal: 1.5;
    --fp-leading-relaxed: 1.75;

    /* ─── Border Radius ─── */
    --fp-radius-sm: 4px;
    --fp-radius-md: 6px;
    --fp-radius-lg: 8px;
    --fp-radius-xl: 12px;
    --fp-radius-2xl: 16px;
    --fp-radius-full: 9999px;

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

    /* ─── Transitions ─── */
    --fp-transition-fast: 150ms ease;
    --fp-transition-normal: 250ms ease;
    --fp-transition-slow: 350ms ease;

    /* ─── Z-Index Scale ─── */
    --fp-z-dropdown: 100;
    --fp-z-sticky: 200;
    --fp-z-modal: 300;
    --fp-z-popover: 400;
    --fp-z-tooltip: 500;
    --fp-z-toast: 600;

    /* ─── Layout ─── */
    --fp-header-height: 56px;
    --fp-sidebar-width: 280px;
    --fp-sidebar-collapsed: 64px;
    --fp-panel-width: 320px;
    --fp-content-max: 1600px;
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   2. DARK THEME OVERRIDES
   Supports Bootstrap (data-bs-theme), custom (data-theme), and class-based (.fp-dark)
   ═══════════════════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"],
[data-theme="dark"],
.fp-dark {
    --fp-brand-primary: #e2e8f0;
    --fp-brand-secondary: #cbd5e1;
    --fp-brand-accent: #60a5fa;
    --fp-brand-accent-hover: #93c5fd;
    --fp-brand-accent-light: #1e3a5f;

    --fp-surface: #1e293b;
    --fp-surface-elevated: #334155;
    --fp-surface-sunken: #0f172a;
    --fp-background: #0f172a;
    --fp-backdrop: rgba(0, 0, 0, 0.7);

    --fp-text-primary: #f1f5f9;
    --fp-text-secondary: #94a3b8;
    --fp-text-tertiary: #64748b;
    --fp-text-inverse: #0f172a;

    --fp-border: #334155;
    --fp-border-strong: #475569;

    --fp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --fp-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --fp-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    
    /* Additional dark mode tokens for Financial Planning tabs */
    --fp-sidebar-bg: linear-gradient(180deg, #0a0e17 0%, #151c2c 100%);
    --fp-sidebar-surface: #151c2c;
    --fp-gray-50: #1e293b;
    --fp-gray-100: #334155;
    --fp-gray-200: #475569;
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   3. BASE RESET & UTILITIES
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--fp-background);
    font-family: var(--fp-font-family);
    color: var(--fp-text-primary);
    overflow: hidden;
}

.fp-shell * {
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   4. HEADER COMPONENT
   Enterprise header with branding, navigation, and actions
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--fp-header-height);
    padding: 0 var(--fp-space-6);
    background: var(--fp-brand-primary);
    color: var(--fp-text-inverse);
    flex-shrink: 0;
    z-index: var(--fp-z-sticky);
}

.fp-header-left {
    display: flex;
    align-items: center;
    gap: var(--fp-space-4);
}

.fp-header-center {
    display: flex;
    align-items: center;
    gap: var(--fp-space-3);
}

.fp-header-right {
    display: flex;
    align-items: center;
    gap: var(--fp-space-3);
}

.fp-logo {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
    font-weight: var(--fp-font-bold);
    font-size: var(--fp-text-lg);
    letter-spacing: -0.02em;
}

.fp-logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fp-brand-accent);
    border-radius: var(--fp-radius-md);
    font-size: var(--fp-text-base);
}

.fp-header-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
}

.fp-header-title {
    font-size: var(--fp-text-sm);
    font-weight: var(--fp-font-medium);
    opacity: 0.9;
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   5. PAGE HEADER COMPONENT
   Title bar below main header for page-specific info
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--fp-space-4) var(--fp-space-6);
    background: var(--fp-surface);
    border-bottom: 1px solid var(--fp-border);
    flex-shrink: 0;
}

.fp-page-header-left {
    display: flex;
    align-items: center;
    gap: var(--fp-space-4);
}

.fp-page-header-right {
    display: flex;
    align-items: center;
    gap: var(--fp-space-3);
}

.fp-page-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fp-brand-accent-light);
    color: var(--fp-brand-accent);
    border-radius: var(--fp-radius-lg);
    font-size: var(--fp-text-lg);
}

.fp-page-title-group {
    display: flex;
    flex-direction: column;
    gap: var(--fp-space-1);
}

.fp-page-title {
    font-size: var(--fp-text-xl);
    font-weight: var(--fp-font-semibold);
    color: var(--fp-text-primary);
    margin: 0;
    line-height: var(--fp-leading-tight);
}

.fp-page-subtitle {
    font-size: var(--fp-text-sm);
    color: var(--fp-text-secondary);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   6. CONTEXT BAR COMPONENT
   Unified scenario/branch/year selector bar
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--fp-space-3) var(--fp-space-6);
    background: var(--fp-surface-sunken);
    border-bottom: 1px solid var(--fp-border);
    gap: var(--fp-space-4);
    flex-shrink: 0;
}

.fp-context-selectors {
    display: flex;
    align-items: center;
    gap: var(--fp-space-4);
    flex-wrap: wrap;
}

.fp-context-selector {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
}

.fp-context-label {
    font-size: var(--fp-text-xs);
    font-weight: var(--fp-font-medium);
    color: var(--fp-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fp-context-actions {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
}

.fp-context-meta {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   7. BUTTON COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fp-space-2);
    padding: var(--fp-space-2) var(--fp-space-4);
    font-family: var(--fp-font-family);
    font-size: var(--fp-text-sm);
    font-weight: var(--fp-font-medium);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--fp-radius-md);
    cursor: pointer;
    transition: all var(--fp-transition-fast);
    white-space: nowrap;
}

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

/* Primary Button */
.fp-btn-primary {
    background: var(--fp-brand-accent);
    color: var(--fp-text-inverse);
    border-color: var(--fp-brand-accent);
}

.fp-btn-primary:hover:not(:disabled) {
    background: var(--fp-brand-accent-hover);
    border-color: var(--fp-brand-accent-hover);
}

/* Secondary Button */
.fp-btn-secondary {
    background: var(--fp-surface);
    color: var(--fp-text-primary);
    border-color: var(--fp-border);
}

.fp-btn-secondary:hover:not(:disabled) {
    background: var(--fp-gray-100);
    border-color: var(--fp-border-strong);
}

/* Ghost Button */
.fp-btn-ghost {
    background: transparent;
    color: var(--fp-text-secondary);
    border-color: transparent;
}

.fp-btn-ghost:hover:not(:disabled) {
    background: var(--fp-gray-100);
    color: var(--fp-text-primary);
}

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

.fp-btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

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

.fp-btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

/* Icon Button */
.fp-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: var(--fp-text-secondary);
    border: none;
    border-radius: var(--fp-radius-md);
}

.fp-btn-icon:hover:not(:disabled) {
    background: var(--fp-gray-100);
    color: var(--fp-text-primary);
}

/* Button Sizes */
.fp-btn-sm {
    padding: var(--fp-space-1) var(--fp-space-3);
    font-size: var(--fp-text-xs);
}

.fp-btn-lg {
    padding: var(--fp-space-3) var(--fp-space-6);
    font-size: var(--fp-text-base);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   8. CHIP / BADGE COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--fp-space-1);
    padding: var(--fp-space-1) var(--fp-space-2);
    font-size: var(--fp-text-xs);
    font-weight: var(--fp-font-medium);
    border-radius: var(--fp-radius-full);
    white-space: nowrap;
}

/* Chip Variants */
.fp-chip-default {
    background: var(--fp-gray-100);
    color: var(--fp-text-secondary);
}

.fp-chip-primary {
    background: var(--fp-brand-accent-light);
    color: var(--fp-brand-accent);
}

.fp-chip-success {
    background: var(--fp-success-light);
    color: var(--fp-success);
}

.fp-chip-warning {
    background: var(--fp-warning-light);
    color: #b45309;
}

.fp-chip-danger {
    background: var(--fp-danger-light);
    color: var(--fp-danger);
}

.fp-chip-info {
    background: var(--fp-info-light);
    color: #0891b2;
}

/* Status-specific chips */
.fp-chip-status-draft {
    background: var(--fp-gray-100);
    color: var(--fp-gray-600);
}

.fp-chip-status-review {
    background: var(--fp-warning-light);
    color: #b45309;
}

.fp-chip-status-approved {
    background: var(--fp-success-light);
    color: #059669;
}

.fp-chip-status-locked {
    background: var(--fp-danger-light);
    color: var(--fp-danger);
}

.fp-chip-status-published {
    background: var(--fp-brand-accent-light);
    color: var(--fp-brand-accent);
}

/* Type-specific chips */
.fp-chip-type-budget {
    background: #dbeafe;
    color: #1d4ed8;
}

.fp-chip-type-forecast {
    background: #fef3c7;
    color: #b45309;
}

.fp-chip-type-actual {
    background: #d1fae5;
    color: #059669;
}

.fp-chip-type-whatif {
    background: #e0e7ff;
    color: #4338ca;
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   9. CARD COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-card {
    background: var(--fp-surface);
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-lg);
    box-shadow: var(--fp-shadow-sm);
    overflow: hidden;
}

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

.fp-card-title {
    font-size: var(--fp-text-base);
    font-weight: var(--fp-font-semibold);
    color: var(--fp-text-primary);
    margin: 0;
}

.fp-card-subtitle {
    font-size: var(--fp-text-sm);
    color: var(--fp-text-secondary);
    margin: var(--fp-space-1) 0 0;
}

.fp-card-body {
    padding: var(--fp-space-4);
}

.fp-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--fp-space-2);
    padding: var(--fp-space-3) var(--fp-space-4);
    border-top: 1px solid var(--fp-border);
    background: var(--fp-surface-sunken);
}

/* Elevated card variant */
.fp-card-elevated {
    box-shadow: var(--fp-shadow-md);
    border: none;
}

/* Interactive card variant */
.fp-card-interactive {
    cursor: pointer;
    transition: all var(--fp-transition-fast);
}

.fp-card-interactive:hover {
    box-shadow: var(--fp-shadow-md);
    border-color: var(--fp-brand-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   10. METRIC TILE COMPONENT
   For KPI displays and summary statistics
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--fp-space-4);
}

.fp-metric-tile {
    display: flex;
    align-items: flex-start;
    gap: var(--fp-space-3);
    padding: var(--fp-space-4);
    background: var(--fp-surface);
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-lg);
}

.fp-metric-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--fp-radius-lg);
    font-size: var(--fp-text-lg);
    flex-shrink: 0;
}

.fp-metric-icon.revenue {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.fp-metric-icon.expense {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.fp-metric-icon.profit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.fp-metric-icon.neutral {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.fp-metric-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.fp-metric-body {
    flex: 1;
    min-width: 0;
}

.fp-metric-value {
    font-size: var(--fp-text-2xl);
    font-weight: var(--fp-font-bold);
    color: var(--fp-text-primary);
    line-height: var(--fp-leading-tight);
}

.fp-metric-label {
    font-size: var(--fp-text-sm);
    color: var(--fp-text-secondary);
    margin-top: var(--fp-space-1);
}

.fp-metric-trend {
    display: flex;
    align-items: center;
    gap: var(--fp-space-1);
    font-size: var(--fp-text-xs);
    margin-top: var(--fp-space-2);
}

.fp-metric-trend.up {
    color: var(--fp-success);
}

.fp-metric-trend.down {
    color: var(--fp-danger);
}

.fp-metric-trend.flat {
    color: var(--fp-text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   11. TAB NAVIGATION COMPONENT
   Ribbon-style tab navigation for workspaces
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-tab-nav {
    display: flex;
    align-items: center;
    padding: 0 var(--fp-space-6);
    background: var(--fp-surface);
    border-bottom: 1px solid var(--fp-border);
    overflow-x: auto;
    flex-shrink: 0;
}

.fp-tab-groups {
    display: flex;
    align-items: stretch;
    gap: var(--fp-space-1);
}

.fp-tab-group {
    display: flex;
    flex-direction: column;
    padding: var(--fp-space-2) var(--fp-space-3);
    border-right: 1px solid var(--fp-border);
}

.fp-tab-group:last-child {
    border-right: none;
}

.fp-tab-group-label {
    font-size: 10px;
    font-weight: var(--fp-font-semibold);
    color: var(--fp-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--fp-space-2);
    white-space: nowrap;
}

.fp-tab-group-items {
    display: flex;
    align-items: center;
    gap: var(--fp-space-1);
}

.fp-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--fp-space-1);
    padding: var(--fp-space-2) var(--fp-space-3);
    font-size: var(--fp-text-xs);
    font-weight: var(--fp-font-medium);
    color: var(--fp-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--fp-radius-md);
    cursor: pointer;
    transition: all var(--fp-transition-fast);
    min-width: 64px;
}

.fp-tab i {
    font-size: var(--fp-text-lg);
}

.fp-tab:hover {
    background: var(--fp-gray-100);
    color: var(--fp-text-primary);
}

.fp-tab.active {
    background: var(--fp-brand-accent-light);
    color: var(--fp-brand-accent);
}

/* Simple tab variant (horizontal) */
.fp-tabs-simple {
    display: flex;
    align-items: center;
    gap: var(--fp-space-1);
    padding: var(--fp-space-2);
    background: var(--fp-surface-sunken);
    border-radius: var(--fp-radius-lg);
}

.fp-tab-simple {
    padding: var(--fp-space-2) var(--fp-space-4);
    font-size: var(--fp-text-sm);
    font-weight: var(--fp-font-medium);
    color: var(--fp-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--fp-radius-md);
    cursor: pointer;
    transition: all var(--fp-transition-fast);
}

.fp-tab-simple:hover {
    color: var(--fp-text-primary);
}

.fp-tab-simple.active {
    background: var(--fp-surface);
    color: var(--fp-text-primary);
    box-shadow: var(--fp-shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   12. PANEL / SIDEBAR COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-panel {
    display: flex;
    flex-direction: column;
    width: var(--fp-panel-width);
    background: var(--fp-surface);
    border-right: 1px solid var(--fp-border);
    flex-shrink: 0;
    overflow: hidden;
}

.fp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--fp-space-4);
    border-bottom: 1px solid var(--fp-border);
    flex-shrink: 0;
}

.fp-panel-title {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
    font-size: var(--fp-text-sm);
    font-weight: var(--fp-font-semibold);
    color: var(--fp-text-primary);
}

.fp-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--fp-space-3);
}

.fp-panel-footer {
    padding: var(--fp-space-3) var(--fp-space-4);
    border-top: 1px solid var(--fp-border);
    flex-shrink: 0;
}

/* Search box in panel */
.fp-panel-search {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
    padding: var(--fp-space-2) var(--fp-space-3);
    margin: var(--fp-space-3);
    background: var(--fp-surface-sunken);
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-md);
}

.fp-panel-search i {
    color: var(--fp-text-tertiary);
    font-size: var(--fp-text-sm);
}

.fp-panel-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--fp-text-sm);
    color: var(--fp-text-primary);
    outline: none;
}

.fp-panel-search input::placeholder {
    color: var(--fp-text-tertiary);
}

/* Panel list items */
.fp-panel-list {
    display: flex;
    flex-direction: column;
    gap: var(--fp-space-1);
}

.fp-panel-item {
    display: flex;
    align-items: flex-start;
    gap: var(--fp-space-3);
    padding: var(--fp-space-3);
    border-radius: var(--fp-radius-md);
    cursor: pointer;
    transition: all var(--fp-transition-fast);
    border: 1px solid transparent;
}

.fp-panel-item:hover {
    background: var(--fp-gray-50);
}

.fp-panel-item.active {
    background: var(--fp-brand-accent-light);
    border-color: var(--fp-brand-accent);
}

.fp-panel-item-indicator {
    width: 3px;
    height: 100%;
    border-radius: var(--fp-radius-full);
    flex-shrink: 0;
}

.fp-panel-item-body {
    flex: 1;
    min-width: 0;
}

.fp-panel-item-title {
    font-size: var(--fp-text-sm);
    font-weight: var(--fp-font-medium);
    color: var(--fp-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-panel-item-meta {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
    margin-top: var(--fp-space-1);
    font-size: var(--fp-text-xs);
    color: var(--fp-text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   13. CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--fp-space-6);
    background: var(--fp-background);
}

.fp-content-header {
    margin-bottom: var(--fp-space-6);
}

.fp-content-body {
    display: flex;
    flex-direction: column;
    gap: var(--fp-space-6);
}

/* Tab pane display  */
.fp-tab-pane {
    display: none;
}

.fp-tab-pane.active {
    display: block;
}

/* Empty state */
.fp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--fp-space-12);
    text-align: center;
}

.fp-empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fp-gray-100);
    color: var(--fp-text-tertiary);
    border-radius: var(--fp-radius-2xl);
    font-size: var(--fp-text-3xl);
    margin-bottom: var(--fp-space-4);
}

.fp-empty-title {
    font-size: var(--fp-text-lg);
    font-weight: var(--fp-font-semibold);
    color: var(--fp-text-primary);
    margin: 0 0 var(--fp-space-2);
}

.fp-empty-desc {
    font-size: var(--fp-text-sm);
    color: var(--fp-text-secondary);
    margin: 0 0 var(--fp-space-6);
    max-width: 400px;
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   14. STATUS BAR
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 28px;
    padding: 0 var(--fp-space-4);
    background: var(--fp-gray-800);
    color: var(--fp-gray-400);
    font-size: var(--fp-text-xs);
    flex-shrink: 0;
}

.fp-status-left,
.fp-status-right {
    display: flex;
    align-items: center;
    gap: var(--fp-space-4);
}

.fp-status-indicator {
    display: flex;
    align-items: center;
    gap: var(--fp-space-2);
}

.fp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--fp-radius-full);
    background: var(--fp-success);
}

.fp-status-dot.loading {
    background: var(--fp-warning);
    animation: fp-pulse 1s ease-in-out infinite;
}

.fp-status-dot.error {
    background: var(--fp-danger);
}

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

/* ═══════════════════════════════════════════════════════════════════════════════════
   15. MODULE LINK BANNER
   Cross-module navigation banners
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-module-link {
    display: flex;
    align-items: center;
    gap: var(--fp-space-4);
    padding: var(--fp-space-4);
    background: linear-gradient(135deg, var(--fp-gray-800), var(--fp-gray-900));
    border-radius: var(--fp-radius-lg);
    margin-bottom: var(--fp-space-4);
    color: var(--fp-text-inverse);
}

.fp-module-link-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--fp-radius-lg);
    font-size: var(--fp-text-xl);
}

.fp-module-link-body {
    flex: 1;
}

.fp-module-link-title {
    font-size: var(--fp-text-base);
    font-weight: var(--fp-font-semibold);
}

.fp-module-link-desc {
    font-size: var(--fp-text-sm);
    opacity: 0.7;
    margin-top: var(--fp-space-1);
}

.fp-module-link-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--fp-space-2);
    padding: var(--fp-space-2) var(--fp-space-4);
    background: var(--fp-brand-accent);
    color: white;
    font-size: var(--fp-text-sm);
    font-weight: var(--fp-font-medium);
    border-radius: var(--fp-radius-md);
    text-decoration: none;
    transition: all var(--fp-transition-fast);
}

.fp-module-link-cta:hover {
    background: var(--fp-brand-accent-hover);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   16. LOADING & SPINNER
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--fp-border);
    border-top-color: var(--fp-brand-accent);
    border-radius: var(--fp-radius-full);
    animation: fp-spin 0.8s linear infinite;
}

.fp-spinner.sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.fp-spinner.lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

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

.fp-loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--fp-space-4);
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: var(--fp-z-modal);
}

.fp-loading-text {
    font-size: var(--fp-text-sm);
    color: var(--fp-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   17. DATA TABLE ENHANCEMENTS
   Syncfusion grid overrides for consistency
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-shell .e-grid {
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-lg);
    overflow: hidden;
}

.fp-shell .e-grid .e-headercontent {
    background: var(--fp-surface-sunken);
}

.fp-shell .e-grid .e-headercell {
    font-weight: var(--fp-font-semibold);
    font-size: var(--fp-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--fp-text-secondary);
    padding: var(--fp-space-3) var(--fp-space-4);
}

.fp-shell .e-grid .e-rowcell {
    font-size: var(--fp-text-sm);
    padding: var(--fp-space-3) var(--fp-space-4);
    color: var(--fp-text-primary);
}

.fp-shell .e-grid .e-row:hover .e-rowcell {
    background: var(--fp-gray-50);
}

.fp-shell .e-grid .e-row.e-altrow .e-rowcell {
    background: var(--fp-surface-sunken);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   18. FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-input {
    width: 100%;
    padding: var(--fp-space-2) var(--fp-space-3);
    font-family: var(--fp-font-family);
    font-size: var(--fp-text-sm);
    color: var(--fp-text-primary);
    background: var(--fp-surface);
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-md);
    transition: all var(--fp-transition-fast);
}

.fp-input:focus {
    outline: none;
    border-color: var(--fp-brand-accent);
    box-shadow: 0 0 0 3px var(--fp-brand-accent-light);
}

.fp-input::placeholder {
    color: var(--fp-text-tertiary);
}

.fp-label {
    display: block;
    font-size: var(--fp-text-sm);
    font-weight: var(--fp-font-medium);
    color: var(--fp-text-primary);
    margin-bottom: var(--fp-space-2);
}

.fp-form-group {
    margin-bottom: var(--fp-space-4);
}

.fp-form-hint {
    font-size: var(--fp-text-xs);
    color: var(--fp-text-tertiary);
    margin-top: var(--fp-space-1);
}

.fp-form-error {
    font-size: var(--fp-text-xs);
    color: var(--fp-danger);
    margin-top: var(--fp-space-1);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   19. SIDEBAR NAVIGATION (LEFT NAV)
   Oracle EPM style sidebar for Admin/Analytics
   ═══════════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────────
   FLYOUT MENU — Global (overrides Blazor scoping issue with NavLink child component)
   Dark floating panel that slides out when sidebar is collapsed
   ───────────────────────────────────────────────────────────────────────────────── */
.flyout-menu {
    position: absolute;
    top: -6px;
    left: calc(100% + 8px);
    min-width: 262px;
    max-width: 320px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #0d1526;
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 4px 8px rgba(0, 0, 0, 0.35),
        0 24px 64px rgba(0, 0, 0, 0.65),
        0 0 48px rgba(14, 165, 233, 0.07);
    padding: 5px;
    z-index: 1000;
    animation: flyout-enter 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
    overscroll-behavior: contain;
}

.flyout-menu::before {
    content: '';
    position: absolute;
    top: 22px;
    left: -5px;
    width: 9px;
    height: 9px;
    background: #0d1526;
    border-left: 1px solid rgba(99, 102, 241, 0.18);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
    transform: rotate(45deg);
    border-radius: 0 0 0 2px;
}

@keyframes flyout-enter {
    from { opacity: 0; transform: translateX(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Flyout header row */
.flyout-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 3px;
}

.flyout-header-emoji {
    font-size: 1rem;
    line-height: 1;
    filter: drop-shadow(0 0 5px rgba(14, 165, 233, 0.3));
}

.flyout-header-title {
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(148, 163, 184, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section divider inside flyout */
.flyout-section {
    font-size: 0.59rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(100, 116, 139, 0.55);
    padding: 8px 10px 3px;
    margin-top: 2px;
    border-top: 1px solid rgba(71, 85, 105, 0.18);
}
.flyout-section:first-of-type { border-top: none; margin-top: 0; }

/* Link item */
.flyout-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 6px 9px !important;
    border-radius: 7px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: rgba(203, 213, 225, 0.82) !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease !important;
}

.flyout-link-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: rgba(100, 116, 139, 0.65);
    flex-shrink: 0;
    border-radius: 5px;
    transition: color 0.12s ease, background 0.12s ease;
}

.flyout-link:hover {
    background: rgba(14, 165, 233, 0.1) !important;
    color: #e2e8f0 !important;
    transform: translateX(2px) !important;
}

.flyout-link:hover .flyout-link-icon {
    color: #38bdf8 !important;
    background: rgba(14, 165, 233, 0.15) !important;
}

.flyout-link.active {
    background: rgba(14, 165, 233, 0.14) !important;
    color: #7dd3fc !important;
    font-weight: 600 !important;
}

.flyout-link.active .flyout-link-icon {
    color: #38bdf8 !important;
    background: rgba(14, 165, 233, 0.2) !important;
}

/* Scrollbar */
.flyout-menu::-webkit-scrollbar { width: 3px; }
.flyout-menu::-webkit-scrollbar-track { background: transparent; }
.flyout-menu::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.15); border-radius: 4px; }
.flyout-menu::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.3); }

.fp-sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    background: var(--fp-surface);
    border-right: 1px solid var(--fp-border);
    flex-shrink: 0;
}

.fp-sidebar-header {
    padding: var(--fp-space-4);
    border-bottom: 1px solid var(--fp-border);
}

.fp-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--fp-space-3);
}

.fp-sidebar-section {
    margin-bottom: var(--fp-space-4);
}

.fp-sidebar-section-title {
    font-size: 10px;
    font-weight: var(--fp-font-semibold);
    color: var(--fp-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--fp-space-2) var(--fp-space-3);
    margin-bottom: var(--fp-space-1);
}

.fp-sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--fp-space-3);
    padding: var(--fp-space-2) var(--fp-space-3);
    font-size: var(--fp-text-sm);
    color: var(--fp-text-secondary);
    text-decoration: none;
    border-radius: var(--fp-radius-md);
    transition: all var(--fp-transition-fast);
}

.fp-sidebar-link:hover {
    background: var(--fp-gray-100);
    color: var(--fp-text-primary);
}

.fp-sidebar-link.active {
    background: var(--fp-brand-accent-light);
    color: var(--fp-brand-accent);
    font-weight: var(--fp-font-medium);
}

.fp-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: var(--fp-text-base);
}

/* ═══════════════════════════════════════════════════════════════════════════════════
   20. LAYOUT HELPERS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-flex { display: flex; }
.fp-flex-col { flex-direction: column; }
.fp-items-center { align-items: center; }
.fp-items-start { align-items: flex-start; }
.fp-justify-between { justify-content: space-between; }
.fp-justify-center { justify-content: center; }
.fp-flex-1 { flex: 1; }
.fp-flex-shrink-0 { flex-shrink: 0; }

.fp-gap-1 { gap: var(--fp-space-1); }
.fp-gap-2 { gap: var(--fp-space-2); }
.fp-gap-3 { gap: var(--fp-space-3); }
.fp-gap-4 { gap: var(--fp-space-4); }
.fp-gap-6 { gap: var(--fp-space-6); }

.fp-w-full { width: 100%; }
.fp-h-full { height: 100%; }

.fp-overflow-auto { overflow: auto; }
.fp-overflow-hidden { overflow: hidden; }

.fp-relative { position: relative; }
.fp-absolute { position: absolute; }

.fp-grid { display: grid; }
.fp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.fp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.fp-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ═══════════════════════════════════════════════════════════════════════════════════
   21. TYPOGRAPHY HELPERS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-text-xs { font-size: var(--fp-text-xs); }
.fp-text-sm { font-size: var(--fp-text-sm); }
.fp-text-base { font-size: var(--fp-text-base); }
.fp-text-lg { font-size: var(--fp-text-lg); }
.fp-text-xl { font-size: var(--fp-text-xl); }
.fp-text-2xl { font-size: var(--fp-text-2xl); }
.fp-text-3xl { font-size: var(--fp-text-3xl); }

.fp-font-medium { font-weight: var(--fp-font-medium); }
.fp-font-semibold { font-weight: var(--fp-font-semibold); }
.fp-font-bold { font-weight: var(--fp-font-bold); }

.fp-text-primary { color: var(--fp-text-primary); }
.fp-text-secondary { color: var(--fp-text-secondary); }
.fp-text-tertiary { color: var(--fp-text-tertiary); }

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

/* ═══════════════════════════════════════════════════════════════════════════════════
   22. SPACING HELPERS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-p-0 { padding: 0; }
.fp-p-2 { padding: var(--fp-space-2); }
.fp-p-3 { padding: var(--fp-space-3); }
.fp-p-4 { padding: var(--fp-space-4); }
.fp-p-6 { padding: var(--fp-space-6); }

.fp-px-4 { padding-left: var(--fp-space-4); padding-right: var(--fp-space-4); }
.fp-py-2 { padding-top: var(--fp-space-2); padding-bottom: var(--fp-space-2); }
.fp-py-3 { padding-top: var(--fp-space-3); padding-bottom: var(--fp-space-3); }

.fp-m-0 { margin: 0; }
.fp-mb-2 { margin-bottom: var(--fp-space-2); }
.fp-mb-4 { margin-bottom: var(--fp-space-4); }
.fp-mb-6 { margin-bottom: var(--fp-space-6); }
.fp-mt-4 { margin-top: var(--fp-space-4); }

/* ═══════════════════════════════════════════════════════════════════════════════════
   23. TRANSITIONS & ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════════════ */

.fp-fade-in {
    animation: fp-fadeIn 0.3s ease-out;
}

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

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

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

/* ═══════════════════════════════════════════════════════════════════════════════════
   24. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .fp-panel {
        width: 260px;
    }
    
    .fp-sidebar {
        width: 200px;
    }
}

@media (max-width: 992px) {
    .fp-panel {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: var(--fp-z-modal);
        box-shadow: var(--fp-shadow-xl);
        transform: translateX(-100%);
        transition: transform var(--fp-transition-normal);
    }
    
    .fp-panel.open {
        transform: translateX(0);
    }
    
    .fp-sidebar {
        width: 64px;
    }
    
    .fp-sidebar-link span {
        display: none;
    }
    
    .fp-sidebar-section-title {
        display: none;
    }
    
    .fp-metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .fp-header {
        padding: 0 var(--fp-space-4);
    }
    
    .fp-content {
        padding: var(--fp-space-4);
    }
    
    .fp-metric-grid {
        grid-template-columns: 1fr;
    }
    
    .fp-tab-nav {
        padding: 0 var(--fp-space-4);
    }
    
    .fp-tab-group-label {
        display: none;
    }
}
