/* Custom styles for modern dark/light theme */
:root {
    --transition-speed: 0.3s;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;
}

body {
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(249,250,251,0.98) 100%);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(229, 231, 235, 0.8);
    z-index: 40;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.dark .sidebar {
    background: linear-gradient(180deg, rgba(15,15,17,0.98) 0%, rgba(24,24,27,0.95) 100%);
    border-right: 1px solid rgba(39, 39, 42, 0.5);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 72px;
}

.dark .sidebar-header {
    border-bottom: 1px solid rgba(39, 39, 42, 0.5);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.sidebar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: #9333ea;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.dark .sidebar-brand {
    color: #c084fc;
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.dark .sidebar-section-title {
    color: #6b7280;
}

.sidebar.collapsed .sidebar-section-title {
    opacity: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    position: relative;
    white-space: nowrap;
}

.dark .sidebar-link {
    color: #9ca3af;
}

.sidebar-link:hover {
    background: rgba(168, 85, 247, 0.08);
    color: #9333ea;
}

.dark .sidebar-link:hover {
    background: rgba(192, 132, 252, 0.1);
    color: #c084fc;
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.12) 0%, rgba(168, 85, 247, 0.04) 100%);
    color: #9333ea;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #9333ea 0%, #a855f7 100%);
    border-radius: 0 2px 2px 0;
}

.dark .sidebar-link.active {
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.15) 0%, rgba(192, 132, 252, 0.05) 100%);
    color: #c084fc;
}

