* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; 
    background: #f0f2f5; 
    color: #333; 
    min-height: 100vh; 
}

/* ==================== Navbar ==================== */
.navbar { 
    background: #fff; 
    padding: 0 30px; 
    display: flex; 
    gap: 30px; 
    align-items: center; 
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    height: 56px;
}
.navbar .brand { 
    font-size: 1.25em; 
    font-weight: 700; 
    color: #2563eb; 
    margin-right: 10px;
    letter-spacing: -0.5px;
}
.navbar a { 
    color: #666; 
    text-decoration: none; 
    font-weight: 500; 
    cursor: pointer; 
    font-size: 0.95em; 
    padding: 16px 0; 
    border-bottom: 2px solid transparent; 
    transition: all 0.2s; 
}
.navbar a:hover, .navbar a.active { 
    color: #2563eb; 
    border-bottom-color: #2563eb; 
}

/* ==================== Layout ==================== */
.container { max-width: 1400px; margin: 0 auto; padding: 28px 20px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==================== Card ==================== */
.card { 
    background: #fff; 
    border-radius: 12px; 
    padding: 28px; 
    margin-bottom: 22px; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); 
    border: 1px solid #e8eaed;
}
.card h2 { 
    color: #1a1a2e; 
    margin-bottom: 18px; 
    padding-bottom: 12px; 
    border-bottom: 2px solid #e8eaed;
    font-size: 1.2em; 
    font-weight: 600;
}
.card h3 { color: #444; margin: 15px 0 10px; font-size: 1.05em; }

/* ==================== Form ==================== */
.form-row { display: flex; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.form-group label { 
    font-size: 0.8em; 
    color: #666; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.form-group select, .form-group input { 
    padding: 9px 12px; 
    border-radius: 8px; 
    border: 1px solid #d0d5dd; 
    background: #fff; 
    color: #333; 
    font-size: 0.95em;
    transition: border-color 0.2s;
}
.form-group select:focus, .form-group input:focus { 
    outline: none; 
    border-color: #2563eb; 
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}


/* ==================== Fusion Upload Grid ==================== */
.fusion-uploads-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
    margin: 18px 0; 
    max-width: 900px;
}
.fusion-upload-item { 
    background: #f8fafc; 
    border-radius: 10px; 
    padding: 20px; 
    border: 1px solid #e8eaed; 
    transition: border-color 0.2s;
}
.fusion-upload-item:hover { border-color: #2563eb; }
.fusion-upload-item label { 
    font-size: 0.85em; 
    color: #444; 
    font-weight: 600; 
    display: block; 
    margin-bottom: 10px; 
}
.fusion-upload-item .mini-upload { 
    border: 2px dashed #d0d5dd; 
    border-radius: 8px; 
    padding: 30px 15px; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.2s; 
    background: #fff;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fusion-upload-item .mini-upload:hover { 
    border-color: #2563eb; 
    background: #eff6ff; 
}
.fusion-upload-item .mini-upload p { color: #999; font-size: 0.85em; margin: 0; }

@media (max-width: 768px) {
    .fusion-uploads-grid { grid-template-columns: 1fr; max-width: 100%; }
}




/* ==================== Upload Zone ==================== */
.upload-zone { 
    border: 2px dashed #d0d5dd; 
    border-radius: 10px; 
    padding: 35px 20px; 
    text-align: center; 
    cursor: pointer; 
    margin: 15px 0; 
    transition: all 0.25s; 
    background: #fafbfc;
}
.upload-zone:hover { 
    border-color: #2563eb; 
    background: #eff6ff; 
}
.upload-zone p { color: #888; font-size: 0.95em; }

/* ==================== Buttons ==================== */
.btn { 
    padding: 10px 28px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 0.95em; 
    transition: all 0.2s; 
}
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.2); }
.btn-primary:disabled { background: #a5b4fc; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: #e8eaed; color: #444; margin-left: 10px; }
.btn-secondary:hover { background: #d0d5dd; }

/* ==================== Results ==================== */
.result-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 15px; 
    margin: 20px 0; 
}
.result-item { 
    background: #f8fafc; 
    padding: 20px 15px; 
    border-radius: 10px; 
    text-align: center; 
    border: 1px solid #e8eaed;
}
.result-item .val { font-size: 2em; font-weight: 700; }
.result-item .lbl { 
    font-size: 0.78em; 
    color: #888; 
    margin-top: 6px; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.result-oa { color: #dc2626; } 
.result-no { color: #16a34a; }

/* ==================== Spinner ==================== */
.spinner { display: none; text-align: center; padding: 20px; }
.spinner.active { display: block; }
.spinner::after { 
    content: ''; 
    display: inline-block; 
    width: 30px; 
    height: 30px; 
    border: 3px solid #e8eaed; 
    border-top-color: #2563eb; 
    border-radius: 50%; 
    animation: spin 0.8s linear infinite; 
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== Utilities ==================== */
.hidden { display: none; }
.error { color: #dc2626; padding: 10px 0; font-size: 0.9em; }
.success { color: #16a34a; padding: 10px 0; font-size: 0.9em; }
.preview-img { 
    max-width: 200px; 
    border-radius: 8px; 
    margin: 8px 0; 
    border: 1px solid #e8eaed; 
    display: none; 
}
.text-muted { color: #888; font-size: 0.9em; }

/* ==================== Tables ==================== */
.table-wrap { 
    max-height: 520px; 
    overflow-y: auto; 
    border-radius: 8px; 
    border: 1px solid #e8eaed;
    background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 0.82em; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
th { 
    background: #f8fafc; 
    color: #444; 
    font-weight: 600; 
    position: sticky; 
    top: 0; 
    z-index: 1; 
    font-size: 0.8em; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    border-bottom: 2px solid #e8eaed;
}
tr:hover td { background: #f8fafc; }

/* ==================== Summary ==================== */
.summary-bar { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.summary-item { 
    background: #f8fafc; 
    padding: 16px 22px; 
    border-radius: 10px; 
    text-align: center; 
    min-width: 140px; 
    border: 1px solid #e8eaed;
}
.summary-item .n { font-size: 1.6em; font-weight: 700; color: #2563eb; }
.summary-item .t { font-size: 0.75em; color: #888; margin-top: 4px; text-transform: uppercase; }

/* ==================== About ==================== */
.about-text { line-height: 1.8; color: #555; }
.about-list { line-height: 2; color: #555; padding-left: 20px; }
.about-list li { margin-bottom: 4px; }

/* ==================== SHAP Explorer ==================== */
.shap-chart-container {
    width: 100%;
    height: 500px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    overflow: hidden;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .navbar { padding: 0 15px; gap: 15px; }
    .container { padding: 15px; }
    .card { padding: 18px; }
    .result-grid { grid-template-columns: repeat(2, 1fr); }
    .fusion-uploads-grid { grid-template-columns: 1fr; }
}

/* Remove button */
.btn-remove {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-remove:hover {
    background: #fecaca;
}