/* ============================================================================
   Enterprise-Level Professional Styling
   Competitive with world-class SaaS applications
   ============================================================================ */

:root {
    /* Professional Color Palette */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    
    /* Neutral Colors */
    --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;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* ============================================================================
   Global Styles
   ============================================================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   Professional Navigation
   ============================================================================ */

.navbar-enterprise {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    padding: 0.55rem 0; /* tighter height */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-enterprise .navbar-brand {
    font-size: 1.35rem; /* slightly smaller */
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    transition: opacity var(--transition-base);
}

.navbar-enterprise .navbar-brand:hover {
    opacity: 0.9;
}

.navbar-enterprise .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.4rem 0.85rem !important; /* less height */
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    margin: 0 0.2rem;
}

.navbar-enterprise .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.navbar-enterprise .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}

.navbar-enterprise .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.navbar-enterprise .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    transition: all var(--transition-base);
}

.navbar-enterprise .dropdown-item:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
}

/* ============================================================================
   Professional Cards
   ============================================================================ */

.card-enterprise {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    background: #ffffff;
    overflow: hidden;
}

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

.card-enterprise .card-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

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

.card-enterprise .card-footer {
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* ============================================================================
   Professional Buttons
   ============================================================================ */

.btn-enterprise {
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-enterprise:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-enterprise-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
}

.btn-enterprise-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a8a 100%);
    color: #ffffff;
}

/* ============================================================================
   Professional Tables
   ============================================================================ */

.table-enterprise {
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-enterprise thead {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.table-enterprise thead th {
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.table-enterprise tbody tr {
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--gray-100);
}

.table-enterprise tbody tr:hover {
    background-color: var(--gray-50);
}

.table-enterprise tbody td {
    padding: 1rem;
    vertical-align: middle;
}

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

.form-control-enterprise {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all var(--transition-base);
    font-size: 0.9375rem;
}

.form-control-enterprise:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

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

/* ============================================================================
   Professional Alerts
   ============================================================================ */

.alert-enterprise {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}

.alert-enterprise-success {
    background-color: #ecfdf5;
    border-left-color: var(--success-color);
    color: #065f46;
}

.alert-enterprise-info {
    background-color: #ecfeff;
    border-left-color: var(--info-color);
    color: #164e63;
}

.alert-enterprise-warning {
    background-color: #fffbeb;
    border-left-color: var(--warning-color);
    color: #92400e;
}

.alert-enterprise-danger {
    background-color: #fef2f2;
    border-left-color: var(--danger-color);
    color: #991b1b;
}

/* ============================================================================
   Professional Badges
   ============================================================================ */

.badge-enterprise {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

/* ============================================================================
   Dashboard Layout
   ============================================================================ */

.dashboard-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 1rem;
}

/* Full-width flex container for admin dashboard */
.dashboard-flex {
    max-width: 100%;
    width: 100%;
    padding: 1rem 2rem;
}

/* Compact layout for home to reduce scrolling */
.home-compact .dashboard-container {
    max-width: 920px;
    padding: 0.5rem;
}
/* Hero compact */
.hero-compact .card-enterprise {
    margin-bottom: 0.4rem;
}
.hero-body {
    padding: 0.6rem 0.78rem !important;
}
.hero-icon {
    font-size: 2.6rem !important;
}
.hero-title {
    margin: 0.28rem 0 0.28rem 0;
    font-size: 1.35rem;
}
.hero-subtitle,
.hero-subtext {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}
.hero-actions .btn {
    padding: 0.32rem 0.7rem;
    font-size: 0.9rem;
}
.hero-features .feature-body {
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
}
.hero-features .feature-icon {
    font-size: 1.8rem !important;
}
/* Responsive adjustments for home */
@media (max-width: 1200px) {
    .home-compact .dashboard-container {
        max-width: 860px;
        padding: 0.6rem;
    }
}
@media (max-width: 992px) {
    .home-compact .dashboard-container {
        max-width: 780px;
        padding: 0.75rem;
    }
    .home-compact .row.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }
    .home-compact .card-enterprise .card-body {
        padding: 0.75rem 0.9rem;
    }
}
@media (max-width: 768px) {
    .home-compact .dashboard-container {
        max-width: 100%;
        padding: 0.75rem;
    }
    .home-compact .row.g-4 > * {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .home-compact .stats-card {
        padding: 0.85rem;
    }
    .home-compact .card-enterprise .card-body {
        padding: 0.8rem 0.95rem;
    }
}
@media (max-width: 576px) {
    .home-compact .dashboard-container {
        padding: 0.65rem;
    }
    .home-compact .stats-card {
        padding: 0.8rem;
    }
    .home-compact .card-enterprise .card-body {
        padding: 0.75rem 0.9rem;
    }
    .home-compact .btn,
    .home-compact .btn-lg {
        width: 100%;
    }
}
.home-compact .row.g-4 {
    --bs-gutter-x: 0.6rem;
    --bs-gutter-y: 0.6rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}
.home-compact .card-enterprise .card-body {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}
.home-compact .card-enterprise {
    margin-bottom: 0.35rem;
}
.home-compact .stats-card {
    padding: 0.65rem;
    font-size: 0.9rem;
}
.home-compact .stats-card .stats-value {
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
}
.home-compact .stats-card .stats-label {
    font-size: 0.78rem;
}
.home-compact .stats-card .stats-icon {
    width: 2.5rem;
    height: 2.5rem;
}
.home-compact h1.heading-enterprise,
.home-compact h2,
.home-compact h5 {
    margin-bottom: 0.3rem;
}
.home-compact p {
    margin-bottom: 0.32rem;
    font-size: 0.9rem;
}
.home-compact .card-enterprise p {
    font-size: 0.88rem;
}
.home-compact .card-enterprise h5 {
    font-size: 0.98rem;
}
.home-compact .btn,
.home-compact .btn-lg {
    padding: 0.4rem 0.85rem;
    font-size: 0.92rem;
}

.dashboard-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0;
}

/* ============================================================================
   Stats Cards
   ============================================================================ */

.stats-card {
    background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

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

.stats-card .stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.stats-card .stats-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stats-card .stats-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.stats-card-primary .stats-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
}

.stats-card-success .stats-icon {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: #ffffff;
}

.stats-card-warning .stats-icon {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: #ffffff;
}

.stats-card-info .stats-icon {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
    color: #ffffff;
}

/* ============================================================================
   Professional Spacing
   ============================================================================ */

.section-spacing {
    margin-bottom: 3rem;
}

.content-spacing {
    padding: 2rem 0;
}

/* ============================================================================
   Professional Typography
   ============================================================================ */

.heading-enterprise {
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.text-enterprise-primary {
    color: var(--primary-color) !important;
}

.text-enterprise-muted {
    color: var(--gray-600);
    font-size: 0.9375rem;
}

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

.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-card .stats-value {
        font-size: 1.5rem;
    }
}

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

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

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

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

.shadow-enterprise {
    box-shadow: var(--shadow-lg);
}

.border-enterprise {
    border: 1px solid var(--gray-200);
}

.rounded-enterprise {
    border-radius: var(--radius-lg);
}
