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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #f0f4f8 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #1e293b;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 48px;
    padding: 0;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

h1 {
    color: #1e293b;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: #64748b;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.5;
}

/* Cards */
.card {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.25px;
    margin-bottom: 20px;
    color: #1e293b;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 36px;
    text-align: center;
    transition: all 0.15s ease;
    cursor: pointer;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.upload-area:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.upload-area.dragging {
    border-color: #667eea;
    background: #f5f3ff;
}

.upload-icon {
    font-size: 36px;
    color: #3b82f6;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.2));
}

.upload-area p {
    color: #4b5563;
    font-size: 14px;
    margin: 4px 0;
}

/* Form Elements */
.form-group {
    margin: 20px 0;
}

label {
    display: block;
    /* margin-bottom: 8px; */
    font-weight: 500;
    color: #4b5563;
    font-size: 13px;
}

input[type="text"], select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    background: white;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Style for select dropdown */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

select option[value="__new__"] {
    font-weight: 600;
    color: #3b82f6;
}

input[type="file"] {
    display: none;
}

/* Search input styling */
#dataSearch {
    transition: all 0.2s;
}

#dataSearch:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#dataSearch::placeholder {
    color: #6b7280;
}

/* Buttons */
button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

button:disabled {
    background: #e2e8f0;
    color: #64748b;
    border: none;
    cursor: not-allowed;
    box-shadow: none;
}

/* File Info */
.file-info {
    display: none;
    margin: 15px 0;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #4b5563;
}

/* Messages */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 400;
    font-size: 14px;
    display: none;
    animation: slideIn 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 9999;
    border: 1px solid;
}

.message.success {
    background: #f0fdf4;
    color: #166534;
    border-color: #86efac;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.message.info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.message.fade-out {
    animation: fadeOut 0.5s ease;
}

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

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

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

/* Collections */
.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.collection-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.collection-item span {
    color: #1a1a1a;
    font-size: 14px;
}

.collection-item button {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
    background: white;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    box-shadow: none;
}

.collection-item button:hover {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Delete button styling */
.btn-delete {
    background: #ef4444 !important;
    color: white !important;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.2);
    cursor: pointer;
    border-radius: 6px;
}

.btn-delete:hover {
    background: #dc2626 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Override for collection actions delete button */
.collection-actions .btn-delete {
    background: #ef4444 !important;
    color: white !important;
}

.collection-actions .btn-delete:hover {
    background: #dc2626 !important;
}

.btn-delete-icon {
    font-size: 16px;
    font-weight: bold;
}


/* Stats */
.stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
}

