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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Header */
.header {
    background: linear-gradient(135deg,rgb(155, 129, 84) 0%,rgb(224, 235, 227) 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Government Header */
.header-banner {
    background: linear-gradient(135deg,rgb(49, 115, 62) 0%,rgb(9, 81, 32) 100%);
    padding: 1rem 0;
    border-bottom: 3px solid #fbbf24;
}

.government-header {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    gap: 2rem;
}

.emblem {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-emblem, .india-flag {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.header-titles {
    text-align: center;
    flex: 1;
}

.main-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.department-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 0.3rem 0;
    color: #fbbf24;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Mobile menu toggle - hidden on desktop */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    color: #111827;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    white-space: nowrap;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: rgb(107, 14, 14);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-info {
    background: #0ea5e9;
    color: white;
    border: 1px solid #0284c7;
}

.btn-info:hover {
    background: #0284c7;
    border-color: #0369a1;
    transform: translateY(-1px);
}

.btn-ai {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: white;
    border: 1px solid #7c3aed;
    position: relative;
    overflow: hidden;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-ai:hover::before {
    left: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Stats Section */
.stats-section {
    margin: 2rem 0;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
    border: 1px solid #e5e7eb;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #10b981, #047857); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.stat-content p {
    color: #6b7280;
    font-weight: 500;
}

/* Controls */
.controls-section {
    margin: 2rem 0;
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-select,
.form-input {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cases Section */
.cases-section {
    margin: 2rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.6) 0%, rgba(241, 245, 249, 0.85) 100%);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.08);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.9) 0%, rgba(13, 148, 136, 0.85) 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(22, 101, 52, 0.25);
    font-size: 1.2rem;
}

.section-title-text h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #123524;
    margin-bottom: 0.25rem;
}

.section-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.section-actions-primary {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(45, 212, 191, 0.3);
}

.count-badge i {
    font-size: 1rem;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #0f172a;
    padding: 0.55rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1) 0%, rgba(45, 212, 191, 0.1) 100%);
    border-color: rgba(45, 212, 191, 0.6);
    color: #0f766e;
    box-shadow: 0 12px 20px rgba(45, 212, 191, 0.18);
}

.section-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0) 0%, rgba(148, 163, 184, 0.35) 50%, rgba(148, 163, 184, 0) 100%);
}

.section-actions .pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-actions .pagination-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-actions .form-select-compact {
    min-width: 120px;
    padding: 0.45rem 2rem 0.45rem 0.9rem;
    border-radius: 12px;
}

.section-actions .form-select-compact option {
    padding: 0.65rem;
}

@media (max-width: 768px) {
    .section-header {
        padding: 1rem 1.25rem;
    }

    .section-actions {
        width: 100%;
        justify-content: space-between;
    }

    .section-divider {
        display: none;
    }

    .section-actions .pagination-controls {
        width: 100%;
        justify-content: space-between;
    }
}

.stat-label-icon {
    margin-right: 0.35rem;
    color: #2563eb;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 2rem;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 75vh;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.cases-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: white;
}

/* Column search row */
.search-row {
    background-color: #f8fafc !important;
}

.search-row th {
    padding: 8px !important;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: middle;
}

.column-search {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    box-sizing: border-box;
}

.column-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.column-search[type="date"] {
    font-family: inherit;
}

/* Column widths for better visibility */
.cases-table th:nth-child(1) { width: 12%; } /* Case Number */
.cases-table th:nth-child(2) { width: 14%; } /* Parties */
.cases-table th:nth-child(3) { width: 10%; } /* Status */
.cases-table th:nth-child(4) { width: 10%; } /* Next Hearing */
.cases-table th:nth-child(5) { width: 9%; } /* Prabhari Adhikari */
.cases-table th:nth-child(6) { width: 8%; } /* Compliance Status */
.cases-table th:nth-child(7) { width: 9%; } /* Complying Officer */
.cases-table th:nth-child(8) { width: 12%; } /* Compliance Instruction */
.cases-table th:nth-child(9) { width: 16%; } /* Case Summary */
.cases-table th:nth-child(10) { width: 8%; } /* Documents */
.cases-table th:nth-child(11) { width: 22%; } /* Actions */