.dark .sidebar-link.active::before {
    background: linear-gradient(180deg, #c084fc 0%, #a855f7 100%);
}

.sidebar-link-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.sidebar-link-text {
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-link-text {
    opacity: 0;
    width: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark .sidebar-footer {
    border-top: 1px solid rgba(39, 39, 42, 0.5);
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

.dark .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Main content area adjustment for sidebar */
.main-with-sidebar {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

.main-with-sidebar.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Mobile sidebar */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }

    .main-with-sidebar {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 35;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   GLASS-MORPHISM UTILITIES
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid rgba(147, 51, 234, 0.15);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.dark .glass-card {
    background: rgba(24, 24, 27, 0.9);
    border: 1px solid rgba(147, 51, 234, 0.2);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.4),
        0 10px 15px -3px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(147, 51, 234, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* ============================================
   ENHANCED CARD STYLES
   ============================================ */
.card-modern {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .card-modern {
    background: #18181b;
    border: 1px solid rgba(39, 39, 42, 0.8);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(147, 51, 234, 0.05);
}

.card-modern:hover {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.06),
        0 12px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.dark .card-modern:hover {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.5),
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(147, 51, 234, 0.1);
    border-color: rgba(147, 51, 234, 0.3);
}

/* Stat cards with gradient accent */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark .stat-card {
    background: #18181b;
    border: 1px solid rgba(39, 39, 42, 0.8);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-start, #9333ea) 0%, var(--accent-end, #a855f7) 100%);
}

.stat-card.accent-primary { --accent-start: #9333ea; --accent-end: #a855f7; }
.stat-card.accent-green { --accent-start: #16a34a; --accent-end: #22c55e; }
.stat-card.accent-purple { --accent-start: #7c3aed; --accent-end: #a78bfa; }
.stat-card.accent-orange { --accent-start: #ea580c; --accent-end: #fb923c; }

/* ============================================
   ENHANCED HEADER STYLES
   ============================================ */
.top-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.dark .top-header {
    background: rgba(15, 15, 17, 0.95);
    border-bottom: 1px solid rgba(39, 39, 42, 0.5);
}

.header-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.dark .header-title {
    color: #f3f4f6;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================
   PAGE HEADER STYLES
   ============================================ */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dark .page-title {
    color: #f9fafb;
}

.page-title-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
    color: #9333ea;
}

.dark .page-title-icon {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.15) 0%, rgba(192, 132, 252, 0.05) 100%);
    color: #c084fc;
}

.page-description {
    color: #6b7280;
    font-size: 0.9375rem;
}

.dark .page-description {
    color: #9ca3af;
}

/* ============================================
   ENHANCED FORM STYLES
   ============================================ */
.form-card {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(229, 231, 235, 0.8);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark .form-card {
    background: #18181b;
    border: 1px solid rgba(39, 39, 42, 0.8);
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.dark .form-card-header {
    border-bottom: 1px solid rgba(39, 39, 42, 0.5);
}

.form-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
    color: #9333ea;
}

.dark .form-card-icon {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.15) 0%, rgba(192, 132, 252, 0.05) 100%);
    color: #c084fc;
}

.form-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.dark .form-card-title {
    color: #f3f4f6;
}

/* Enhanced form inputs */
.form-input-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.dark .form-input-modern {
    border-color: #27272a;
    background: #0f0f11;
    color: #f4f4f5;
}

.form-input-modern:focus {
    outline: none;
    border-color: #a855f7;
    background: white;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.dark .form-input-modern:focus {
    border-color: #a855f7;
    background: #18181b;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15), 0 0 20px rgba(147, 51, 234, 0.1);
}

/* ============================================
   ENHANCED STATUS CARD
   ============================================ */
.status-card-modern {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(229, 231, 235, 0.8);
    padding: 1.5rem;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}

.dark .status-card-modern {
    background: #18181b;
    border: 1px solid rgba(39, 39, 42, 0.8);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.status-indicator.status-ready {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(156, 163, 175, 0.05) 100%);
}

.status-indicator.status-processing {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.status-indicator.status-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
}

.status-indicator.status-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.status-indicator.status-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
}

/* Enhanced progress bar */
.progress-modern {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.dark .progress-modern {
    background: #27272a;
}

.progress-modern-bar {
    height: 100%;
    background: linear-gradient(90deg, #9333ea 0%, #a855f7 100%);
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-modern-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   ENHANCED BUTTON STYLES
   ============================================ */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modern-primary {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.3);
}

.btn-modern-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6b21a8 100%);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.4);
    transform: translateY(-1px);
}

.btn-modern-primary:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-modern-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.dark .btn-modern-secondary {
    background: #27272a;
    color: #e4e4e7;
    border: 1px solid #3f3f46;
}

.btn-modern-secondary:hover {
    background: #e5e7eb;
}

.dark .btn-modern-secondary:hover {
    background: #3f3f46;
}

/* ============================================
   QUICK ACTIONS SECTION
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dark .quick-action-btn {
    background: #18181b;
    border-color: #27272a;
    color: #e4e4e7;
}

.quick-action-btn:hover {
    border-color: #a855f7;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
    transform: translateY(-2px);
}

.dark .quick-action-btn:hover {
    border-color: #a855f7;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.2), 0 0 20px rgba(147, 51, 234, 0.1);
    background: #1c1c20;
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
    color: #9333ea;
}

.dark .quick-action-icon {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.15) 0%, rgba(192, 132, 252, 0.05) 100%);
    color: #c084fc;
}

/* Button animations and styles */
.btn-primary {
    background-color: #9333ea; /* primary-600 */
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.btn-primary:hover {
    background-color: #7c3aed; /* primary-700 */
}

.btn-secondary {
    background-color: #e5e7eb; /* gray-200 */
    color: #1f2937; /* gray-800 */
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.dark .btn-secondary {
    background-color: #27272a;
    color: #e4e4e7;
}
.btn-secondary:hover {
    background-color: #d1d5db; /* gray-300 */
}
.dark .btn-secondary:hover {
    background-color: #3f3f46;
}

.btn-outline {
    border: 1px solid #9333ea; /* primary-600 */
    color: #9333ea; /* primary-600 */
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.dark .btn-outline {
    border: 1px solid #c084fc; /* primary-400 */
    color: #c084fc; /* primary-400 */
}
.btn-outline:hover {
    background-color: #faf5ff; /* purple-50 */
}
.dark .btn-outline:hover {
    background-color: rgba(147, 51, 234, 0.15); /* purple-600/15 */
}

.btn-animated {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-animated:active {
    transform: translateY(0);
}

/* Card hover effect for dashboard links */
.card-animated {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border-top: 3px solid transparent;
}

.card-animated:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    border-top: 3px solid #a855f7; /* primary-500 */
}

.dark .card-animated:hover {
    border-top: 3px solid #c084fc; /* primary-400 */
}

/* Icon styling for dashboard cards */
.card-icon {
    font-size: 2.5rem;
    color: #9333ea; /* primary-600 */
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.dark .card-icon {
    color: #c084fc; /* primary-400 */
}

.card-animated:hover .card-icon {
    transform: scale(1.15);
}

/* Form styling */
.form-input {
    width: 100%;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db; /* gray-300 */
    background-color: white;
    color: #1f2937; /* gray-800 */
    padding: 0.5rem 0.75rem;
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.dark .form-input {
    border-color: #27272a;
    background-color: #18181b;
    color: #e4e4e7;
}
.form-input:focus {
    outline: none;
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
    --tw-ring-color: #a855f7; /* primary-500 */
    border-color: transparent;
}

.form-label {
    display: block;
    color: #374151; /* gray-700 */
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.dark .form-label {
    color: #d4d4d8;
}

.form-group {
    margin-bottom: 1rem;
}

/* Progress bars */
.progress-container {
    width: 100%;
    background-color: #e5e7eb; /* gray-200 */
    border-radius: 9999px;
    height: 1rem;
    overflow: hidden;
}
.dark .progress-container {
    background-color: #27272a;
}

.progress-bar {
    background-color: #9333ea; /* primary-600 */
    height: 100%;
    border-radius: 9999px;
    transition-property: all;
    transition-duration: 500ms;
}
.dark .progress-bar {
    background-color: #a855f7; /* primary-500 */
}

/* Better tables */
.table-container {
    overflow-x: auto;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.dark .table-container {
    background-color: #18181b;
}

table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table thead {
    background-color: #f9fafb; /* gray-50 */
}
.dark table thead {
    background-color: #0f0f11;
}

table th {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280; /* gray-500 */
}
.dark table th {
    color: #9ca3af; /* gray-400 */
}

table tbody {
    background-color: white;
}
.dark table tbody {
    background-color: #18181b;
}

table tbody tr {
    transition-property: background-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

table tbody tr:hover {
    background-color: #f9fafb; /* gray-50 */
}
.dark table tbody tr:hover {
    background-color: rgba(39, 39, 42, 0.5);
}

table td {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #6b7280; /* gray-500 */
}
.dark table td {
    color: #9ca3af; /* gray-400 */
}

/* Skeleton loading animation */
.skeleton {
    animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite;
    background-color: #e5e7eb; /* gray-200 */
    border-radius: 0.25rem;
}
.dark .skeleton {
    background-color: #27272a;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 10;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: white;
    background-color: #111827; /* gray-900 */
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition-property: opacity;
    transition-duration: 300ms;
    max-width: max-content;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
}
.dark .tooltip .tooltip-text {
    background-color: #18181b;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #0f0f11;
}

::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3f3f46;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* Menu transitions */
#mobile-menu {
    transition: max-height 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.show {
    max-height: 500px;
}

/* Loading spinner */
.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7; /* green-100 */
    color: #166534; /* green-800 */
}
.dark .badge-success {
    background-color: rgba(20, 83, 45, 0.5); /* green-900/50 */
    color: #86efac; /* green-300 */
}

.badge-warning {
    background-color: #fef9c3; /* yellow-100 */
    color: #854d0e; /* yellow-800 */
}
.dark .badge-warning {
    background-color: rgba(113, 63, 18, 0.5); /* yellow-900/50 */
    color: #fde047; /* yellow-300 */
}

.badge-error {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b; /* red-800 */
}
.dark .badge-error {
    background-color: rgba(127, 29, 29, 0.5); /* red-900/50 */
    color: #fca5a5; /* red-300 */
}

.badge-info {
    background-color: #f3e8ff; /* purple-100 */
    color: #6b21a8; /* purple-800 */
}
.dark .badge-info {
    background-color: rgba(88, 28, 135, 0.5); /* purple-900/50 */
    color: #d8b4fe; /* purple-300 */
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .card-animated {
        margin-bottom: 1rem;
    }

    .btn-animated:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ============================================
   MOBILE MENU BUTTON
   ============================================ */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .mobile-menu-btn {
    color: #e4e4e7;
}

.mobile-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark .mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* ============================================
   USER MENU DROPDOWN
   ============================================ */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark .user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 500;
    color: #374151;
}

.dark .user-name {
    color: #e4e4e7;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 180px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 50;
}

.dark .user-dropdown {
    background: #18181b;
    border-color: #27272a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(147, 51, 234, 0.1);
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
}

.dark .user-dropdown-item {
    color: #e4e4e7;
}

.user-dropdown-item:hover {
    background: #f3f4f6;
}

.dark .user-dropdown-item:hover {
    background: #27272a;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

.dark .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}

/* ============================================
   EMPTY STATE STYLING
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(156, 163, 175, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.5rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.dark .empty-state-title {
    color: #e5e7eb;
}

.empty-state-description {
    color: #6b7280;
    font-size: 0.9375rem;
}

.dark .empty-state-description {
    color: #9ca3af;
}

/* ============================================
   ACTIVITY LIST STYLING
   ============================================ */
.activity-list {
    divide-y: 1px solid #e5e7eb;
}

.dark .activity-list {
    divide-y: 1px solid #374151;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    transition: background 0.15s ease;
}

.activity-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.dark .activity-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

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

.activity-title {
    font-weight: 500;
    color: #111827;
    font-size: 0.9375rem;
}

.dark .activity-title {
    color: #f3f4f6;
}

.activity-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.125rem;
}

.dark .activity-description {
    color: #9ca3af;
}

.activity-time {
    color: #9ca3af;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.dark .activity-time {
    color: #6b7280;
}

/* ============================================
   INFO LIST STYLING (What happens next section)
   ============================================ */
.info-list {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.dark .info-list {
    border-top-color: #374151;
}

.info-list-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.dark .info-list-title {
    color: #9ca3af;
}

.info-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.375rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.dark .info-list-item {
    color: #9ca3af;
}

.info-list-item i {
    color: #22c55e;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* ============================================
   WELCOME SECTION
   ============================================ */
.welcome-section {
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.dark .welcome-title {
    color: #f9fafb;
}

.welcome-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.dark .welcome-subtitle {
    color: #9ca3af;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.dark .stat-value {
    color: #f9fafb;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dark .stat-label {
    color: #9ca3af;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
