/* ============================================
   FULLWIDTH DASHBOARD 2025 - GLASSMORPHISM & NEUMORPHISM
   ============================================ */

:root {
    /* Color Palette - Modern Blue/Purple */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Neutral Colors */
    --bg-main: #f8f9fc;
    --bg-sidebar: #1e293b;
    --bg-topbar: #ffffff;
    --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;
    
    /* Sidebar Width */
    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);
    
    /* Neumorphism */
    --neu-light: #ffffff;
    --neu-dark: #d1d9e6;
    
    /* Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-container {
    width: 100%;
    max-width: none;
}

/* ============================================
   WELCOME SECTION
   ============================================ */

.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem; /* reduced vertical padding for a shorter visual */
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    border-radius: var(--radius-2xl);
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    gap: 1rem;
}

.welcome-section::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -200px;
    right: -100px;
}

.welcome-content {
    flex: 1 1 auto;
    min-width: 0; /* allow text truncation when needed */
}

.welcome-title {
    /* Dynamic, responsive sizing that won't blow up vertically */
    font-size: clamp(1.125rem, 2.2vw, 1.75rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
    line-height: 1.05;
    white-space: nowrap; /* keep as single line on larger viewports */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.welcome-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0; /* keep action buttons from squeezing the title */
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-md);
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================
   STATISTICS CARDS - GLASSMORPHISM
   ============================================ */

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

.stat-card {
    padding: 1.75rem;
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

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

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-change.neutral {
    background: rgba(156, 163, 175, 0.1);
    color: var(--gray-500);
}

/* ============================================
   DASHBOARD GRID - TWO COLUMNS
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ============================================
   ALERTS SECTION - NEUMORPHISM
   ============================================ */

.neu-card {
    background: var(--bg-main);
    border-radius: var(--radius-2xl);
    padding: 1.75rem;
    box-shadow: 
        12px 12px 24px rgba(0, 0, 0, 0.08),
        -12px -12px 24px rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

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

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary);
}

.section-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--danger);
    color: white;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-xl);
    border-left: 4px solid;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

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

.alert-item.warning {
    border-color: var(--warning);
}

.alert-item.danger {
    border-color: var(--danger);
}

.alert-item.info {
    border-color: var(--info);
}

.alert-item.success {
    border-color: var(--success);
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

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

.alert-item.danger .alert-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.alert-item.info .alert-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.alert-item.success .alert-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.alert-content {
    flex: 1;
}

.alert-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.alert-content p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.alert-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.alert-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--gray-600);
}

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

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 1rem;
    transition: var(--transition-fast);
}

.view-all-link:hover {
    color: var(--primary-dark);
    gap: 0.75rem;
}

/* ============================================
   ACTIVITY SECTION
   ============================================ */

.activity-section {
    padding: 1.75rem;
    border-radius: var(--radius-2xl);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ============================================
   QUICK STATS SECTION
   ============================================ */

.quick-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quick-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.quick-stat-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
}

.quick-stat-progress {
    height: 100%;
    border-radius: 1rem;
    transition: width 1s ease-out;
}

.quick-stat-progress.success {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.quick-stat-progress.primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.quick-stat-progress.warning {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.quick-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* ============================================
   QUICK ACTIONS CARD
   ============================================ */

.quick-actions-card {
    padding: 1.75rem;
    border-radius: var(--radius-2xl);
}

.quick-actions-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.quick-action-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

/* ============================================
   APPS SECTION - COMPACT GRID
   ============================================ */

.apps-section {
    margin-top: 2rem;
}

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

.app-compact-card {
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    text-align: center;
    transition: var(--transition);
}

.app-compact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.app-compact-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.app-compact-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.app-compact-models {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.model-compact-link {
    font-size: 0.8125rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition-fast);
}

.model-compact-link:hover {
    color: var(--primary);
}

.app-compact-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

/* ============================================
   RESPONSIVE
   ============================================ */

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

@media (max-width: 768px) {
    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .welcome-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-list {
        grid-template-columns: 1fr;
    }
    
    .apps-compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    /* On small screens allow title to wrap to avoid truncation */
    .welcome-title {
        white-space: normal;
        line-height: 1.15;
        font-size: 1.25rem;
    }
}
