/* ==============================================================
   IDS-PDI — Professional Theme
   ============================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 10px 15px rgba(0,0,0,0.1);
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--gray-800);
    background: var(--gray-50);
    height: 100%;
}

/* ==============================================================
   Layout
   ============================================================== */

.layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-700);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-sub {
    font-size: 10px;
    color: var(--gray-400);
    letter-spacing: 0.3px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    font-size: 13px;
}

.user-icon { color: var(--success); }

.btn-logout {
    padding: 6px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-600);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-logout:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* ==============================================================
   Navigation
   ============================================================== */

.nav-menu {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
}

.nav-item:hover {
    background: var(--gray-800);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

/* ==============================================================
   Content
   ============================================================== */

.content-wrapper {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.app-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-400);
    font-size: 12px;
    text-align: center;
    flex-shrink: 0;
}

/* ==============================================================
   Login Page
   ============================================================== */

.login-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, #1e3a5f 100%);
}

.login-page { width: 100%; display: flex; justify-content: center; }

.login-card {
    width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    background: var(--gray-900);
    color: white;
    padding: 40px 32px 32px;
    text-align: center;
}

.login-logo-img {
    max-width: 180px;
    max-height: 60px;
    display: block;
    margin: 0 auto 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--gray-400);
    font-size: 13px;
}

.login-body {
    padding: 32px;
}

/* ==============================================================
   Forms
   ============================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover { background: var(--primary-dark); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* ==============================================================
   Dashboard / Pipeline
   ============================================================== */

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.workflow-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 20px 0;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
}

.pipeline-step.active .step-number {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.pipeline-step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pipeline-step.active .step-label { color: var(--primary); }
.pipeline-step.completed .step-label { color: var(--success); }

.pipeline-connector {
    width: 60px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 8px;
    margin-bottom: 24px;
    transition: background 0.3s;
}

.pipeline-connector.active { background: var(--success); }

/* ==============================================================
   Cards
   ============================================================== */

.dashboard-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body { padding: 24px; }

/* ==============================================================
   Mode Selector
   ============================================================== */

.mode-selector {
    margin-bottom: 24px;
}

.mode-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.mode-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    overflow: hidden;
}

.mode-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: white;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.mode-btn:not(:last-child) { border-right: 1px solid var(--gray-300); }

.mode-btn:hover { background: var(--gray-50); }

.mode-btn.active {
    background: var(--primary);
    color: white;
}

/* ==============================================================
   Upload Zone
   ============================================================== */

.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.upload-label { cursor: pointer; }

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.upload-label p {
    color: var(--gray-600);
    font-size: 14px;
}

.upload-label .link {
    color: var(--primary);
    font-weight: 600;
}

.upload-hint {
    font-size: 12px !important;
    color: var(--gray-400) !important;
    margin-top: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin-top: 12px;
    font-size: 13px;
}

.btn-remove {
    margin-left: auto;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 16px;
}

.btn-remove:hover { color: var(--danger); }

.btn-upload {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 16px;
}

.btn-upload:hover { background: var(--primary-dark); }
.btn-upload:disabled { opacity: 0.6; cursor: not-allowed; }

.file-name { flex: 1; color: var(--gray-700); }
.file-icon { font-size: 16px; }

.has-file {
    border-style: solid;
    border-color: var(--primary-light);
    background: #f0f5ff;
}

.done-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--success);
}

.done-icon {
    font-size: 18px;
    font-weight: 700;
}

.sheet-selector {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sheet-selector label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.sheet-selector select {
    flex: 1;
}

/* ==============================================================
   Journey / Wizard Style
   ============================================================== */

.journey-step {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.2s;
}

.journey-step.active-step {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-light);
}

.journey-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-50);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.journey-step.active-step .journey-step-header {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.journey-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gray-300);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.journey-step.active-step .journey-step-num {
    background: var(--primary);
}

.journey-step-body {
    padding: 16px;
}

/* Mode toggle (journey style) */
.mode-toggle-journey {
    display: flex;
    gap: 12px;
}

.mode-btn-j {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: all 0.15s;
}

.mode-btn-j:hover {
    border-color: var(--primary-light);
    background: #fafbff;
}

.mode-btn-j.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.mode-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.mode-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

.mode-btn-j.active .mode-title {
    color: var(--primary-dark);
}

.mode-desc {
    font-size: 11px;
    color: var(--gray-400);
}

/* Start journey button */
.journey-start {
    margin-top: 20px;
}

.btn-start-journey {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-lg);
}

.btn-start-journey:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-start-journey:active {
    transform: translateY(0);
}

.btn-start-icon {
    font-size: 28px;
}

