/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Enhanced Root Variables - Professional Color Palette with Coordinated Animation Timing */
:root {
    /* Background Colors - Harmonious monochromatic beige */
    --bg-primary: #ebe9e6;
    --bg-workspace: #f5f4f2;
    --bg-secondary: #fafaf9;
    --bg-white: #ffffff;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #2d2d2d;
    --text-tertiary: #404040;
    --text-body: #525252;
    --text-muted: #737373;
    --text-light: #8a8a8a;
    
    /* Border Colors */
    --border-light: #e8e7e5;
    --border-medium: #d4d3d0;
    --border-focus: #22c55e;
    
    /* Action Colors */
    --color-primary: #16a34a;
    --color-primary-hover: #15803d;
    --color-secondary: #f59e0b;
    --color-secondary-hover: #d97706;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #dc2626;
    --color-info: #3b82f6;
    
    /* Drag Operation Color - Dynamic, matches service category */
    --drag-active-color: #16a34a;
    
    /* Status Colors */
    --status-confirmed: #16a34a;
    --status-pending: #d97706;
    --status-running: #3b82f6;
    --status-active: #16a34a;
    --status-draft: #6b7280;
    --status-sent: #3b82f6;
    
    /* COORDINATED: Enhanced Sidebar Variables with synchronized timing */
    --sidebar-width-expanded: 240px;
    --sidebar-width-collapsed: 44px;
    --sidebar-transition: all 300ms cubic-bezier(0.25, 0.8, 0.25, 1);
    --sidebar-gap: 24px;
    
    /* COORDINATED: Animation timing for synchronized transitions */
    --coordinated-duration: 300ms;
    --coordinated-easing: cubic-bezier(0.25, 0.8, 0.25, 1); /* Ease-out for entries */
    --coordinated-exit-easing: cubic-bezier(0.4, 0, 1, 1); /* Ease-in for exits */
    
    /* COORDINATED: Header heights for perfect alignment across all section headers */
    --header-height: 56px;
    
    /* Professional Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Typography Scale */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    
    /* Professional Animation Timing */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* Base Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-body);
    background-color: var(--bg-primary);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* KISS: Simple dropdown arrow class - apply where needed */
.dropdown-arrow {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23525252' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-sm) center;
    background-size: 14px;
    padding-right: calc(var(--space-lg) + var(--space-sm)) !important;
}

/* Typography Hierarchy */
h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h2 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}

h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* App Layout */
.app-container {
    display: flex;
    height: calc(100vh - 60px - var(--sidebar-gap) - 56px);
    position: relative;
}

/* COORDINATED: Main Content with synchronized transition timing */
.main-content {
    flex: 1;
    margin: 0 24px 0 24px; /* top right bottom left */
    overflow-y: auto;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    transition: margin-left var(--coordinated-duration) var(--coordinated-easing);
}

.module-content {
    width: 100%;
    margin: 0;
    height: 100%;
}

/* Tabbed dashboard styling - matches dashboard-content background, extends full height */
.module-content.tabbed-dashboard {
    background: var(--bg-workspace); /* #f5f4f2 - Same light beige as dashboard-content */
    border-radius: var(--radius-2xl);
    height: 100%; /* Extend to bottom of module-content */
    display: flex;
    flex-direction: column;
}

/* Enhanced Focus Ring */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Custom Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* COORDINATED: Base sidebar coordination classes with synchronized timing */
.sidebar.detail-mode-hidden {
    transform: translateX(-100%);
    transition: transform var(--coordinated-duration) var(--coordinated-easing);
}

.main-content.detail-mode-expanded {
    margin-left: 0;
    transition: margin-left var(--coordinated-duration) var(--coordinated-easing);
}

/* COORDINATED: Base animation keyframes for detail view transitions */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* COORDINATED: Utility classes for coordinated animations */
.coordinated-slide-in {
    animation: slideInFromRight var(--coordinated-duration) var(--coordinated-easing);
}

.coordinated-slide-out {
    animation: slideOutToRight var(--coordinated-duration) var(--coordinated-exit-easing);
}