.stat-label {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

/* Data Viewer */
.data-viewer {
    display: none;
    margin-top: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.data-viewer h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a1a;
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-toggle button {
    padding: 6px 12px;
    font-size: 12px;
    width: auto;
    border: 1px solid #cbd5e1;
    color: #64748b;
    background: white;
    box-shadow: none;
}

.view-toggle button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.view-toggle button:hover:not(.active) {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* Data Info */
.data-info {
    display: flex;
    gap: 24px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.data-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-info-label {
    font-size: 13px;
    color: #475569;
}

.data-info-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

/* Data Table */
.data-table-container {
    overflow-x: auto;
    margin: 16px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
    font-weight: 500;
    color: #4b5563;
    font-size: 13px;
    box-shadow: inset 0 -1px 0 #e5e7eb;
}

.data-table td {
    border: 1px solid #e5e7eb;
    padding: 10px;
    color: #1a1a1a;
    font-size: 13px;
}

.data-table tr:hover {
    background: #fafafa;
}

.null-value {
    color: #6b7280;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* JSON View */
.data-json {
    display: none;
}

.data-json pre {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    font-size: 13px;
    color: #1a1a1a;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

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

/* Progress Bar */
.progress-container {
    display: none;
    margin: 20px 0;
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #667eea;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
    animation: pulse 2s ease-in-out infinite;
}

.validation-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
    width: 100%;
    overflow: hidden;
}

.page-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #64748b;
    font-size: 14px;
    flex: 1;
    justify-content: center;
}

.page-info-separator {
    color: #94a3b8;
}

.page-selector-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-selector-label {
    font-size: 13px;
}

.page-selector {
    padding: 4px 24px 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background: white url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%236b7280%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3e%3cpolyline points=%276 9 12 15 18 9%27%3e%3c/polyline%3e%3c/svg%3e') no-repeat right 4px center;
    background-size: 16px;
}

.page-btn {
    background: transparent;
    color: #475569;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s;
}

.page-arrow {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background: white;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

.page-arrow:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}

.page-arrow:disabled {
    background: transparent;
    border-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    max-width: 280px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px;
    scroll-behavior: smooth;
}

.page-numbers::-webkit-scrollbar {
    height: 0;
    display: none;
}

.page-num {
    min-width: 36px;
    width: auto;
    height: 36px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #cbd5e1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0 10px;
    flex-shrink: 0;
}

.page-num:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}

.page-num.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.page-num:disabled {
    cursor: default;
}

.page-ellipsis {
    color: #64748b;
    font-size: 14px;
    padding: 0 4px;
    user-select: none;
}

/* Confirmation Modal */
.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

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

.modal {
    background: white;
    border-radius: 12px;
    padding: 28px;
    max-width: 540px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.1);
    border: 1px solid #cbd5e1;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-overlay.show .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-overlay.closing .modal {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideDown {
    from { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

.modal h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal h3::before {
    content: '📤';
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.modal-content {
    margin-bottom: 20px;
}

.confirmation-details {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    gap: 16px;
}

.detail-row:last-child {
    border-bottom: none;
}

label.detail-label,
.detail-label {
    font-weight: 500;
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-block;
}

.detail-value {
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
}

.warning-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: start;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.15);
}

.warning-icon {
    color: #f59e0b;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.warning-text {
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

.btn-cancel, .btn-confirm {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.btn-cancel {
    background: white;
    color: #ef4444;
    border: 2px solid #ef4444;
}

.btn-cancel:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25);
}

.btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.25);
}

.btn-confirm:disabled {
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Compact modal dropdowns */
.modal-select {
    width: auto;
    min-width: 150px;
    max-width: 250px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-select:hover {
    border-color: #64748b;
}

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

/* Segmented Button Group */
.segmented-buttons {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.segment-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.segment-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: #475569;
}

.segment-btn.active {
    background: white;
    color: #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: default;
}

/* Hover state for active button - subtle feedback */
.segment-btn.active:hover {
    background: #f8faff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.segment-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Loading Modal */
.loading-content {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-subtext {
    font-size: 14px;
    color: #475569;
    margin-top: 12px;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Responsive Design for Mobile */
@media screen and (max-width: 768px) {
    /* User badge mobile style */
    #userInfo {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }
    
    /* General layout adjustments */
    body {
        padding: 20px 10px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .hero-description {
        font-size: 14px;
        padding: 0 10px;
    }
    
    /* Upload card adjustments */
    .upload-card {
        padding: 20px;
    }
    
    /* Table container - enable better horizontal scrolling */
    .data-table-container {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        margin: 16px -10px; /* Extend to edge of screen */
        padding: 0 10px;
    }
    
    /* Add scroll shadow indicators */
    .data-table-container::before,
    .data-table-container::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        z-index: 1;
    }
    
    .data-table-container::before {
        left: 0;
        background: linear-gradient(to right, #f0f4f8, transparent);
    }
    
    .data-table-container::after {
        right: 0;
        background: linear-gradient(to left, #f0f4f8, transparent);
    }
    
    /* Table adjustments */
    .data-table {
        min-width: 500px; /* Ensure table has minimum width */
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
        font-size: 12px;
    }
    
    /* Collection column - allow wrapping */
    .data-table th:first-child,
    .data-table td:first-child {
        min-width: 120px;
        max-width: 180px;
        word-wrap: break-word;
        white-space: normal;
        line-height: 1.3;
    }
    
    /* Total Records column */
    .data-table th:last-child,
    .data-table td:last-child {
        min-width: 80px;
        text-align: right;
        white-space: nowrap;
    }
    
    /* Collections list adjustments */
    .collection-item {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .collection-name {
        word-break: break-word;
        max-width: 60%;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
        padding: 20px;
    }
    
    /* Result sections */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Pagination */
    .pagination-controls {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .page-input {
        width: 50px;
    }
    
    /* Data info section - responsive layout */
    .data-info {
        flex-wrap: wrap;
        gap: 12px;
        padding: 10px 0;
    }
    
    .data-info-item {
        flex: 1 1 auto;
        min-width: 120px;
        font-size: 12px;
    }
    
    .data-info-label {
        font-size: 11px;
    }
    
    .data-info-value {
        font-size: 12px;
        word-break: break-word;
    }
    
    /* Form inputs - prevent zoom on iOS */
    input[type="text"],
    input[type="file"],
    select {
        font-size: 16px;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    /* Extra small screens */
    body {
        padding: 15px 8px;
    }
    
    h1 {
        font-size: 1.5rem;
        letter-spacing: -0.3px;
    }
    
    .hero-badge {
        font-size: 10px;
        padding: 4px 12px;
    }
    
    /* Data info - stack on very small screens */
    .data-info {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        padding: 8px 0;
    }
    
    .data-info-item {
        width: 100%;
        justify-content: space-between;
        padding: 4px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .data-info-item:last-child {
        border-bottom: none;
    }
    
    .data-info-label {
        font-size: 11px;
        color: #475569;
    }
    
    .data-info-value {
        font-size: 11px;
        font-weight: 600;
        text-align: right;
        max-width: 60%;
        word-break: break-all;
    }
    
    /* Even more compact table */
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px;
    }
    
    /* Stack buttons in modals */
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-buttons button {
        width: 100%;
    }
    
    /* Compact upload section */
    .upload-card {
        padding: 16px;
    }
    
    .upload-section h2 {
        font-size: 1.125rem;
    }
    
    /* Collection items even more compact */
    .collection-item {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Additional responsive improvements for modals */
@media (max-width: 640px) {
    /* Modal adjustments */
    .modal {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
    }
    
    /* Stack detail rows on mobile */
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 0;
    }
    
    .detail-label {
        min-width: auto;
        font-weight: 600;
        color: #475569;
    }
    
    .detail-value {
        text-align: left;
        width: 100%;
    }
    
    /* Responsive segmented buttons container */
    .detail-row > div[style*="flex"] {
        width: 100%;
        flex-direction: row !important;
        justify-content: space-between;
    }
    
    /* Segmented buttons stay horizontal but adapt */
    .segmented-buttons {
        flex: 0 0 auto;
    }
    
    /* Full width inputs ONLY on mobile */
    input[type="date"].modal-select,
    select.modal-select {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }
}

/* Collection list styles */
.collection-actions {
    display: flex;
    gap: 8px;
}

.btn-connect-r {
    position: relative;
}

.btn-connect-r svg {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    vertical-align: middle;
}

.no-collections-message {
    color: #999;
}

/* Additional filter styles */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: linear-gradient(to right, #f0f9ff, #f8fafc);
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
}

.filter-badge {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.filter-field-group {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-operator-group {
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.filter-operator {
    background: #e0e7ff;
    color: #4338ca;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.filter-value-group {
    flex: 1.5;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
}

.filter-select {
    width: 100%;
    padding: 8px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.filter-input {
    width: 100%;
    padding: 8px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    cursor: text;
}

.filter-remove-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: white;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    align-self: flex-end;
    margin-bottom: 2px;
}

.filter-remove-btn:hover {
    background: #fee2e2;
    transform: scale(1.05);
}
