body {
    font-family: sans-serif;
}

#pivot-table,
#comparison-pivot-table {
    margin-top: 20px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
}

th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Make entire thead sticky */
thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

thead tr:first-child th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    z-index: 21;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-group.droppable {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: none;
}

.input-group.droppable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.input-group:hover {
    border-color: #999;
}

.tab-panes .tab-pane {
    display: none;
}

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

.tabs a.tab {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-bottom: none;
    padding: 10px;
    text-decoration: none;
    color: #333;
    display: inline-block;
    cursor: pointer;
}

.tabs a.tab.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    font-weight: bold;
}

/* Sub-tabs styling */
.sub-tabs {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.sub-tabs a.sub-tab {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    padding: 8px 16px;
    text-decoration: none;
    color: #666;
    display: inline-block;
    font-size: 0.9em;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
}

.sub-tabs a.sub-tab:hover {
    background: #f0f0f0;
}

.sub-tabs a.sub-tab.active {
    background: #fff;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

.sub-tab-panes .sub-tab-pane {
    display: none;
}

.sub-tab-panes .sub-tab-pane.active {
    display: block;
}

/* Quick date buttons styling */
.date-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.date-btn {
    padding: 4px 10px;
    font-size: 0.75em;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.date-btn:hover,
.date-btn.active:not(:last-child) {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.date-btn:active {
    transform: scale(0.95);
}

/* Grand total row styling */
tr.grand-total {
    background-color: #f8f9fa !important;
    font-weight: bold;
    border-top: 2px solid #4a90e2;
    border-bottom: 2px solid #4a90e2;
}

tr.grand-total th {
    background-color: #f8f9fa !important;
    font-weight: bold;
    padding: 10px 8px;
    position: sticky;
    top: 42px;
    /* Stick below the header row */
    z-index: 21;
    border-bottom: 2px solid #4a90e2;
}

tr.grand-total th:first-child {
    color: #4a90e2;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced drop zone styling */
.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 8px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.drop-zone:hover::before {
    left: 100%;
}

.drop-zone:hover {
    border-color: #4a90e2;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    transform: scale(1.02);
}

.drop-zone.drag-over {
    border-color: #4a90e2;
    background: linear-gradient(135deg, #eef2ff 0%, #ddd6fe 100%);
    border-style: solid;
    transform: scale(1.02);
}

.upload-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: translateY(-4px) scale(1.1);
}

.upload-icon svg {
    width: 22px;
    height: 22px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.drop-zone label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    cursor: pointer;
}

.helper-text {
    font-size: 14px;
    color: #64748b;
    margin-top: 8px;
}

.drop-zone input[type="file"] {
    display: none;
}

.file-list {
    max-height: 110px;
    overflow-y: scroll;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.file-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.remove-btn {
    width: 28px;
    height: 28px;
    background: #ef4444;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.remove-btn svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 999999999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.4); 
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%; 
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.service-tabs {
    display: flex;
    margin-bottom: 1rem;
}

.service-tab {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
}

.service-tab.active {
    background-color: #ccc;
}

.service-pane {
    display: none;
}

.service-pane.active {
    display: block;
}

.checkbox-container {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
}

.select-all-container {
    margin-bottom: 10px;
}

.data-type-nav {
    margin-bottom: 1rem;
}

.data-type-btn {
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    color: #333;
}

.data-type-btn.active {
    background-color: #333;
    color: #fff;
}
.highlight-green { background-color: #e6ffed !important; }
.highlight-orange { background-color: #fff0e6 !important; }

.modal-search {
    margin-bottom: 1rem;
}

.modal-search input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.select-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.select-actions button {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.select-actions button:hover {
    background: #f0f0f0;
}

.checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
}

.checkbox-list label {
    display: block;
    padding: 0.25rem 0;
}

.checkbox-list label input {
    margin-right: 0.5rem;
}

#services-options {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f9f9f9;
}

#services-options button {
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid #333;
    background: #333;
    color: white;
    cursor: pointer;
    border-radius: 4px;
}

#services-options button:hover {
    background: #555;
}

#services-options label {
    margin-right: 1rem;
}

/* Fuzzy matching controls */
.fuzzy-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.fuzzy-controls label {
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fuzzy-controls input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.threshold-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #999;
    margin-top: -5px;
}

.matched-models-list {
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.85em;
    color: #555;
    line-height: 1.6;
}

.matched-models-list:empty {
    display: none;
}

.matched-models-list strong {
    color: #333;
}

.ready-for-fusejs {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}
