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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
}

.app-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 2rem;
    flex-wrap: wrap;
}

.app-header-brand {
    min-width: 0;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header p {
    font-size: 0.875rem;
    opacity: 0.8;
}

.header-domain {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.7;
}

.header-log-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-actions button {
    border: none;
    border-radius: 6px;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

main {
    width: 100%;
    max-width: none;
    margin: 1rem 0 2rem;
    padding: 0 1rem;
}

/* Upload section */
.source-switch {
    display: inline-flex;
    gap: 0.25rem;
    background: #e9ecef;
    border-radius: 8px;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

.source-switch-btn {
    border: none;
    background: transparent;
    color: #495057;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.source-switch-btn:hover {
    background: #dee2e6;
}

.source-switch-btn.active {
    background: #3498db;
    color: #fff;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    background: white;
    transition: border-color 0.3s, background 0.3s;
}

.upload-area.dragover {
    border-color: #3498db;
    background: #ebf5fb;
}

.upload-area button {
    margin: 1rem 0;
}

.upload-area button:hover {
    background: #2980b9;
}

.upload-area .hint {
    font-size: 0.8rem;
    color: #888;
}

.api-placeholder {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    color: #555;
}

#api-connect-form h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

#data-section {
    margin: 0 -1rem;
}

.api-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

.api-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: #2c3e50;
}

.api-form-field input,
.api-form-field select {
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
}

.api-form-field.has-error input,
.api-form-field.has-error select {
    border-color: #dc3545;
}

.field-error {
    min-height: 1rem;
    color: #dc3545;
    font-size: 0.75rem;
}

.form-errors {
    margin-bottom: 1rem;
    border: 1px solid #f0b9bf;
    background: #fff4f5;
    color: #8e1f2b;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    font-size: 0.85rem;
}

.form-errors ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
}

.api-form-actions {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

#api-connect-form.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

#api-connect-btn,
#convert-folder-btn,
#convert-run-btn,
#cancel-job-btn,
.upload-area button {
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

#api-connect-btn:hover,
#convert-folder-btn:hover,
#convert-run-btn:hover,
#cancel-job-btn:hover,
.upload-area button:hover {
    background: #2980b9;
}

#convert-run-btn:disabled,
#convert-folder-btn:disabled,
#api-connect-btn:disabled,
#cancel-job-btn:disabled,
.upload-area button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#api-collect-btn {
    background: #1f8f4c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

#api-collect-btn:hover {
    background: #176e3a;
}

#api-collect-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.api-probe-options {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.api-form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.api-form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.api-form-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.api-form-checkbox span {
    color: #444;
}

.api-form-checkbox-sub {
    padding-left: 0.25rem;
    opacity: 0.8;
}

.api-probe-options-separator {
    margin: 0.5rem 0;
    border-top: 1px solid #e2e8f0;
}

.api-host-off-warning {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #92400e;
    font-weight: 500;
}


.api-connect-status {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.api-connect-status.success {
    color: #1f8f4c;
}

.api-connect-status.error {
    color: #dc3545;
}

.api-connect-status.info {
    color: #0f4dba;
}

.api-connect-status.warning {
    color: #b06a00;
}

.convert-progress {
    margin-top: 0.9rem;
}

.convert-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    color: #475569;
}

.convert-progress-track {
    height: 12px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #e2e8f0;
    overflow: hidden;
}

.convert-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    transition: width 0.2s ease;
}

.job-status {
    margin-top: 1rem;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

.job-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.job-status-header h4 {
    margin: 0;
    color: #2c3e50;
}

#cancel-job-btn:disabled {
    background: #9ca3af;
    cursor: default;
}

.job-status-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#skip-hung-btn {
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

#skip-hung-btn:hover {
    background: #d97706;
}

#skip-hung-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.job-status-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.job-progress {
    height: 22px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.job-progress-bar {
    height: 100%;
    min-width: 2.5rem;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.25s ease;
}

.job-active-modules {
    margin-bottom: 0.85rem;
}

.job-module-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.job-module-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #eef6ff;
    border: 1px solid #bfdcff;
    border-radius: 999px;
    padding: 0.32rem 0.68rem;
    line-height: 1;
}

.job-module-chip-name {
    font-size: 0.82rem;
    color: #1f2937;
    font-weight: 600;
}

.job-module-chip-score {
    font-size: 0.72rem;
    color: #1d4ed8;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.1rem 0.38rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.job-debug-info {
    margin-bottom: 0.85rem;
    border: 1px solid #dbe5f0;
    background: #f8fbff;
    border-radius: 8px;
    padding: 0.75rem;
}

.job-debug-summary {
    font-size: 0.82rem;
    color: #334155;
    margin-top: 0.35rem;
}

