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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    padding: 24px;
    color: #1e293b;
}

.container {
    max-width: 95%;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
    @media (max-width: 1700px) {
        max-width: 98vw;
    }
    @media (max-width: 1200px) {
        max-width: 100vw;
        padding-left: 12px;
        padding-right: 12px;
    }
    @media (max-width: 600px) {
        padding-left: 4px;
        padding-right: 4px;
    }
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 32px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
}

header i {
    margin-right: 12px;
    font-size: 1.1em;
    color: #64748b;
}

.upload-section {
    padding: 32px;
}

.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fefefe;
}

.upload-area:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.upload-area.dragover {
    background: #f1f5f9;
    border-color: #64748b;
}

.upload-icon {
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 16px;
    display: block;
}

.upload-area p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.table-section {
    padding: 32px;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

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

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

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

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

.table-section h2 {
    color: #0f172a;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1.5rem;
}

table {
    width: 100%;
    min-width: 800px; /* Minimum width for proper layout */
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: none; /* Remove border as wrapper has border */
}

thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

th, td {
    padding: 16px;
    text-align: left;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap; /* Prevent text wrapping */
}

/* Column widths */
th:nth-child(1), td:nth-child(1) { /* Date */
    width: 120px;
    min-width: 120px;
}

th:nth-child(2), td:nth-child(2) { /* Ticket No */
    width: 100px;
    min-width: 100px;
}

th:nth-child(3), td:nth-child(3) { /* Filename */
    width: 300px;
    min-width: 300px;
    white-space: normal; /* Allow filename to wrap if needed */
    word-break: break-word;
}

th:nth-child(4), td:nth-child(4) { /* Description */
    width: 380px;
    min-width: 380px;
}

th:nth-child(5), td:nth-child(5) { /* Actions */
    width: 200px;
    min-width: 200px;
    text-align: center;
}

th:last-child, td:last-child {
    border-right: none;
}

th {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:hover {
    background-color: #f3f4f6;
}

th.sortable::after {
    content: '↕️';
    position: absolute;
    right: 8px;
    font-size: 0.75rem;
    opacity: 0.5;
}

th.sort-asc::after {
    content: '↑';
    opacity: 1;
}

th.sort-desc::after {
    content: '↓';
    opacity: 1;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr.row-merged {
    background-color: #dcfce7;
}

tbody tr.row-merged:hover {
    background-color: #bbf7d0;
}

.action-btn {
    background: white;
    border: 1px solid #d1d5db;
    cursor: pointer;
    padding: 8px;
    margin: 0 4px;
    border-radius: 6px;
    transition: all 0.15s ease;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-download {
    color: #1e293b;
    border-color: #cbd5e1;
}

.btn-download:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-view {
    color: #0891b2;
    border-color: #cffafe;
}

.btn-view:hover {
    background: #ecfeff;
    color: #0e7490;
    border-color: #7dd3fc;
}

.btn-delete {
    color: #dc2626;
    border-color: #fecaca;
}

.btn-delete:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.btn-merge {
    color: #b45309;
    border-color: #fed7aa;
}

.btn-merge:hover {
    background: #fffbeb;
    color: #c2410c;
    border-color: #fdba74;
}

.btn-merge.btn-merge-active {
    color: #15803d;
    border-color: #bbf7d0;
}

.btn-merge.btn-merge-active:hover {
    background: #dcfce7;
    color: #166534;
}

.filter-section {
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.filter-input {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.15s ease;
}

.filter-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input::placeholder {
    color: #9ca3af;
}

.merge-filter-select {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

.merge-filter-select:focus {
    outline: none;
    border-color: #6366f1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    min-height: 600px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.2s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
    font-size: 1.25rem;
}

.close {
    color: #64748b;
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1;
}

.close:hover {
    color: #374151;
}

.modal-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.file-tree {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.file-item {
    padding: 3px 0;
    color: #374151;
    display: flex;
    align-items: center;
}

.file-item.folder {
    color: #1e293b;
    font-weight: 500;
}

.file-item.file {
    color: #64748b;
}

.file-item.clickable {
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 5px 10px;
    border-radius: 4px;
    margin: 2px 0;
}

.file-item.clickable:hover {
    background-color: #f0f8ff;
    color: #2c5aa0;
}

.file-item::before {
    margin-right: 8px;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    color: #cbd5e1;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
}

.success-message {
    background: #f0fdf4;
    color: #166534;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #bbf7d0;
    font-weight: 500;
}

.error-message {
    background: #fef2f2;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #fecaca;
    font-weight: 500;
}

.info-message {
    background: #eff6ff;
    color: #1e40af;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #bfdbfe;
    font-weight: 500;
}

/* File Content Viewer Styles */
.file-content-viewer {
    height: calc(95vh - 200px);
    min-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: none;
    border-radius: 0;
    background: #1e1e1e;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
    margin: 0;
}

.file-content-viewer::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.file-content-viewer::-webkit-scrollbar-track {
    background: #2d3748;
    border-radius: 6px;
}

.file-content-viewer::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 6px;
    border: 2px solid #2d3748;
}

.file-content-viewer::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.file-content-viewer pre {
    margin: 0;
    padding: 20px;
    white-space: pre;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
}

.file-content-viewer code {
    background: transparent !important;
    padding: 0 !important;
    font-family: inherit;
}

/* Custom syntax highlighting improvements */
.file-content-viewer .hljs {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
}

.file-content-viewer .hljs-keyword,
.file-content-viewer .hljs-selector-tag,
.file-content-viewer .hljs-literal,
.file-content-viewer .hljs-section,
.file-content-viewer .hljs-link {
    color: #569cd6 !important;
}

.file-content-viewer .hljs-string,
.file-content-viewer .hljs-subst {
    color: #ce9178 !important;
}

.file-content-viewer .hljs-number,
.file-content-viewer .hljs-regexp,
.file-content-viewer .hljs-addition {
    color: #b5cea8 !important;
}

.file-content-viewer .hljs-built_in,
.file-content-viewer .hljs-builtin-name,
.file-content-viewer .hljs-variable,
.file-content-viewer .hljs-template-variable,
.file-content-viewer .hljs-class .hljs-title,
.file-content-viewer .hljs-type {
    color: #4ec9b0 !important;
}

.file-content-viewer .hljs-comment,
.file-content-viewer .hljs-quote,
.file-content-viewer .hljs-deletion,
.file-content-viewer .hljs-meta {
    color: #6a9955 !important;
}

.file-content-viewer .hljs-function .hljs-title,
.file-content-viewer .hljs-name,
.file-content-viewer .hljs-symbol,
.file-content-viewer .hljs-bullet,
.file-content-viewer .hljs-attribute {
    color: #dcdcaa !important;
}

.file-content-viewer .hljs-tag,
.file-content-viewer .hljs-name {
    color: #569cd6 !important;
}

.file-content-viewer .hljs-attr {
    color: #92c5f8 !important;
}

/* Modal Title Improvements */
.modal-title-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.file-path {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #64748b;
    flex: 1;
    margin-right: 15px;
    word-break: break-all;
}

.back-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
    font-size: 14px;
}

.back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.back-btn i {
    margin-right: 5px;
}

/* Binary File Message */
.binary-file-message {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.binary-file-message i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    color: #cbd5e1;
}

.binary-file-message p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* File Tree Styles */
#fileTree {
    padding: 20px;
    min-height: 400px;
}

.modal-body::-webkit-scrollbar {
    width: 12px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
}

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

/* Duplicate Package Modal Styles */
.duplicate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.duplicate-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.duplicate-modal-header {
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
}

.duplicate-modal-header h3 {
    margin: 0;
    color: #991b1b;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.duplicate-modal-header i {
    color: #dc2626;
}

.duplicate-modal-body {
    padding: 24px;
}

.error-text {
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 1rem;
}

.existing-package-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.existing-package-info h4 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
}

.existing-package-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.existing-package-info li {
    padding: 4px 0;
    color: #475569;
    font-size: 0.9rem;
}

.existing-package-info strong {
    color: #1e293b;
}

.info-text {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px;
    color: #1e40af;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
}

.info-text i {
    color: #3b82f6;
    margin-top: 2px;
}

.duplicate-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.btn-close-duplicate {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-close-duplicate:hover {
    background: #b91c1c;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Description Cell Styles */
.description-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
}

.description-text {
    display: inline-block;
    max-width: 85%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.btn-edit-desc {
    color: #7c3aed;
    border-color: #e9d5ff;
}

.btn-edit-desc:hover {
    background: #faf5ff;
    color: #6d28d9;
    border-color: #d8b4fe;
}

/* Description Modal Styles */
.description-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.description-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.description-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.description-modal-header .close {
    color: white;
    opacity: 0.9;
}

.description-modal-header .close:hover {
    opacity: 1;
}

.description-modal-body {
    padding: 24px;
}

.package-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.package-info p {
    margin: 4px 0;
    color: #475569;
    font-size: 0.9rem;
}

.package-info strong {
    color: #1e293b;
}

.textarea-wrapper {
    margin-top: 16px;
}

.textarea-wrapper label {
    display: block;
    margin-bottom: 8px;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
}

.description-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.description-textarea:disabled {
    background-color: #f8fafc;
    color: #475569;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.description-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.description-textarea::placeholder {
    color: #94a3b8;
}

.char-count {
    margin-top: 8px;
    text-align: right;
    color: #64748b;
    font-size: 0.85rem;
}

.char-count span {
    font-weight: 600;
    color: #475569;
}

.description-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

.btn-edit-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-edit-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-save-modal {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-save-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-save-modal:active,
.btn-edit-modal:active {
    transform: translateY(0);
}

.btn-cancel-edit {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-cancel-edit:hover {
    background: #d97706;
}

.btn-close-modal {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-close-modal:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

/* AI Chat Styles */
.chat-float-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 9999;
}

.chat-float-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-float-button i {
    color: white;
    font-size: 28px;
}

.chat-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    animation: slideInUp 0.3s ease;
}

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

.chat-window.minimized {
    height: 60px;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
}

.chat-header-content i {
    font-size: 20px;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

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

.chat-message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-message .message-avatar {
    background: #e2e8f0;
    color: #475569;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.ai-message .message-content {
    background: white;
    border: 1px solid #e2e8f0;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-content p {
    margin: 0;
    font-size: 0.95rem;
}

.message-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.suggestion-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

.chat-input-wrapper {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .table-section {
        padding: 16px;
    }
    
    .table-section h2 {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }
    
    /* Adjust table for mobile */
    table {
        min-width: 600px; /* Smaller minimum width for mobile */
    }
    
    th, td {
        padding: 12px 8px;
        font-size: 0.875rem;
    }
    
    /* Adjust column widths for mobile */
    th:nth-child(1), td:nth-child(1) { /* Date */
        width: 100px;
        min-width: 100px;
    }

    th:nth-child(2), td:nth-child(2) { /* Ticket No */
        width: 90px;
        min-width: 90px;
    }

    th:nth-child(3), td:nth-child(3) { /* Filename */
        width: 200px;
        min-width: 200px;
    }

    th:nth-child(4), td:nth-child(4) { /* Description */
        width: 220px;
        min-width: 220px;
    }

    th:nth-child(5), td:nth-child(5) { /* Actions */
        width: 150px;
        min-width: 150px;
    }
    
    .action-btn {
        padding: 6px 8px;
        margin: 0 2px;
    }
    
    .filter-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Upload section adjustments */
    .upload-area {
        padding: 24px 16px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    table {
        min-width: 500px;
    }
    
    th, td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    th:nth-child(3), td:nth-child(3) { /* Filename */
        width: 180px;
        min-width: 180px;
    }

    th:nth-child(4), td:nth-child(4) { /* Description */
        width: 180px;
        min-width: 180px;
    }

    th:nth-child(5), td:nth-child(5) { /* Actions */
        width: 120px;
        min-width: 120px;
    }
    
    .action-btn {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
}