/**
 * Aetheric AI EPM Suite
 * Main Stylesheet - Matching Original Wireframe Design
 */

:root {
    /* Pastel Colors */
    --pastel-mint: #E8F5F0;
    --pastel-lavender: #F0E8F5;
    --pastel-peach: #FFF0E8;
    --pastel-sky: #E8F0F5;
    --pastel-cream: #FFF8F0;

    /* Accent Colors */
    --accent-teal: #4ECDC4;
    --accent-coral: #FF6B6B;
    --accent-purple: #A78BFA;
    --accent-amber: #FBBF24;
    --accent-emerald: #34D399;
    --accent-blue: #60A5FA;

    /* Backgrounds */
    --bg-primary: #FAFBFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;

    /* Text Colors */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    /* Borders */
    --border-light: #E2E8F0;

    /* Status Colors */
    --status-success: #10B981;
    --status-warning: #F59E0B;
    --status-danger: #EF4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 64px;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

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

    /* Additional Colors for Components */
    --card-bg: var(--bg-secondary);
    --brand-primary: var(--accent-teal);
    --brand-secondary: var(--accent-purple);
    --success: var(--status-success);
    --warning: var(--status-warning);
    --danger: var(--status-danger);
    --info: var(--accent-blue);
    --success-light: rgba(16, 185, 129, 0.1);
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger-light: rgba(239, 68, 68, 0.1);
    --info-light: rgba(96, 165, 250, 0.1);

    /* Gray Scale */
    --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;
}

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

/* Skip Link - Hidden until focused */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-teal);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

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

/* Global SVG Sizing - CRITICAL */
svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

/* Default icon sizes */
.icon, [class*="icon"] svg, button svg, a svg {
    width: 20px;
    height: 20px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-emerald));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

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

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 8px 12px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link, .nav-item > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-link:hover, .nav-item > a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active .nav-link,
.nav-item.active > a {
    background: linear-gradient(135deg, var(--pastel-mint), var(--pastel-sky));
    color: var(--accent-teal);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.nav-icon svg {
    width: 20px !important;
    height: 20px !important;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: var(--accent-teal);
}

.nav-badge {
    margin-left: auto;
    background: var(--status-danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.bc-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.bc-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-warning);
}

.bc-status.connected .bc-indicator {
    background: var(--status-success);
}

.bc-label {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-version {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* App Container (page layout wrapper) */
.app-container {
    display: flex;
    min-height: calc(100vh - 73px); /* Account for header height */
}

/* Main Content Area (used by pages) */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    background: var(--bg-primary);
    min-height: calc(100vh - 73px);
    overflow-x: hidden;
}

/* Top Header */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

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

/* Header SVG icons */
.header-left svg, .header-center svg, .header-right svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 4px 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-img {
    width: 32px;
    height: 32px;
}

.header-logo .logo-text {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

/* Header Center - Search */
.header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}

.global-search {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    padding-right: 80px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-tertiary);
    font-size: 14px;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-teal);
    background: var(--bg-secondary);
}

.search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* AI Status */
.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--pastel-mint);
    border-radius: 20px;
}

.ai-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-teal);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.ai-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-teal);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.icon-moon { display: none; }
.dark .icon-sun { display: none; }
.dark .icon-moon { display: block; }

/* Notifications */
.notifications-dropdown {
    position: relative;
}

.notifications-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    position: relative;
}

.notifications-toggle:hover {
    background: var(--bg-tertiary);
}

.notifications-toggle svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--status-danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
}

.user-toggle .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.user-toggle .user-info {
    text-align: left;
}

