/* Professional Legal Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 24px;
}

.dashboard-header {
    margin-bottom: 32px;
    padding: 32px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-left: 6px solid var(--primary-blue);
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--navy), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* Enhanced Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--sky-blue));
    transition: height 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(14, 165, 233, 0.2);
}

.stat-card:hover::before {
    height: 6px;
}

.stat-value {
    font-size: 2.75rem;
    font-weight: 900;
    color: var(--navy);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-trend {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: slideIn 0.5s ease-out 0.2s both;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.stat-trend.positive {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.stat-trend.negative {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    margin-bottom: 16px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    position: absolute;
    top: 24px;
    right: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card:hover .stat-icon {
    transform: rotate(10deg) scale(1.1);
}

.stat-icon.cases { background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue)); }
.stat-icon.active { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-icon.settled { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.win-rate { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-icon.revenue { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-icon.clients { background: linear-gradient(135deg, #ec4899, #db2777); }
.stat-icon.utilization { background: linear-gradient(135deg, #f97316, #ea580c); }
.stat-icon.collection { background: linear-gradient(135deg, #14b8a6, #0d9488); }

/* KPI Section */
.kpi-section {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.kpi-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 12px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.kpi-item {
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: width 0.3s ease;
}

.kpi-item.status-green::before { background: #22c55e; }
.kpi-item.status-amber::before { background: #f59e0b; }
.kpi-item.status-red::before { background: #ef4444; }

.kpi-item:hover {
    transform: translateX(4px);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.kpi-item:hover::before {
    width: 6px;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 6px;
}

.kpi-change {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-change.positive { color: #16a34a; }
.kpi-change.negative { color: #dc2626; }
.kpi-change.neutral { color: #64748b; }

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.chart-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
}

.chart-container {
    height: 320px;
    position: relative;
}

.chart-full-width {
    grid-column: 1 / -1;
}

/* News & Research Section */
.news-section {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.news-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-container {
    position: relative;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 16px 56px 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.news-results {
    display: grid;
    gap: 16px;
}

.news-item {
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-left: 4px solid var(--primary-blue);
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-item:hover {
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.news-item-title {
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.news-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.news-item-excerpt {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Activity Section */
.activity-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.activity-card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.activity-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.activity-item:hover {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    transform: translateX(4px);
}

.activity-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-blue), var(--sky-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Tasks Section */
.tasks-section {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
}

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.tasks-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
}

.task-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.task-tab {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 2px solid transparent;
}

.task-tab.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.task-tab:hover:not(.active) {
    background: #e2e8f0;
    border-color: var(--primary-blue);
}

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background: #f8fafc;
    border: 2px solid transparent;
}

.task-item:hover {
    background: white;
    border-color: var(--primary-blue);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.task-checkbox:checked {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    border-color: var(--primary-blue);
}

.task-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.task-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-priority {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-high {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.priority-medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.priority-low {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }

    .activity-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title {
        font-size: 1.75rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility and Screen Reader Support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.update-timestamp {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.view-all-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: var(--dark-blue);
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-subtitle {
    font-size: 0.9rem;
}

.task-item-overdue {
    border-left: 4px solid #dc2626;
}

.activity-avatar-deadline {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* CSS Variables for consistent theming */
:root {
    --primary-blue: #0ea5e9;
    --dark-blue: #0369a1;
    --sky-blue: #38bdf8;
    --navy: #1e293b;
    --text-primary: #334155;
    --text-secondary: #64748b;
}