.job-phase-telemetry {
    margin-top: 0.55rem;
    display: grid;
    gap: 0.35rem;
}

.job-phase-row {
    display: grid;
    grid-template-columns: minmax(120px, 180px) repeat(4, minmax(60px, auto));
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
}

.job-phase-name {
    color: #0f172a;
    font-weight: 600;
}

.job-phase-metric {
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.meta-label {
    color: #64748b;
    font-weight: 600;
}

.job-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.job-status-badge.status-queued,
.job-status-badge.status-running {
    background: #eff6ff;
    color: #1d4ed8;
}

.job-status-badge.status-success {
    background: #ecfdf3;
    color: #15803d;
}

.job-status-badge.status-failed {
    background: #fef2f2;
    color: #b91c1c;
}

.job-status-badge.status-canceled {
    background: #f1f5f9;
    color: #334155;
}

.job-status-logs ul {
    list-style: none;
    margin-top: 0.35rem;
    border-top: 1px solid #e5e7eb;
}

.job-status-logs li {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.85rem;
}

.log-time {
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.log-message {
    color: #334155;
}

#upload-status {
    margin-top: 1rem;
    text-align: center;
    padding: 0.5rem;
}

#upload-status.error {
    color: #e74c3c;
}

#upload-status.success {
    color: #27ae60;
}

/* Parsers info */
.parsers-info {
    margin-top: 1.5rem;
    text-align: center;
}

.parsers-title {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.parsers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.parser-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #eef6ff;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid #bfdcff;
    line-height: 1;
}

.parser-chip-name {
    font-size: 0.85rem;
    color: #1f2937;
    font-weight: 500;
}

.parser-chip-version {
    font-size: 0.72rem;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* File Info */
.parser-badge, .file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.badge-value {
    font-size: 0.875rem;
    color: #2c3e50;
    font-weight: 600;
    background: #e3f2fd;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    border: 1px solid #90caf9;
}

.parser-badge .badge-value {
    background: #e8f5e9;
    border-color: #81c784;
}

.result-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

.audit-viewer-shell {
    min-height: 60vh;
    margin: 0;
}

.audit-viewer-frame {
    width: 100%;
    min-height: 60vh;
    border: none;
    border-radius: 0;
    background: #fff;
    display: block;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: #333;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

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

/* Toolbar */
.toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar select,
.toolbar button {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.toolbar select {
    border: 1px solid #ddd;
}

.toolbar button {
    background: #27ae60;
    color: white;
    border: none;
    cursor: pointer;
}

.toolbar button:hover {
    background: #219a52;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

#parse-errors-table {
    min-width: 980px;
    table-layout: fixed;
}

#parse-errors-table th:nth-child(1),
#parse-errors-table td:nth-child(1) {
    width: 92px;
}

#parse-errors-table th:nth-child(2),
#parse-errors-table td:nth-child(2) {
    width: 110px;
}

#parse-errors-table th:nth-child(3),
#parse-errors-table td:nth-child(3) {
    width: 95px;
}

#parse-errors-table th:nth-child(4),
#parse-errors-table td:nth-child(4) {
    width: 300px;
}

#parse-errors-table th:nth-child(5),
#parse-errors-table td:nth-child(5) {
    width: auto;
}

#parse-errors-table td,
#parse-errors-table th {
    vertical-align: top;
}

#parse-errors-table td code {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: inline-block;
}

#parse-errors-table td:last-child {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
    background: #f0f0f0;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* Severity badges */
.severity {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity.critical {
    background: #e74c3c;
    color: white;
}

.severity.warning {
    background: #f39c12;
    color: white;
}

.severity.info {
    background: #3498db;
    color: white;
}

/* Category badges */
.category-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #95a5a6;
    color: white;
}

.category-badge.board {
    background: #2c3e50;
}

.category-badge.cpu {
    background: #e74c3c;
}

.category-badge.memory {
    background: #3498db;
}

.category-badge.storage {
    background: #27ae60;
}

.category-badge.pcie {
    background: #e67e22;
}

.category-badge.network {
    background: #1abc9c;
}

.category-badge.psu {
    background: #f39c12;
}

.category-badge.fru {
    background: #9b59b6;
}

.category-badge.firmware {
    background: #34495e;
}

/* Toolbar label */
.toolbar-label {
    font-size: 0.875rem;
    color: #666;
}

/* Config sections */
.config-section {
    margin-bottom: 1.5rem;
}

.config-section h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
}

/* Specification section */
.spec-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #3498db;
}

.spec-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spec-list li {
    padding: 0.4rem 0;
    border-bottom: 1px dashed #e0e0e0;
}

.spec-list li:last-child {
    border-bottom: none;
}