.user-toggle .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.user-toggle .user-role {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.dropdown-arrow {
    width: 16px !important;
    height: 16px !important;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.user-menu[hidden] {
    display: none;
}

.user-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.user-menu-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.15s ease;
}

.user-menu-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.user-menu-nav a svg {
    width: 16px;
    height: 16px;
}

.user-menu-footer {
    padding: 8px;
    border-top: 1px solid var(--border-light);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    color: var(--status-danger);
    cursor: pointer;
    transition: background 0.15s ease;
}

.logout-btn:hover {
    background: #FEE2E2;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

/* Notifications Panel */
.notifications-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.notifications-panel[hidden] {
    display: none;
}

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

.notifications-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.mark-all-read {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--accent-teal);
    cursor: pointer;
}

.notifications-list {
    max-height: 360px;
    overflow-y: auto;
}

.notifications-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.notifications-footer a {
    font-size: 13px;
    color: var(--accent-teal);
    font-weight: 500;
}

/* Notification Items */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

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

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.notification-icon svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.notification-item.critical .notification-icon {
    background: rgba(239, 68, 68, 0.1);
}

.notification-item.critical .notification-icon svg {
    color: #EF4444;
}

.notification-item.warning .notification-icon {
    background: rgba(245, 158, 11, 0.1);
}

.notification-item.warning .notification-icon svg {
    color: #F59E0B;
}

.notification-item.info .notification-icon {
    background: rgba(78, 205, 196, 0.1);
}

.notification-item.info .notification-icon svg {
    color: var(--accent-teal);
}

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

.notification-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
}

.notification-dismiss {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.notification-item:hover .notification-dismiss {
    opacity: 1;
}

.notification-dismiss:hover {
    background: var(--bg-tertiary);
}

.notification-dismiss svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.notifications-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notifications-loading {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Page Content */
.page-content {
    padding: 24px 32px;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

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

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

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

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-emerald));
    color: white;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.35);
}

.btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--status-danger);
    color: white;
}