.cases-table thead th {
    background: #fafafa;
    padding: 16px 20px;
    text-align: left;
    font-weight: 500;
    color: #616161;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

/* Keep only the column label row sticky, not the search row */
.cases-table thead tr.header-row th {
    position: sticky;
    top: 0;
    z-index: 4;
}
.cases-table thead tr.search-row th { position: static !important; top: auto !important; }

.cases-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    vertical-align: top;
    color: #424242;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Compact icon buttons in action column */
.action-menu .btn {
    padding: 4px !important;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.action-menu .btn i { font-size: 14px; }

/* Column minimum widths */
.cases-table th:nth-child(8), .cases-table td:nth-child(8) { min-width: 320px; } /* Compliance Instruction */
.cases-table th:nth-child(9), .cases-table td:nth-child(9) { min-width: 280px; } /* Case Summary */
.cases-table th:nth-child(10), .cases-table td:nth-child(10) { min-width: 160px; } /* Documents */
.cases-table th:nth-child(11), .cases-table td:nth-child(11) { min-width: 320px; } /* Actions */

.documents-cell { min-width: 160px; }

/* Case Summary Cell Styling */
.case-summary-cell {
    min-width: 280px;
    font-size: 13px;
    line-height: 1.4;
}

.case-summary-text-wrapper {
    max-height: 140px;
    overflow-y: auto;
    color: #374151;
    padding-right: 6px;
    word-break: break-word;
}

.case-summary-text-wrapper p {
    margin: 0 0 8px 0;
}

.case-summary-text-wrapper::-webkit-scrollbar {
    width: 6px;
}

.case-summary-text-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Freeze first column */
.cases-table thead th:first-child,
.cases-table tbody td:first-child {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 2;
    box-shadow: 2px 0 0 rgba(229, 231, 235, 0.8);
}

/* Documents column */
.documents-cell {
    display: flex;
    gap: 8px;
    max-width: 220px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.documents-cell::-webkit-scrollbar {
    height: 6px;
}
.documents-cell::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.doc-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    height: 32px;
    border-radius: 16px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    font-size: 12px;
    cursor: pointer;
}
.doc-chip:hover {
    background: #e0e7ff;
}
.no-docs { color: #9ca3af; }

/* Allow in-cell scrolling for long texts */
.compliance-instruction-preview .compliance-text-wrapper {
    max-height: 110px; /* Taller viewport for reading */
    overflow-y: auto;  /* Enable in-cell scrolling */
}
.compliance-instruction-preview .compliance-text-wrapper::-webkit-scrollbar { width: 6px; }
.compliance-instruction-preview .compliance-text-wrapper::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.compliance-instruction-preview .compliance-text-full {
    display: block; /* remove clamp to allow scroll */
    overflow: visible;
}

@media (max-width: 1024px) {
    .cases-table { min-width: 1800px; }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .table-container { max-height: 75vh; }
    .cases-table td { padding: 10px 8px; font-size: 13px; }
    .cases-table thead th { padding: 12px 8px; font-size: 13px; }
    .action-menu .btn { width: 28px; height: 28px; }
    .documents-cell { max-width: 140px; }
}

.cases-table tbody tr {
    transition: all 0.2s ease;
}

.cases-table tbody tr:hover {
    background-color: #fafafa;
}

.cases-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.cases-table tbody tr:nth-child(even):hover {
    background-color: #f5f5f5;
}

/* Expand Toggle */
.expand-toggle {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.expand-toggle:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.expand-toggle.expanded {
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Case Data Display */
.case-number-main {
    font-weight: 700;
    color: #1e40af;
    font-size: 15px;
    margin-bottom: 4px;
}

.case-registration {
    font-size: 11px;
    color: #6b7280;
}

.parties-text {
    color: #374151;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.parties-count {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-disposed {
    background: #fee2e2;
    color: #dc2626;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-listed {
    background: #dbeafe;
    color: #1e40af;
}

.status-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

.status-no-data {
    background: #fef3c7;
    color: #92400e;
}

/* Hearing Display */
.hearing-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 2px;
}

.hearing-label-past {
    color: #dc2626;
}

.hearing-date {
    font-weight: 600;
    margin-bottom: 4px;
}

.hearing-upcoming {
    color: #059669;
}

.hearing-overdue {
    color: #dc2626;
}

.hearing-purpose {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
}

.hearing-coram {
    font-size: 11px;
    color: #7c3aed;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2px;
}

.no-hearing {
    color: #9ca3af;
    font-style: italic;
}

/* Bench Display */
.bench-name {
    font-weight: 500;
    color: #1f2937;
}

.bench-coram {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

/* Data Status Indicators */
.hc-data-available {
    border-left: 4px solid #10b981;
}

.hc-data-pending {
    border-left: 4px solid #f59e0b;
}

/* Action Menu (New Design) */
.action-menu {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.primary-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.actions-dropdown {
    position: relative;
}

.dropdown-btn {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
    border-radius: 6px;
    z-index: 1000;
    border: 1px solid #e5e7eb;
    padding: 4px 0;
    margin-top: 4px;
}

.dropdown-content button {
    background: none;
    border: none;
    padding: 8px 16px;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

.dropdown-content button:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.dropdown-content .delete-action {
    color: #dc2626;
}

.dropdown-content .delete-action:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 4px 0;
}

/* Legacy Action Buttons (keep for compatibility) */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.action-buttons .btn {
    flex-shrink: 0;
}

/* Expandable Details */
.case-detail-row {
    display: none;
}

.case-detail-row.show {
    display: table-row;
}

.case-detail-row td {
    padding: 0;
    border: none;
}

.case-detail-content {
    background: #f8fafc;
    margin: 0 12px 12px 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    animation: slideDown 0.3s ease-out;
}

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

.case-detail-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.case-detail-body {
    padding: 20px;
}

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

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

.detail-section h4 {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.detail-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.detail-value {
    color: #1f2937;
    font-weight: 500;
    line-height: 1.4;
}

/* AI Summary Styles */
.summary-section {
    margin-top: 20px;
    border-top: 2px solid #e5e7eb;
    padding-top: 20px;
}

.summary-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px dashed #0ea5e9;
    margin: 20px 0;
}

.summary-loading i {
    font-size: 2.5rem;
    color: #0ea5e9;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

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

.summary-loading p {
    color: #0c4a6e;
    text-align: center;
    font-weight: 500;
    margin-bottom: 8px;
}

.summary-loading small {
    color: #0369a1;
    text-align: center;
    font-size: 12px;
}

.summary-content {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin: 15px 0;
    line-height: 1.7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.summary-content::-webkit-scrollbar {
    width: 8px;
}

.summary-content::-webkit-scrollbar-thumb {
    background: #cbd5f5;
    border-radius: 4px;
}

.summary-content::-webkit-scrollbar-track {
    background: transparent;
}

.summary-empty-state {
    border: 1px dashed #cbd5f5;
    border-radius: 12px;
    padding: 32px 24px;
    margin: 20px 0;
    text-align: center;
    color: #4c51bf;
    background: #f8fafc;
}

.summary-empty-state i {
    font-size: 28px;
    margin-bottom: 12px;
}

.summary-empty-state p {
    margin: 6px 0;
    color: #1e3a8a;
}

.summary-content h1,
.summary-content h2,
.summary-content h3,
.summary-content h4,
.summary-content h5,
.summary-content h6 {
    color: #1e40af;
    font-weight: 700;
    margin: 20px 0 12px 0;
    line-height: 1.3;
}

.summary-content h1 { font-size: 1.5rem; }
.summary-content h2 { font-size: 1.3rem; }
.summary-content h3 { font-size: 1.2rem; }
.summary-content h4 { font-size: 1.1rem; }
.summary-content h5 { font-size: 1.05rem; }

.summary-content p {
    margin-bottom: 16px;
    color: #374151;
}

.summary-content strong {
    color: #1f2937;
    font-weight: 600;
}

.summary-content ul,
.summary-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.summary-content li {
    margin-bottom: 8px;
    color: #374151;
}

.summary-content blockquote {
    border-left: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.summary-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
}

.summary-error i {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.summary-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.summary-rich-text {
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    margin-bottom: 20px;
}

.structured-summary-card {
    background: linear-gradient(120deg, rgba(240, 253, 244, 0.95) 0%, rgba(219, 234, 254, 0.9) 100%);
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 24px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
    margin-top: 24px;
}

.structured-summary-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    color: #0f172a;
}

.structured-summary-header i {
    font-size: 1.6rem;
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
    border-radius: 12px;
    padding: 12px;
}

.structured-summary-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.structured-summary-header p {
    margin: 2px 0 0;
    font-size: 0.9rem;
    color: #475569;
}

.structured-summary-body {
    display: grid;
    gap: 18px;
}

.structured-summary-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.6);
    overflow: hidden;
}

.structured-summary-section h4 {
    margin: 0;
    padding: 14px 18px;
    background: rgba(30, 64, 175, 0.08);
    color: #1e3a8a;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.structured-summary-table-wrapper {
    overflow-x: auto;
}

.structured-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.structured-summary-table th,
.structured-summary-table td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    vertical-align: top;
    text-align: left;
}

.structured-summary-table th {
    width: 28%;
    font-weight: 600;
    color: #0f172a;
}

.structured-summary-table td {
    color: #1f2937;
}

.structured-summary-table tr:last-child th,
.structured-summary-table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .summary-rich-text {
        padding: 18px;
    }
    .structured-summary-card {
        padding: 18px;
    }
    .structured-summary-table th,
    .structured-summary-table td {
        padding: 10px 14px;
    }
}

.summary-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cached-badge {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fresh-badge {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Loading & Toast */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
    min-width: 320px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }

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

.toast-title {
    font-weight: 600;
    color: #1f2937;
}

.toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.25rem;
}

.toast-message {
    color: #6b7280;
    font-size: 14px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header tweaks for mobile */
    .government-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    .mp-emblem, .india-flag {
        height: 56px;
    }
    .header-content { flex-direction: column; gap: 0.75rem; text-align: center; padding: 0.75rem 1rem; }
    .header-titles {
        padding: 0 8px;
    }
    .main-title {
        font-size: 1.35rem;
        line-height: 1.25;
        letter-spacing: 0.2px;
        padding: 0 8px;
        word-break: break-word;
    }
    /* Collapse actions by default on mobile; toggled open via JS */
    .header-actions { display: none; flex-wrap: wrap; justify-content: center; gap: 0.5rem; width: 100%; }
    .header-actions.open { display: flex; }
    .mobile-menu-toggle { display: inline-flex; align-self: center; }
    .header-actions .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .cases-table {
        font-size: 12px;
    }
    
    .cases-table th,
    .cases-table td {
        padding: 8px 6px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Additional styles for better party/advocate display */
.parties-detailed {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.parties-detailed h5 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.party-item {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.party-item:last-child {
    margin-bottom: 0;
}

.party-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.party-relation {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 4px;
}

.party-address {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.advocates-section {
    margin-top: 16px;
    padding: 16px;
    background: #fef3c7;
    border-radius: 8px;
    border: 1px solid #fbbf24;
}

.advocates-section h5 {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.advocate-item {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #fbbf24;
    font-size: 13px;
}

.advocate-item:last-child {
    margin-bottom: 0;
}

.advocate-item strong {
    color: #92400e;
}

/* Hearing List */
.hearing-list {
    max-height: 300px;
    overflow-y: auto;
}

.hearing-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #3b82f6;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.hearing-item.listed {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.hearing-date-item {
    font-weight: 600;
    color: #1f2937;
}

.hearing-purpose-item {
    color: #6b7280;
    font-size: 13px;
}

.hearing-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.hearing-status.listed {
    background: #dcfce7;
    color: #166534;
}

.hearing-status.not-listed {
    background: #f3f4f6;
    color: #6b7280;
}

/* Judgment List */
.judgment-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #8b5cf6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.judgment-item.final {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.judgment-content {
    flex: 1;
}

.judgment-date {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.judgment-type {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.judgment-type.final {
    background: #dc2626;
    color: white;
}

.final-badge {
    background: #dc2626;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

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

.pdf-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #dc2626;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 18px;
}

.pdf-link:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.no-pdf {
    color: #6b7280;
    font-style: italic;
    font-size: 12px;
}

/* Case category and stage sections */
.case-category-section, .case-stage-section {
    margin-top: 16px;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #0ea5e9;
}

.case-category-section h5, .case-stage-section h5 {
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-grid, .stage-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.category-item, .stage-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #0ea5e9;
    font-size: 13px;
}

.category-item strong, .stage-item strong {
    color: #0c4a6e;
}

/* Focused Summary Styles */
.summary-content h2 {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 20px 0 12px 0;
    color: #0c4a6e;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Special styling for different sections */
.summary-content h2:nth-of-type(1) {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0ea5e9;
}

.summary-content h2:nth-of-type(2) {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #10b981;
    color: #065f46;
}

.summary-content h2:nth-of-type(3) {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.summary-content h2:nth-of-type(4) {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
    color: #991b1b;
}

/* Highlight important status indicators */
.summary-content strong:contains("STAY"),
.summary-content strong:contains("DISPOSED"),
.summary-content strong:contains("INJUNCTION"),
.summary-content strong:contains("COMPLIANCE") {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.summary-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #374151;
}

/* Compact list styling */
.summary-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.summary-content li {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f9fafb;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 12px;
    color: #6b7280;
}

/* Tabs */
.case-details-tabs {
    margin-top: 1rem;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-button:hover {
    color: #374151;
    background: #f3f4f6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Button Enhancements */
.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Case Table Enhancements */
.compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.compliance-done {
    background: #dcfce7;
    color: #16a34a;
}

.compliance-pending {
    background: #fef3c7;
    color: #d97706;
}

.compliance-no {
    background: #fee2e2;
    color: #dc2626;
}

.edit-inline-btn {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
}

.edit-inline-btn:hover {
    background: #dbeafe;
}

/* Compliance instruction preview */
.compliance-instruction-preview {
    font-size: 0.875rem;
    color: #374151;
    max-width: 300px;
    min-height: 40px;
    word-wrap: break-word;
    font-style: italic;
    line-height: 1.4;
}

.compliance-text-wrapper {
    max-height: 80px;
    overflow-y: auto;
    padding: 4px 0;
    border-radius: 4px;
}

.compliance-text-full {
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    font-size: 0.875rem;
    color: #374151;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 4rem 2rem !important;
}

.empty-content {
    color: #6b7280;
}

.empty-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-content p {
    font-size: 0.875rem;
    margin: 0;
}

/* Case Overview Styles */
.case-overview {
    padding: 1rem;
}

/* Action buttons section */
.action-buttons-section {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-buttons-section .btn {
    min-width: 160px;
}

/* Compliance instruction text styling */
.compliance-instruction-text {
    background: #fef3c7;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 4px solid #f59e0b;
    font-style: italic;
    color: #92400e;
    max-height: 100px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.4;
}


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

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.overview-item label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.overview-item span {
    color: #111827;
    font-size: 1rem;
}

.remarks-section, .compliance-instruction {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.remarks-section h4, .compliance-instruction h4 {
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
}

.compliance-extracted {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.compliance-extracted h4 {
    margin: 0 0 0.5rem 0;
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 600;
}

.compliance-text {
    color: #78350f;
    font-style: italic;
    margin: 0;
}

.summary-meta {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.summary-meta small {
    color: #6b7280;
}

/* Responsive for mobile */
@media (max-width: 768px) {
    .summary-content h2 {
        font-size: 1rem;
        padding: 6px 12px;
    }

    .summary-content {
        padding: 16px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tab-buttons {
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1;
        min-width: 100px;
    }
}

/* Complying Officer Styling */
.complying-officer-name {
    font-weight: 500;
    color: #059669;
    font-size: 0.9em;
}

.officer-name {
    font-weight: 500;
    color: #4338ca;
}

.compliance-section {
    margin-bottom: 16px;
}

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

/* Enhanced AI Search Icon */
.btn-primary .fa-magic {
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #d97706);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: magicGlow 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.3));
}

.btn-primary:hover .fa-magic {
    animation-duration: 0.5s;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
}

@keyframes magicGlow {
    0% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.1);
    }
    100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
}

/* Enhanced action buttons */
.action-buttons .btn-sm {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.action-buttons .btn-sm::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.action-buttons .btn-sm:hover::before {
    left: 100%;
}

.action-buttons .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dashboard Styles */
.dashboard-section {
    margin-bottom: 2rem;
}

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

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.chart-header {
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.chart-container {
    height: 300px;
    position: relative;
}

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

.officer-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

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

.officer-header .officer-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.case-count {
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #6b7280;
}

.officer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-value.pending {
    color: #f59e0b;
}

.stat-value.done {
    color: #10b981;
}

.stat-value.disposed {
    color: #6b7280;
}

.workload-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.workload-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b);
    transition: width 0.3s ease;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.upload-card, .recent-uploads-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.upload-header {
    margin-bottom: 1.5rem;
}

.upload-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.uploads-list {
    max-height: 400px;
    overflow-y: auto;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.upload-icon {
    font-size: 1.5rem;
    color: #6b7280;
}

.upload-details {
    flex: 1;
}

.upload-filename {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.upload-meta {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    gap: 1rem;
}

.upload-type {
    background: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.no-data, .no-uploads {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

/* Responsive adjustments for dashboard */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .upload-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .officer-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    color: #6b7280;
    font-size: 0.875rem;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.page-number:hover {
    background: #f9fafb;
    border-color: #3b82f6;
}

.page-number.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.page-number.disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .pagination-buttons {
        justify-content: center;
    }

    .pagination-controls {
        justify-content: center;
    }
}

/* File Upload Modal Styles */
.file-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.file-preview h4 {
    margin-bottom: 0.75rem;
    color: #374151;
    font-size: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid #d1d5db;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    font-size: 1.25rem;
    color: #6b7280;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-remove {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-remove:hover {
    background: #dc2626;
}

.upload-progress {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
}

/* Login & Signup Page Styles */
.login-body {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-header .logo i {
    font-size: 2.5rem;
    color: #fbbf24;
    margin-bottom: 8px;
}

.login-header .logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.login-header .subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.login-form-container {
    padding: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group label i {
    color: #6b7280;
    width: 16px;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.875rem;
    color: #1e40af;
}

.form-note i {
    color: #3b82f6;
    margin-top: 2px;
    flex-shrink: 0;
}

.btn-full {
    width: 100%;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

.login-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.message {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.message-success {
    border-left: 4px solid #10b981;
    color: #065f46;
}

.message-success i {
    color: #10b981;
}

.message-error {
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.message-error i {
    color: #ef4444;
}

.message-info {
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.message-info i {
    color: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design for Login/Signup */
@media (max-width: 480px) {
    .login-container {
        padding: 0 15px;
    }

    .login-form-container {
        padding: 1.5rem;
    }

    .login-header {
        padding: 1.5rem;
    }

    .message-container {
        left: 15px;
        right: 15px;
        max-width: none;
    }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 1024px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
    }

    .cases-table {
        font-size: 0.875rem;
    }

    .cases-table th,
    .cases-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    /* Header improvements */
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .header-actions .btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    /* Table mobile optimizations */
    .cases-table {
        min-width: 1000px;
        font-size: 0.8rem;
    }

    .case-number {
        font-size: 0.75rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .parties-info {
        max-width: 140px;
        font-size: 0.75rem;
        line-height: 1.2;
    }

    /* Action menu mobile */
    .primary-actions .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .dropdown-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    /* Modal improvements */
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    /* Tab improvements */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        min-width: 100px;
        font-size: 0.875rem;
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .tab-content {
        padding: 1rem;
    }

    /* Filters mobile */
    .filters {
        padding: 1rem;
        margin: 0 -15px;
        background: white;
        border-radius: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Pagination mobile */
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-info {
        font-size: 0.875rem;
        text-align: center;
    }

    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Very small mobile screens */
    .container {
        padding: 0 10px;
    }

    .header {
        padding: 1rem 0;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.75rem;
        text-align: center;
    }

    .stat-card h3 {
        font-size: 1.25rem;
    }

    /* Ultra-compact table */
    .cases-table {
        font-size: 0.7rem;
        min-width: 900px;
    }

    .cases-table th,
    .cases-table td {
        padding: 6px 4px;
    }

    .case-number {
        max-width: 100px;
        font-size: 0.65rem;
    }

    .parties-info {
        max-width: 110px;
        font-size: 0.65rem;
    }

    /* Mobile actions */
    .primary-actions .btn {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .dropdown-btn {
        padding: 4px 6px;
        font-size: 0.65rem;
    }

    .dropdown-content {
        min-width: 140px;
        font-size: 0.75rem;
    }

    /* Modal ultra-mobile */
    .modal-content {
        margin: 5px;
        border-radius: 8px;
        max-height: calc(100vh - 20px);
    }

    .modal-header {
        padding: 0.75rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .tab-content {
        padding: 0.75rem;
    }

    .detail-section h4 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .detail-value {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    /* Filters ultra-mobile */
    .filters {
        padding: 0.75rem;
    }

    .filter-group label {
        font-size: 0.8rem;
    }

    .filter-group select,
    .filter-group input {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* Sortable Table Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: #f3f4f6;
}

.sort-icon {
    margin-left: 8px;
    color: #9ca3af;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.sortable:hover .sort-icon {
    color: #4f46e5;
}

.sortable.sort-asc .sort-icon {
    color: #4f46e5;
}

.sortable.sort-desc .sort-icon {
    color: #4f46e5;
}

.sortable.sort-asc .sort-icon::before {
    content: "\f0de"; /* fa-sort-up */
}

.sortable.sort-desc .sort-icon::before {
    content: "\f0dd"; /* fa-sort-down */
}

/* Admin Panel Styles */
.admin-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.user-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.user-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.user-card.pending {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.user-card.inactive {
    border-color: #6b7280;
    background: #f9fafb;
    opacity: 0.7;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: #6b7280;
}

.user-avatar.admin {
    background: #7c3aed;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #1f2937;
}

.role-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #374151;
}

.user-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

.user-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.user-status.active {
    background: #d1fae5;
    color: #065f46;
}

.user-status.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.user-details {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.user-details p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.activities-list {
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

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

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

.activity-icon.success {
    background: #10b981;
}

.activity-icon.info {
    background: #3b82f6;
}

.activity-icon.danger {
    background: #ef4444;
}

.activity-content {
    flex: 1;
}

.activity-description {
    font-size: 0.95rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.activity-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.activity-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.activity-ip {
    font-family: 'Monaco', 'Menlo', monospace;
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #374151;
}

.loading-message {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.stat-icon.admin {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.stat-icon.info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

/* Message Styles for Signup */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.form-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #0c4a6e;
}

.form-note i {
    color: #0284c7;
    margin-top: 0.125rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive admin panel */
@media (max-width: 768px) {
    .users-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .user-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .user-actions {
        justify-content: center;
        margin-top: 1rem;
    }

    .activity-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .activity-icon {
        align-self: flex-start;
    }
}

/* Case History Timeline Styles */
.history-timeline {
    position: relative;
    padding: 1rem 0;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #3b82f6, #e5e7eb);
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.history-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.history-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.history-icon.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.history-content {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.history-description {
    font-size: 0.95rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.history-description strong {
    color: #1f2937;
}

.history-description em {
    color: #6366f1;
    font-style: normal;
    font-weight: 500;
}

.history-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.history-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.history-ip {
    font-family: 'Monaco', 'Menlo', monospace;
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.history-changes {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
}

.old-value {
    color: #dc2626;
    font-weight: 500;
    background: #fee2e2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.new-value {
    color: #059669;
    font-weight: 500;
    background: #d1fae5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.history-changes .fas {
    color: #6b7280;
}

.error-state {
    text-align: center;
    padding: 3rem;
    color: #dc2626;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fca5a5;
}

.error-state h3 {
    margin-bottom: 0.5rem;
    color: #991b1b;
}
