* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #F1F1F1;
    color: #1a1a1a;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: #cc1516;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(204, 21, 22, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #1a1a1a;
    border: 1px solid #E4E4E4;
}

/* Common Step Classes */
.step {
    animation: fadeIn 0.5s ease;
}

.step.hidden {
    display: none;
}

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

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



/* Step 1: Upload Layout */
.upload-area {
    background: #fff;
    border: 2px dashed #E4E4E4;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.upload-area:hover {
    border-color: #cc1516;
    background: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.upload-icon {
    color: #cc1516;
    margin-bottom: 1.5rem;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #666;
    margin-bottom: 2rem;
}

.btn-primary {
    background: #cc1516;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(204, 21, 22, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(204, 21, 22, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #E4E4E4;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 5px;
}

.btn-secondary:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
}

/* Step 2: Scanning */
.scan-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.scan-container h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.scan-container>p {
    color: #666;
    margin-bottom: 3rem;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #E4E4E4;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #cc1516;
    border-radius: 10px;
    transition: width 0.1s linear;
}

.scan-stats {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 3rem;
    font-family: monospace;
}

.terminal-window {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E4E4E4;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.terminal-header {
    background: #fafafa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E4E4E4;
    display: flex;
    align-items: center;
}

.dots {
    display: flex;
    gap: 6px;
    margin-right: 15px;
}

.dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dots span:nth-child(1) {
    background: #ff5f56;
}

.dots span:nth-child(2) {
    background: #ffbd2e;
}

.dots span:nth-child(3) {
    background: #27c93f;
}

.terminal-title {
    color: #888;
    font-family: monospace;
    font-size: 0.85rem;
}

.terminal-body {
    padding: 1.5rem;
    height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #1a1a1a;
    /* Keep terminal dark inside for contrast */
}

.log-line {
    margin-bottom: 4px;
    color: #E4E4E4;
}

.log-success {
    color: #27c93f;
}

.log-error {
    color: #ff5f56;
}

.log-info {
    color: #a9b7c6;
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}


/* Step 3: Results (Redesigned matching the screenshot) */

/* Tabs */
.tabs-container {
    display: inline-flex;
    background: #fff;
    border: 1px solid #E4E4E4;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 2rem;
}

.tab {
    background: transparent;
    border: none;
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tab.active {
    background: #1a1a1a;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab:hover:not(.active) {
    background: #fafafa;
    color: #1a1a1a;
}

/* Stats Pills */
.stats-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-pill {
    background: #fff;
    border: 1px solid #E4E4E4;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    min-width: 140px;
    flex: 1;
}

.stat-pill svg {
    color: #888;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    flex-grow: 1;
}

.stat-value {
    font-size: 1.1rem;
    color: #1a1a1a;
    font-weight: 700;
}

/* Control Bar */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #E4E4E4;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    flex-wrap: wrap;
    gap: 1rem;
}

.last-run {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.last-run svg {
    color: #a0a0a0;
}

.last-run strong {
    color: #1a1a1a;
    font-weight: 600;
}

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

.search-input {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input svg {
    position: absolute;
    left: 10px;
    color: #a0a0a0;
}

.search-input input {
    border: 1px solid #E4E4E4;
    border-radius: 8px;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    font-size: 0.9rem;
    font-family: inherit;
    width: 250px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input input:focus {
    border-color: #cc1516;
}

.select-dropdown select {
    border: 1px solid #E4E4E4;
    border-radius: 8px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg stroke='currentColor' fill='none' stroke-width='2' viewBox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 0.75rem center/12px;
    outline: none;
    cursor: pointer;
}

.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label {
    font-size: 0.9rem;
    color: #666;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E4E4E4;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: #cc1516;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Results Card & Table */
.results-card {
    background: #fff;
    border: 1px solid #E4E4E4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.results-card-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
}

.card-title-group h2 {
    font-size: 1.25rem;
}

.card-subtitle {
    color: #888;
    font-size: 0.9rem;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    font-weight: 500;
    color: #888;
    border-top: 1px solid #E4E4E4;
    border-bottom: 1px solid #E4E4E4;
    font-size: 0.85rem;
}

.data-table .text-right {
    text-align: right;
}

.data-table tbody tr {
    border-bottom: 1px solid #E4E4E4;
    transition: background-color 0.2s;
    cursor: pointer;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

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

/* Discrepancy Highlighting */
.data-table tbody tr.row-danger {
    background-color: #fbeded;
    /* Very light red based on #cc1516 */
}

.data-table tbody tr.row-danger:hover {
    background-color: #f7e1e1;
}

/* Table Text Colors */
.data-table td.strong {
    font-weight: 600;
    color: #1a1a1a;
}

.data-table td .sub-text {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

.data-table td.reference {
    color: #888;
    font-size: 0.85rem;
}

/* Inner Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #fff;
}

.badge-matched {
    border: 1px solid #E4E4E4;
    color: #1a1a1a;
}

.badge-review {
    border: 1px solid #E4E4E4;
    color: #1a1a1a;
}

.badge-error {
    border: 1px solid #E4E4E4;
    /* Changed to #E4E4E4 as seen in screenshot */
    color: #1a1a1a;
}

.status-badge.badge-error {
    background: transparent;
}

.status-icon-check {
    color: #888;
}

.status-icon-warn {
    color: #555;
}

.status-icon-err {
    color: #cc1516;
}

/* --- Navigation Tabs --- */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: -1rem;
    /* Visual overlap with the box below */
    position: relative;
    z-index: 10;
}

.mode-tab {
    background: #f1f1f1;
    border: 1px solid #E4E4E4;
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
}

.mode-tab:hover {
    color: #1a1a1a;
    background: #F9F9F9;
}

.mode-tab.active {
    background: #ffffff;
    color: #cc1516;
    font-weight: 600;
    border-bottom: 2px solid #ffffff;
    /* overlap the border beneath */
    transform: translateY(1px);
    /* Pull down over the edge */
}