.btn-success {
    background: var(--status-success);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-warning {
    background: var(--status-warning);
    color: #1a1a2e;
}

.btn-warning:hover {
    filter: brightness(1.1);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Alert Banner */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.alert-banner.alert-warning {
    background: linear-gradient(135deg, var(--pastel-peach), var(--pastel-cream));
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.alert-banner.alert-success {
    background: linear-gradient(135deg, var(--pastel-mint), #E8F5F0);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-banner.alert-danger {
    background: linear-gradient(135deg, #FEE2E2, #FFF5F5);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-warning .alert-icon {
    background: linear-gradient(135deg, var(--accent-coral), #FF8E8E);
    color: white;
}

.alert-icon svg {
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-coral);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.alert-message {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.alert-action {
    padding: 8px 16px;
    background: white;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-coral);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.alert-action:hover {
    background: var(--accent-coral);
    color: white;
}

.alert-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    padding: 4px;
}

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

.alert-dismiss svg {
    width: 16px;
    height: 16px;
}

/* Dashboard Section */
.dashboard-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-link {
    font-size: 12px;
    color: var(--accent-teal);
    font-weight: 500;
}

.section-link:hover {
    text-decoration: underline;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* KPI Cards */
.kpi-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-teal);
}

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

.kpi-card.kpi-danger::before,
.kpi-card.danger::before {
    background: var(--status-danger);
}

.kpi-card.kpi-danger,
.kpi-card.danger {
    background: linear-gradient(180deg, #FFF5F5 0%, var(--bg-secondary) 100%);
}

.kpi-card.kpi-warning::before,
.kpi-card.warning::before {
    background: var(--status-warning);
}

.kpi-card.kpi-warning,
.kpi-card.warning {
    background: linear-gradient(180deg, #FFFBEB 0%, var(--bg-secondary) 100%);
}

.kpi-card.kpi-success::before,
.kpi-card.success::before {
    background: var(--status-success);
}

.kpi-card.kpi-success,
.kpi-card.success {
    background: linear-gradient(180deg, #ECFDF5 0%, var(--bg-secondary) 100%);
}

.kpi-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pastel-mint);
}

.kpi-card.danger .kpi-icon { background: #FEE2E2; }
.kpi-card.warning .kpi-icon { background: #FEF3C7; }
.kpi-card.success .kpi-icon { background: #D1FAE5; }

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.kpi-trend.up,
.kpi-trend.trend-up {
    background: #D1FAE5;
    color: var(--status-success);
}

.kpi-trend.down,
.kpi-trend.trend-down {
    background: #FEE2E2;
    color: var(--status-danger);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: 'Space Mono', monospace;
}

.kpi-label,
.kpi-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-subtitle,
.kpi-target {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.kpi-variance {
    font-size: 11px;
    font-weight: 600;
    font-family: 'Space Mono', monospace;
}

.kpi-variance.positive { color: var(--status-success); }
.kpi-variance.negative { color: var(--status-danger); }

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pastel-mint);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.dashboard-card {
    grid-column: span 1;
}

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

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #D1FAE5;
    color: var(--status-success);
}

.badge-warning {
    background: #FEF3C7;
    color: var(--status-warning);
}

.badge-danger {
    background: #FEE2E2;
    color: var(--status-danger);
}

.badge-info {
    background: #E0E7FF;
    color: #6366F1;
}

/* Forms */
input, select, textarea {
    font-family: inherit;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

/* Notification Button */
.notification-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--status-danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

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

@keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.1); }
    50% { box-shadow: 0 0 0 8px rgba(255, 107, 107, 0); }
}

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

.fade-in { animation: fadeInUp 0.5s ease forwards; }
.kpi-card { animation: fadeInUp 0.5s ease forwards; }
.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.15s; }
.kpi-card:nth-child(3) { animation-delay: 0.2s; }
.kpi-card:nth-child(4) { animation-delay: 0.25s; }
.kpi-card:nth-child(5) { animation-delay: 0.3s; }

/* AI Panel - Vibrant Styling */
.ai-panel, .card.ai-panel {
    background: linear-gradient(135deg, var(--pastel-lavender) 0%, var(--pastel-sky) 100%);
}

.ai-recommendation {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(167, 139, 250, 0.2);
    transition: all var(--transition-normal);
}

.ai-recommendation:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.ai-rec-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-rec-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.ai-rec-icon svg {
    width: 16px;
    height: 16px;
}

.ai-rec-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ai-rec-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ai-rec-impact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.impact-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #D1FAE5;
    color: var(--status-success);
}

.ai-rec-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ai-rec-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ai-rec-btn.approve {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-emerald));
    color: white;
}

.ai-rec-btn.approve:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.ai-rec-btn.dismiss {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Risk Badges - Vibrant */
.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.risk-badge.critical { background: #FEE2E2; color: var(--status-danger); }
.risk-badge.high { background: #FEF3C7; color: var(--status-warning); }
.risk-badge.medium { background: #E0E7FF; color: #6366F1; }
.risk-badge.low { background: #D1FAE5; color: var(--status-success); }

/* Status Badges - Vibrant */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.success, .status-badge.on_track { background: #D1FAE5; color: var(--status-success); }
.status-badge.warning, .status-badge.delayed { background: #FEF3C7; color: var(--status-warning); }
.status-badge.danger, .status-badge.critical { background: #FEE2E2; color: var(--status-danger); }
.status-badge.info { background: #E0E7FF; color: #6366F1; }

/* Colorful Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    animation: fadeInUp 0.6s ease forwards;
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title h3, .card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pastel-mint);
    color: var(--accent-teal);
}

.card-title-icon svg {
    width: 16px;
    height: 16px;
}

.card-body {
    padding: 24px;
}

/* Algorithm Grid - AI Insights */
.algorithm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

/* Algorithm Cards - AI Insights */
.algorithm-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 12px;
    position: relative;
}

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

.algo-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.algo-icon.slotting { background: linear-gradient(135deg, #4ECDC4, #2AB7A9); color: white; }
.algo-icon.demand { background: linear-gradient(135deg, #A78BFA, #7C3AED); color: white; }
.algo-icon.replenishment { background: linear-gradient(135deg, #60A5FA, #3B82F6); color: white; }
.algo-icon.route { background: linear-gradient(135deg, #FBBF24, #F59E0B); color: white; }
.algo-icon.anomaly { background: linear-gradient(135deg, #F87171, #EF4444); color: white; }
.algo-icon.cost { background: linear-gradient(135deg, #34D399, #10B981); color: white; }

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

.algo-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.algo-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.algo-stats {
    display: flex;
    gap: 16px;
}

.algo-stat {
    display: flex;
    flex-direction: column;
}

.algo-stat .stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-teal);
}

.algo-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.algo-status {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--status-success);
}

.algo-status .status-dot {
    width: 8px;
    height: 8px;
    background: var(--status-success);
    border-radius: 50%;
    animation: statusBlink 2s infinite;
}

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

/* Recommendations Grid - AI Insights */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.recommendation-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--accent-teal);
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rec-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.type-icon.slotting { background: #4ECDC4; color: white; }
.type-icon.replenishment { background: #60A5FA; color: white; }
.type-icon.transportation { background: #FBBF24; color: white; }
.type-icon.anomaly { background: #F87171; color: white; }
.type-icon.general { background: var(--accent-purple); color: white; }

.type-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.rec-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rec-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-actions {
    display: flex;
    gap: 8px;
}

/* Legacy algorithm card styles (for other pages) */
.algorithm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    margin-bottom: 12px;
}

.algorithm-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.algorithm-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.algorithm-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

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

.algorithm-stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: var(--accent-teal);
}

.algorithm-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive AI Insights */
@media (max-width: 1200px) {
    .algorithm-grid,
    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Warehouse 3D Container - Vibrant */
.warehouse-3d-container {
    height: 420px;
    position: relative;
    background: linear-gradient(180deg, var(--pastel-sky) 0%, var(--bg-tertiary) 100%);
    border-radius: 12px;
    overflow: hidden;
}

.warehouse-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    gap: 16px;
    font-size: 11px;
    box-shadow: var(--shadow-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Analytics Hero Section */
.analytics-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--pastel-lavender), var(--pastel-sky));
    border-radius: 16px;
    margin-bottom: 2rem;
    min-height: 300px;
    align-items: center;
}

.hero-content {
    padding: 1rem;
}

.hero-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

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

.hero-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: var(--text-primary);
    line-height: 1;
}

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

.hero-3d {
    position: relative;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-3d-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
}

.network-node {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent-teal);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.network-node.node-1 { top: 30%; left: 20%; }
.network-node.node-2 { top: 50%; left: 50%; width: 30px; height: 30px; }
.network-node.node-3 { top: 20%; left: 70%; }
.network-node.node-4 { top: 70%; left: 60%; }

.network-edge {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-purple));
    opacity: 0.5;
}

.network-edge.edge-1 { top: 35%; left: 25%; width: 100px; transform: rotate(10deg); }
.network-edge.edge-2 { top: 55%; left: 55%; width: 80px; transform: rotate(-20deg); }
.network-edge.edge-3 { top: 30%; left: 55%; width: 60px; transform: rotate(40deg); }

/* Performance Rings */
.performance-section {
    margin-bottom: 2rem;
}

.performance-section .section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.performance-rings {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.performance-ring {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.performance-ring svg {
    width: 100px !important;
    height: 100px !important;
    transform: rotate(-90deg);
}

.performance-ring .ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.performance-ring .ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.ring-fill.fill-success { stroke: var(--status-success); }
.ring-fill.fill-warning { stroke: var(--status-warning); }
.ring-fill.fill-danger { stroke: var(--status-danger); }
.ring-fill.fill-primary { stroke: var(--accent-teal); }

.ring-content {
    position: absolute;
    text-align: center;
}

.ring-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: var(--text-primary);
}

.ring-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.analytics-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.analytics-card-lg {
    grid-column: span 2;
}

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

.analytics-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.analytics-card .card-body {
    padding: 1.5rem;
}

.analytics-card .card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
}

.ai-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--pastel-lavender);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.forecast-insight {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.forecast-insight svg {
    width: 16px;
    height: 16px;
    color: var(--status-warning);
}

/* Form Elements */
.form-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

.form-select-sm {
    padding: 0.375rem 1.5rem 0.375rem 0.5rem;
    font-size: 0.75rem;
}

/* Settings Page */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.settings-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: var(--pastel-mint);
    color: var(--accent-teal);
    font-weight: 600;
}

.settings-nav-item svg {
    width: 18px;
    height: 18px;
}

.settings-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input, .form-textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-primary);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-teal);
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* Audit Trail Page */
.audit-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-table th,
.audit-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.audit-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.audit-table td {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.audit-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.audit-action.create { background: var(--pastel-mint); color: var(--status-success); }
.audit-action.update { background: var(--pastel-sky); color: var(--accent-blue); }
.audit-action.delete { background: #FEE2E2; color: var(--status-danger); }
.audit-action.login { background: var(--pastel-lavender); color: var(--accent-purple); }

.audit-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--pastel-lavender);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple);
}

.audit-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Admin Utilities */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box .form-input {
    padding-left: 2.5rem;
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.code-block {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    border: 1px solid var(--border-light);
}

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

.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1rem;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.info-card-body {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.workflow-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: var(--transition-fast);
}

.workflow-card:hover {
    border-color: var(--accent-teal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.job-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.error-block {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--status-danger);
    font-family: 'Space Mono', monospace;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

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

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

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

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

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

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