.btn-start-label {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-start-sub {
    font-size: 12px;
    opacity: 0.8;
}

.done-message .link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.done-message .link:hover { text-decoration: underline; }

/* ==============================================================
   Loading
   ============================================================== */

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==============================================================
   Results
   ============================================================== */

.results-summary {
    display: flex;
    gap: 16px;
    margin: 20px 0;
}

.summary-item {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.summary-item.passed {
    background: var(--success-bg);
    color: var(--success);
}

.summary-item.failed {
    background: var(--danger-bg);
    color: var(--danger);
}

.summary-item.total {
    background: var(--gray-100);
    color: var(--gray-600);
}

.results-table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.results-table th:nth-child(1) { width: 50px; }
.results-table th:nth-child(2) { width: 140px; }
.results-table th:nth-child(3) { width: 100px; }
.results-table th:nth-child(4) { width: 100px; }
.results-table th:nth-child(5) { width: 90px; }
.results-table th:nth-child(6) { width: auto; }

.results-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-600);
    font-weight: 600;
    white-space: nowrap;
}

.results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.row-pass { background: #f0fdf4; }
.row-fail { background: var(--danger-bg); }

.badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ok {
    background: var(--success-bg);
    color: var(--success);
}

.badge-fail {
    background: var(--danger-bg);
    color: var(--danger);
}

.msg-cell {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
}

.btn-process {
    width: 100%;
    padding: 12px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 16px;
}

.btn-process:hover { background: #15803d; }
.btn-process:disabled { opacity: 0.6; cursor: not-allowed; }

/* ==============================================================
   Empty / Error States
   ============================================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.btn-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.btn-link:hover { text-decoration: underline; }

#blazor-error-ui { display: none; }

/* ==============================================================
   Duplicate / Warning Badges
   ============================================================== */

.row-dup { background: #fffbeb; }

.badge-dup {
    background: #fef3c7;
    color: #d97706;
}

/* ==============================================================
   Batch Meta (detail page)
   ============================================================== */

.batch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.meta-item {
    display: flex;
    gap: 6px;
}

.meta-label {
    font-weight: 600;
    color: var(--gray-500);
}

.meta-value {
    color: var(--gray-800);
}

/* ==============================================================
   Action Buttons (table)
   ============================================================== */

.action-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.btn-action {
    padding: 4px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.btn-action:hover { background: var(--gray-100); }

.btn-action-danger { color: var(--danger); border-color: #fecaca; }
.btn-action-danger:hover { background: var(--danger-bg); }

.btn-action-success { color: var(--success); border-color: #bbf7d0; }
.btn-action-success:hover { background: var(--success-bg); }

/* ==============================================================
   Add User Button
   ============================================================== */

.btn-add-user {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-add-user:hover { background: var(--primary-dark); }

/* ==============================================================
   Export Button
   ============================================================== */

.btn-export {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-export:hover { background: var(--primary-dark); }
.btn-export:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-back {
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}
.btn-back:hover { background: var(--bg-hover); }

/* ==============================================================
   Success Alert
   ============================================================== */

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

/* ==============================================================
   Modal
   ============================================================== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 440px;
    max-width: 90vw;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-close {
    border: none;
    background: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}

.btn-close:hover { color: var(--gray-600); }

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
}

.btn-cancel {
    padding: 8px 20px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-600);
    font-size: 13px;
    cursor: pointer;
}

.btn-cancel:hover { background: var(--gray-50); }

.btn-save {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save:hover { background: var(--primary-dark); }

/* ==============================================================
   Dashboard — Professional
   ============================================================== */

.dash-root {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Header ── */

.dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.dash-head-title {
    font-size: 22px;
    font-weight: 700;
    color: oklch(0.18 0.01 260);
    margin: 0;
    letter-spacing: -0.3px;
}

.dash-head-sub {
    font-size: 13px;
    color: oklch(0.5 0.02 260);
    margin: 4px 0 0;
}

.dash-head-sub strong { color: oklch(0.3 0.02 260); }

.dash-head-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: oklch(0.97 0.005 260);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid oklch(0.91 0.008 260);
}

.dash-filter-icon { color: oklch(0.5 0.02 260); flex-shrink: 0; }

.dash-head-select {
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: oklch(0.25 0.015 260);
    padding: 2px 4px;
    outline: none;
    min-width: 140px;
}

.dash-head-select:focus { color: var(--primary); }

/* ── Loading ── */

.dash-state {
    text-align: center;
    padding: 64px 0;
    color: oklch(0.5 0.02 260);
}

.dash-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid oklch(0.9 0.008 260);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: dash-spin 0.7s linear infinite;
}

@keyframes dash-spin { to { transform: rotate(360deg); } }

/* ── KPI Blocks ── */

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.kpi-block {
    position: relative;
    background: white;
    border: 1px solid oklch(0.915 0.006 260);
    border-radius: 12px;
    padding: 18px 20px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: default;
    overflow: hidden;
}

.kpi-block::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, oklch(0.5 0.1 260));
    border-radius: 12px 12px 0 0;
}

.kpi-block:hover {
    box-shadow: 0 4px 20px oklch(0.2 0.01 260 / 0.07);
    transform: translateY(-2px);
}

.kpi-block-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-bg, oklch(0.5 0.1 260 / 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-block-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.kpi-block-val {
    font-size: 26px;
    font-weight: 800;
    color: oklch(0.15 0.01 260);
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.kpi-block-lbl {
    font-size: 11px;
    font-weight: 600;
    color: oklch(0.5 0.02 260);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-block-sub {
    font-size: 11px;
    color: oklch(0.55 0.02 260);
    width: 100%;
    padding-top: 2px;
    margin-top: 2px;
    border-top: 1px solid oklch(0.93 0.005 260);
}

.kpi-pass .kpi-block-sub { color: oklch(0.45 0.1 150); }
.kpi-fail .kpi-block-sub { color: oklch(0.5 0.12 30); }

.kpi-block-track {
    width: 100%;
    height: 4px;
    background: oklch(0.92 0.005 260);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.kpi-block-fill {
    height: 100%;
    background: var(--accent, oklch(0.5 0.1 260));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Panel ── */

.dash-panel {
    background: white;
    border: 1px solid oklch(0.915 0.006 260);
    border-radius: 12px;
    overflow: hidden;
}

.dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid oklch(0.93 0.005 260);
}

.dash-panel-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: oklch(0.22 0.012 260);
    margin: 0;
}

.dash-panel-head h2 svg { color: oklch(0.5 0.02 260); }

.dash-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.dash-panel-link:hover { text-decoration: underline; }

/* ── Empty state ── */

.dash-empty {
    text-align: center;
    padding: 48px 0;
    color: oklch(0.55 0.02 260);
}

.dash-empty p { font-size: 14px; margin: 8px 0; }

.dash-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.dash-empty-cta:hover { background: var(--primary-dark); }

/* ── Feed rows ── */

.dash-feed { display: flex; flex-direction: column; }

.dash-feed-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    text-decoration: none;
    border-bottom: 1px solid oklch(0.95 0.005 260);
    transition: background 0.15s;
}

.dash-feed-row:last-child { border-bottom: none; }

.dash-feed-row:hover { background: oklch(0.985 0.003 260); }

.df-left {
    display: flex;
    flex-direction: column;
    min-width: 110px;
    flex-shrink: 0;
}

.df-id {
    font-size: 14px;
    font-weight: 700;
    color: oklch(0.18 0.01 260);
}

.df-file {
    font-size: 11px;
    color: oklch(0.5 0.02 260);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.df-mid {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.df-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.df-mode {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 4px;
}

.df-mode-c { background: oklch(0.93 0.04 220 / 0.3); color: oklch(0.35 0.08 220); }
.df-mode-u { background: oklch(0.93 0.04 280 / 0.3); color: oklch(0.35 0.08 280); }

.df-date {
    font-size: 11px;
    color: oklch(0.55 0.02 260);
}

.df-bar {
    display: flex;
    height: 4px;
    border-radius: 3px;
    overflow: hidden;
    background: oklch(0.93 0.005 260);
}

.df-bar-pass { background: oklch(0.55 0.14 150); transition: flex 0.3s; }
.df-bar-fail { background: oklch(0.55 0.16 30); transition: flex 0.3s; }

.df-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.df-status {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.df-st-done { background: oklch(0.92 0.06 160 / 0.35); color: oklch(0.32 0.08 160); }
.df-st-err { background: oklch(0.92 0.08 30 / 0.35); color: oklch(0.38 0.1 30); }
.df-st-warn { background: oklch(0.92 0.06 90 / 0.35); color: oklch(0.38 0.08 80); }
.df-st-idle { background: oklch(0.93 0.01 260 / 0.4); color: oklch(0.42 0.02 260); }

.df-counts {
    font-size: 12px;
    color: oklch(0.5 0.02 260);
}

.df-pass { color: oklch(0.4 0.1 150); font-weight: 600; }
.df-fail { color: oklch(0.45 0.12 30); font-weight: 600; }
.df-sep { color: oklch(0.7 0.01 260); margin: 0 1px; }
.df-total { color: oklch(0.55 0.02 260); }

.badge-warn {
    background: #fef3c7;
    color: #92400e;
}
