:root {
    --primary-color: #2c3e50;
    --secondary-color: #7f8c8d;
    --success-color: #27ae60;
    --fail-color: #c0392b;
    --error-color: #f39c12;
    --skip-color: #3498db;
    --info-color: #2980b9;
    --background-color: #f4f7f6;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --border-soft: #dcdde1;
    --log-bg: #1e272e;
    --log-text: #d2dae2;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    padding: 30px;
    line-height: 1.5;
}

h1 {
    font-size: 2.2rem;
    margin-top: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* -- Header & Metadata ----------------------------------------------------------- */
.report-header {
    background: var(--card-background);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border-left: 6px solid var(--primary-color);
}

.metadata-table {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
}

.metadata-table th {
    text-align: left;
    padding: 8px 15px 8px 0;
    color: var(--secondary-color);
    width: 150px;
}

.metadata-table td {
    padding: 8px 0;
    font-weight: 600;
}

.status-summary-badges span {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 10px;
    font-weight: 700;
}

.badge-pass { background: rgba(39, 174, 96, 0.1); color: var(--success-color); }
.badge-fail { background: rgba(192, 57, 43, 0.1); color: var(--fail-color); }
.badge-error { background: rgba(243, 156, 18, 0.1); color: var(--error-color); }
.badge-skip { background: rgba(52, 152, 219, 0.1); color: var(--skip-color); }

/* -- Dashboard Cards ------------------------------------------------------------- */
.dashboard-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.summary-card {
    background: var(--card-background);
    flex: 1;
    min-width: 180px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    text-align: center;
    border-bottom: 4px solid var(--border-soft);
}

.card-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: 1px;
}

.total-tests { border-bottom-color: var(--primary-color); }
.passed-tests { border-bottom-color: var(--success-color); color: var(--success-color); }
.failed-tests { border-bottom-color: var(--fail-color); color: var(--fail-color); }
.error-tests { border-bottom-color: var(--error-color); color: var(--error-color); }
.skipped-tests { border-bottom-color: var(--skip-color); color: var(--skip-color); }

/* -- Filters --------------------------------------------------------------------- */
.filter-section {
    background: var(--card-background);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.filter-button-group { display: flex; gap: 8px; }

.btn-filter {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-color);
    transition: all 0.2s;
}

.btn-filter:hover { background: #f8f9fa; }
.btn-filter.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* -- Report Table ---------------------------------------------------------------- */
.test-report-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.table-header-row { background: var(--primary-color); color: #fff; }
.table-header-row th { padding: 15px; font-weight: 700; text-align: left; font-size: 0.85rem; text-transform: uppercase; }

.test-class-row { font-weight: 700; background: #fdfdfd; }
.test-class-row td { padding: 12px 15px; border-bottom: 1px solid #eee; }

.class-description { font-weight: 700; }
.class-link { color: var(--text-primary); text-decoration: none; display: block; }
.class-link:hover { color: var(--info-color); }

.class-metrics { text-align: center; width: 60px; }
.class-action { text-align: center; width: 100px; }

.btn-detail {
    background: var(--info-color);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* Row states */
.passClass { border-left: 5px solid var(--success-color); }
.failClass { border-left: 5px solid var(--fail-color); }
.errorClass { border-left: 5px solid var(--error-color); }

.test-case-row td { padding: 10px 15px; border-bottom: 1px solid #f5f5f5; }
.hiddenRow { display: none; }

.test-case-name { 
    margin-left: 25px; 
    max-width: 500px; 
    overflow-x: auto; 
    white-space: nowrap;
    scrollbar-width: thin;
}

.test-case-name::-webkit-scrollbar {
    height: 4px;
}

.test-case-name::-webkit-scrollbar-thumb {
    background: var(--border-soft);
    border-radius: 10px;
}

.test-detail-link { 
    color: var(--info-color); 
    text-decoration: none; 
    font-weight: 500; 
}

.test-detail-link:hover { 
    text-decoration: underline; 
}

.test-duration-cell { text-align: center; color: var(--secondary-color); font-size: 0.85rem; width: 120px; }
.test-status-cell { text-align: center; }

.status-btn {
    border: 1px solid transparent;
    padding: 3px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    min-width: 80px;
    cursor: pointer;
    background: transparent;
}

.btn-pass { color: var(--success-color); border-color: var(--success-color); }
.btn-pass:hover { background: var(--success-color); color: #fff; }

.btn-fail { color: var(--fail-color); border-color: var(--fail-color); }
.btn-fail:hover { background: var(--fail-color); color: #fff; }

.btn-error { color: var(--error-color); border-color: var(--error-color); }
.btn-error:hover { background: var(--error-color); color: #fff; }

.btn-skip { color: var(--skip-color); border-color: var(--skip-color); }
.btn-skip:hover { background: var(--skip-color); color: #fff; }

/* -- Log Window ------------------------------------------------------------------ */
.log-window {
    background: var(--log-bg);
    color: var(--log-text);
    margin: 15px 0;
    border-radius: 8px;
    text-align: left;
    overflow: hidden;
}

.log-window-header {
    background: rgba(255,255,255,0.05);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.log-title { font-weight: 700; color: #fff; }
.log-close-btn { color: #ff7675; cursor: pointer; font-weight: 700; text-decoration: none; }

.log-content { padding: 15px; font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; }
.stdout-log { margin-bottom: 10px; white-space: pre-wrap; }
.error-log { color: #ff7675; border-top: 1px dashed rgba(255,255,255,0.1); padding-top: 10px; white-space: pre-wrap; }

/* -- Summary & Footer ------------------------------------------------------------ */
.table-summary-row { background: #f8f9fa; font-weight: 800; color: var(--primary-color); }
.table-summary-row td { padding: 15px; }

.report-footer { margin-top: 50px; padding: 30px; border-top: 1px solid var(--border-soft); text-align: center; color: var(--secondary-color); }
.brand-name { color: var(--info-color); }
.execution-time span { color: var(--primary-color); font-weight: 700; }