.spec-category {
    font-weight: 600;
    color: #2c3e50;
    min-width: 180px;
    display: inline-block;
}

.spec-qty {
    color: #666;
    font-weight: 500;
}

.card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

/* Sensors */
.sensor-group {
    margin-bottom: 1.5rem;
}

.sensor-group h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.sensor-card {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    background: #f8f9fa;
    border-left: 3px solid #27ae60;
}

.sensor-card.ok {
    border-left-color: #27ae60;
}

.sensor-card.warn {
    border-left-color: #f39c12;
}

.sensor-card.voltage-out-of-range {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.sensor-card.ns {
    border-left-color: #95a5a6;
    opacity: 0.6;
}

.sensor-name {
    font-size: 0.75rem;
    color: #666;
}

.sensor-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
}

.footer-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-info {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.footer-info a {
    color: #3498db;
    text-decoration: none;
}

.footer-info a:hover {
    text-decoration: underline;
}

#clear-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#clear-btn:hover {
    background: #c0392b;
}

#restart-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#restart-btn:hover {
    background: #2980b9;
}

#exit-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#exit-btn:hover {
    background: #7f8c8d;
}

/* Utility */
.hidden {
    display: none !important;
}

.no-data {
    text-align: center;
    color: #888;
    padding: 2rem;
}

/* Server info header */
.server-info {
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.server-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-info-label {
    opacity: 0.8;
    font-size: 0.875rem;
}

.server-info strong {
    font-size: 1.1rem;
}

.server-info code {
    background: rgba(255,255,255,0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
}

/* Configuration tabs */
.config-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: #f0f0f0;
    padding: 0.25rem;
    border-radius: 6px;
}

.config-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
}

.config-tab:hover {
    color: #333;
    background: #e0e0e0;
}

.config-tab.active {
    color: white;
    background: #3498db;
}

.config-tab-content {
    display: none;
}

.config-tab-content.active {
    display: block;
}

.config-tab-content h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    color: #2c3e50;
}

.pcie-group-title {
    margin: 1rem 0 0.5rem;
    color: #34495e;
    font-size: 0.95rem;
}

/* Config tables */
.config-table {
    font-size: 0.875rem;
}

.config-table th {
    background: #2c3e50;
    color: white;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

.config-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

.config-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.config-table tbody tr:hover {
    background: #e8f4fc;
}

/* Memory table specific */
.memory-table .row-warning {
    background: #fff3cd !important;
}

.memory-table .row-warning:hover {
    background: #ffe8a1 !important;
}

.memory-table .present-yes {
    color: #27ae60;
    font-weight: bold;
}

.memory-table .present-no {
    color: #95a5a6;
}

.memory-table .status-warning {
    color: #e74c3c;
    font-weight: bold;
}

/* Section overview stats */
.memory-overview,
.section-overview {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-box {
    background: #f8f9fa;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
    min-width: 80px;
}

.stat-box.model-box {
    flex-grow: 1;
    text-align: left;
    border-left-color: #27ae60;
}

.stat-box.model-box .stat-value {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
}

.stat-box.pcie-balance-ok {
    border-left-color: #27ae60;
}

.stat-box.pcie-balance-warning {
    border-left-color: #f39c12;
}

.stat-box.pcie-balance-critical {
    border-left-color: #e74c3c;
}

.pcie-balance-bars {
    margin-bottom: 1rem;
    display: grid;
    gap: 0.5rem;
    max-width: 560px;
}

.pcie-balance-row {
    display: grid;
    grid-template-columns: 72px 1fr 42px;
    gap: 0.5rem;
    align-items: center;
}

.pcie-balance-cpu,
.pcie-balance-value {
    font-size: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
}

.pcie-balance-track {
    height: 10px;
    border-radius: 999px;
    background: #e5e9ec;
    overflow: hidden;
}

.pcie-balance-fill {
    height: 100%;
    border-radius: inherit;
    min-width: 2px;
}

.pcie-balance-fill.pcie-balance-ok {
    background: #27ae60;
}

.pcie-balance-fill.pcie-balance-warning {
    background: #f39c12;
}

.pcie-balance-fill.pcie-balance-critical {
    background: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .sensor-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .config-tabs {
        flex-direction: column;
    }

    .config-tab {
        text-align: left;
    }

    .memory-overview {
        flex-direction: column;
    }

    .config-table {
        font-size: 0.75rem;
    }

    .config-table th,
    .config-table td {
        padding: 0.25rem 0.5rem;
    }
}

/* PCIe degraded link highlighting */
.pcie-degraded {
    color: #dc3545;
    font-weight: 600;
}

.pcie-max {
    color: #6c757d;
    font-size: 0.9em;
}
