/* Design tokens — Cisco Quantization Portal ("Clean enterprise SaaS", Figma file Qu163SdUZ5yJRJt1XDjEyR) */
:root {
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --brand-600: #4338ca;
    --brand-700: #3730a3;
    --info-50: #eff6ff;
    --info-600: #1d4ed8;
    --success-50: #f0fdf4;
    --success-600: #15803d;
    --danger-50: #fef2f2;
    --danger-600: #b91c1c;
    --shadow-card: 0px 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-login: 0px 4px 16px rgba(0, 0, 0, 0.08);
}

body {
    background-color: var(--gray-50);
    color: var(--gray-900);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

/* ---------- Top nav ---------- */
.portal-topnav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-card);
    padding: 18px 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-topnav-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-900);
}

.portal-logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 5px;
    border: 1px solid #dce3f5;
    border-radius: 9px;
    background: var(--white);
    flex-shrink: 0;
}

.portal-logo-image {
    display: block;
    width: 100%;
    height: 100%;
}

.portal-brand-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
}

.portal-topnav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 14px;
    background: var(--gray-700);
    color: var(--white);
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.portal-user-email {
    font-size: 13px;
    color: var(--gray-900);
}

.portal-topnav-divider {
    width: 1px;
    height: 16px;
    background: var(--gray-200);
}

.portal-logout-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-900);
    text-decoration: none;
}

.portal-logout-link:hover {
    color: var(--brand-600);
    text-decoration: underline;
}

.portal-main {
    max-width: 1312px;
    margin: 0 auto;
    padding: 40px 64px;
}

.portal-footer {
    text-align: center;
    color: var(--gray-500);
    font-size: 12px;
    padding: 24px 0;
}

/* ---------- Page header ---------- */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

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

.page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
    text-decoration: none;
    margin-bottom: 24px;
}

.back-link:hover {
    color: var(--gray-700);
    text-decoration: underline;
}

/* ---------- Buttons (Bootstrap overrides) ---------- */
.btn {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
    font-weight: 600;
    padding: 10px 16px;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
}

.btn-outline-primary {
    color: var(--brand-600);
    border-color: var(--brand-600);
}

.btn-outline-primary:hover {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
    color: var(--white);
}

.btn-outline-danger {
    color: var(--danger-600);
    border-color: var(--gray-300);
}

.btn-outline-danger:hover {
    background-color: var(--danger-50);
    border-color: var(--danger-600);
    color: var(--danger-600);
}

.btn-cancel-job {
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #f97316;
    font-weight: 600;
}

.btn-cancel-job:hover,
.btn-cancel-job:focus-visible {
    color: #fff;
    background: #ea580c;
    border-color: #c2410c;
}

.btn-cancel-job:disabled,
.btn-cancel-job.disabled {
    color: #9a8b80;
    background: #fffaf5;
    border-color: #f1c7a8;
    opacity: 1;
}

.btn-outline-secondary {
    color: var(--gray-300);
    border-color: var(--gray-200);
}

#refreshJobs {
    color: var(--gray-700);
    background: #fff;
    border-color: var(--gray-300);
    font-weight: 600;
}

#refreshJobs:hover,
#refreshJobs:focus-visible {
    color: var(--brand-700);
    background: var(--brand-50);
    border-color: var(--brand-300);
}

#refreshJobs:disabled {
    color: var(--brand-700);
    background: var(--brand-50);
    border-color: var(--brand-300);
    opacity: 1;
    cursor: wait;
}

#refreshJobs .spinner-border {
    width: .85rem;
    height: .85rem;
    border-width: .14em;
    vertical-align: -.12em;
}

.history-refresh-status {
    min-width: 10rem;
    color: var(--gray-500);
    font-size: .78rem;
}

.btn-link {
    color: var(--gray-700);
}

.btn-link:hover {
    color: var(--brand-600);
}

/* ---------- Shared confirmation dialog ---------- */
.portal-dialog-shell {
    width: calc(100% - 2rem);
    max-width: 560px;
}

.portal-dialog {
    overflow: hidden;
    border: 1px solid #e1e5f0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(24, 31, 62, .22);
}

.portal-dialog .modal-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 26px 26px 18px;
}

.portal-dialog-icon {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 20px;
}

.portal-dialog-warning {
    color: #a16207;
    background: #fef3c7;
}

.portal-dialog-danger {
    color: #b42318;
    background: #fee4e2;
}

.portal-dialog-info {
    color: var(--brand-600);
    background: #eeedff;
}

.portal-dialog-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.portal-dialog-copy .eyebrow {
    color: #8a94a8;
    font-size: 10px;
}

.portal-dialog-copy h2 {
    margin: 6px 0 8px;
    color: #1a2140;
    font-size: 20px;
    letter-spacing: -.35px;
}

.portal-dialog-copy p {
    margin: 0;
    color: #68738c;
    font-size: 13px;
    line-height: 1.55;
}

.portal-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 9px;
    padding: 0 26px 24px;
    border-top: 0;
}

.portal-dialog-actions .btn {
    min-width: 112px;
    white-space: nowrap;
}

.portal-dialog-actions .btn-light {
    color: #4c5872;
    background: #f6f7fb;
    border-color: #e1e5f0;
}

.portal-dialog-actions .btn-light:hover,
.portal-dialog-actions .btn-light:focus-visible {
    color: #27304e;
    background: #edf0f6;
    border-color: #d2d8e5;
}

@media (max-width: 575.98px) {
    .portal-dialog-shell {
        width: calc(100% - 1rem);
    }

    .portal-dialog .modal-body {
        gap: 12px;
        padding: 22px 20px 16px;
    }

    .portal-dialog-actions {
        gap: 8px;
        padding: 0 20px 20px;
    }
}

/* ---------- Generic cards ---------- */
.card {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-900);
}

/* ---------- Job history table ---------- */
.table-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.portal-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    margin: 0;
}

.portal-table thead th {
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}

.portal-table tbody td {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-900);
    vertical-align: middle;
}

.portal-table tbody tr:first-child td {
    border-top: none;
}

.portal-table tbody tr {
    transition: background .18s ease, box-shadow .18s ease;
}

.portal-table tbody tr:hover td {
    background: #fbfbff;
}

.portal-table tbody a {
    color: var(--gray-900);
    font-weight: 500;
    text-decoration: none;
}

.portal-table tbody a:hover {
    color: var(--brand-600);
    text-decoration: underline;
}

.history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 10px;
    color: var(--gray-900);
}
.history-toolbar-note,
.history-job-meta {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    margin-top: 3px;
}
.history-job-link {
    display: block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-load-more { display: flex; justify-content: center; margin: 14px 0 4px; }
.history-job-meta {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-expiry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #53607a;
    font-size: 12px;
    white-space: nowrap;
}
.history-expiry i { color: #7582a3; font-size: 13px; }

.portal-table td.text-muted,
.portal-table td.cell-secondary {
    color: var(--gray-500);
    font-size: 13px;
}

/* ---------- Status badges ---------- */
.badge.badge-status-queued,
.badge.badge-status-running,
.badge.badge-status-completed,
.badge.badge-status-failed,
.badge.badge-status-cancelled,
.badge.badge-status-deleted {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: normal;
}

.badge.badge-status-queued {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge.badge-status-running {
    background: var(--info-50);
    color: var(--info-600);
}

.badge.badge-status-completed {
    background: var(--success-50);
    color: var(--success-600);
}

.badge.badge-status-failed {
    background: var(--danger-50);
    color: var(--danger-600);
}

.badge.badge-status-cancelled {
    background: var(--amber-50);
    color: var(--amber-700);
}

.badge.badge-status-deleted {
    background: var(--gray-100);
    color: var(--gray-500);
}

.badge.badge-status-queued,
.badge.badge-status-running,
.badge.badge-status-completed,
.badge.badge-status-failed,
.badge.badge-status-cancelled,
.badge.badge-status-deleted {
    gap: 6px;
}

.badge.badge-status-queued i,
.badge.badge-status-running i,
.badge.badge-status-completed i,
.badge.badge-status-failed i,
.badge.badge-status-cancelled i,
.badge.badge-status-deleted i {
    font-size: 11px;
}

/* ---------- Empty / loading states ---------- */
.empty-state,
.loading-state {
    text-align: center;
    color: var(--gray-500);
    padding: 64px 0;
}

.empty-state-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-300);
}

/* ---------- Alerts (Bootstrap variant overrides) ---------- */
.alert {
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-danger {
    background: var(--danger-50);
    color: var(--danger-600);
    border-color: var(--danger-50);
}

.alert-success {
    background: var(--success-50);
    color: var(--success-600);
    border-color: var(--success-50);
}

.alert-warning,
.alert-info {
    background: var(--info-50);
    color: var(--info-600);
    border-color: var(--info-50);
}

/* ---------- Upload page ---------- */
.upload-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 32px;
    max-width: 720px;
}

.upload-card .form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.upload-card .form-control,
.upload-card .form-select {
    border-color: var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.upload-card .form-control:focus,
.upload-card .form-select:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.12);
}

.upload-section {
    margin-bottom: 20px;
}

.upload-section:last-of-type {
    margin-bottom: 0;
}

.upload-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
}

.upload-dropzone {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.upload-dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.upload-dropzone-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin: 0;
}

.upload-dropzone-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

.upload-file-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.upload-file-row .progress {
    flex: 1;
    height: 0.5rem;
    border-radius: 999px;
}

.upload-file-row .progress-bar {
    background-color: var(--brand-600);
}

.advanced-toggle {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-decoration: none;
}

.advanced-toggle .bi-chevron-down {
    transition: transform 0.15s ease;
}

.advanced-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* ---------- Results page ---------- */
.results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.results-header .page-title {
    margin: 0;
}

.details-card,
.outputs-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 28px 32px;
    max-width: 720px;
    margin-bottom: 20px;
}
.outputs-card {
    background: #f2fbf5;
    border-color: #cfe8d7;
}
.outputs-card .list-group-item {
    background: transparent;
    border-color: #dcefe2;
}

.history-actions { white-space: nowrap; }
.btn-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 9px;
    margin-left: 4px;
}
.access-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.access-owner { color: #16786e; background: #eefaf7; }
.access-shared { color: #5a4bc2; background: #f1efff; }
.readonly-label { color: #8992a5; font-size: 11px; white-space: nowrap; }

.share-modal { border: 0; border-radius: 16px; box-shadow: 0 22px 65px rgba(21, 27, 57, .22); }
.share-modal .modal-header { padding: 22px 24px 16px; border-bottom: 1px solid #edf0f5; }
.share-modal .modal-title { margin-top: 5px; color: #1a2140; font-size: 22px; letter-spacing: -.4px; }
.share-modal .modal-body { padding: 20px 24px 24px; }
.share-modal-help { color: #68738c; font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
.share-form .form-control { min-height: 42px; border-color: #d7dbe6; }
.share-form .btn { min-width: 92px; }
.share-form .form-text { color: #8b94a8; font-size: 11px; margin-top: 7px; }
.share-list-heading { color: #53607a; font-size: 11px; font-weight: 700; letter-spacing: .5px; margin: 23px 0 9px; text-transform: uppercase; }
.share-list { display: grid; gap: 8px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #e6e9f0; border-radius: 10px; background: #fbfcfe; }
.share-avatar { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 9px; color: #5a4bc2; background: #eeedff; }
.share-person { min-width: 0; flex: 1; }
.share-person strong, .share-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-person strong { color: #303a58; font-size: 12px; }
.share-person small { color: #8992a5; font-size: 10px; margin-top: 2px; }
.share-empty, .share-loading { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 10px; color: #8992a5; background: #f8f9fc; font-size: 12px; }
.share-empty i { color: #7569d5; font-size: 16px; }

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}
.results-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .95fr);
    gap: 18px;
    align-items: start;
}
.results-detail-column,
.results-output-column { min-width: 0; }
.results-detail-column .details-card,
.results-detail-column .retention-callout,
.results-output-column .outputs-card {
    max-width: none;
}
.results-output-column .outputs-card { margin-bottom: 0; }
.results-output-column .outputs-card {
    display: flex;
    flex-direction: column;
    height: clamp(420px, calc(100vh - 250px), 860px);
    min-height: 0;
}
.submission-details-card {
    margin-top: 14px;
    padding: 20px 24px;
    border: 1px solid #e1e5f0;
    border-radius: 14px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 8px 24px rgba(24,31,62,.035);
}
.submission-details-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.submission-details-header .upload-section-title { margin-bottom: 3px; }
.submission-details-section { margin-top: 17px; padding-top: 15px; border-top: 1px solid #edf0f5; }
.submission-details-section-title { color: #596580; font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.submission-file-row { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 9px 0; border-bottom: 1px solid #f1f3f7; }
.submission-file-row:last-child { border-bottom: 0; }
.submission-file-label { flex: 0 0 118px; color: #7a849a; font-size: 11px; }
.submission-file-name { min-width: 0; overflow: hidden; color: #27304e; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.submission-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; margin-top: 9px; }
.submission-option { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; padding: 8px 10px; border-radius: 8px; background: #f8f9fc; }
.submission-option span { color: #7a849a; font-size: 10px; }
.submission-option strong { min-width: 0; overflow: hidden; color: #303a58; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.submission-details-empty { color: #8992a5; font-size: 11px; margin-top: 9px; }
.output-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 0;
}
.output-file-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: #25304d;
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.output-file-actions {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
}
.output-file-size {
    color: #68738c;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.output-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
    font-size: 14px;
}
.retention-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 720px;
    margin: 14px 0;
    padding: 15px 18px;
    border: 1px solid #d8e6f6;
    border-radius: 12px;
    background: #f6faff;
    color: #355274;
}
.retention-callout > i { color: #3f76b5; font-size: 18px; margin-top: 2px; }
.retention-callout strong,
.retention-callout span,
.retention-callout small { display: block; }
.retention-callout strong { font-size: 13px; color: #29476b; }
.retention-callout span { margin-top: 2px; font-size: 13px; }
.retention-callout small { margin-top: 5px; color: #6c7f96; font-size: 11px; line-height: 1.4; }
.outputs-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.outputs-empty { padding: 17px 0 4px; color: #748198; font-size: 13px; }
.outputs-card-header { flex: 0 0 auto; }
.failure-logs-card {
    padding: 18px;
    border: 1px solid #f0d4d4;
    border-radius: 12px;
    background: #fff8f8;
    box-shadow: var(--shadow-card);
}
.failure-logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.failure-logs-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.failure-log-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #dccfd3;
    border-radius: 9px;
    background: rgba(255,255,255,.78);
    color: #704852;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .16s, background .16s, color .16s, transform .16s;
}
.failure-log-action:hover,
.failure-log-action:focus-visible {
    border-color: #b98994;
    background: #fff;
    color: #4b2730;
    transform: translateY(-1px);
}
.failure-log-action:focus-visible {
    outline: 3px solid rgba(185,137,148,.22);
    outline-offset: 2px;
}
.failure-log-action.is-success {
    border-color: #79b9aa;
    color: #147868;
}
.failure-logs-content {
    max-height: 430px;
    margin: 0;
    overflow: auto;
    padding: 12px;
    border: 1px solid #f1dddd;
    border-radius: 8px;
    background: #fff;
    color: #4b2730;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.failure-logs-card.is-maximized {
    position: fixed;
    inset: 18px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    padding: 22px;
    border-radius: 15px;
    box-shadow: 0 24px 70px rgba(39,24,31,.28);
}
.failure-logs-card.is-maximized .failure-logs-content {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}
body.failure-logs-maximized { overflow: hidden; }
.failure-logs-note {
    display: block;
    margin-top: 8px;
    color: #8a6470;
    font-size: 11px;
}
@media (max-width: 640px) {
    .failure-logs-card.is-maximized { inset: 8px; padding: 14px; }
}
.outputs-summary {
    margin-left: 8px;
    color: #68738c;
    font-size: 11px;
    font-weight: 400;
}
.outputs-download-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 52px;
    height: 34px;
    padding: 4px 9px;
    border: 1px solid #6b61e8;
    border-radius: 10px;
    background: rgba(255,255,255,.72);
    color: #5046d8;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
    white-space: nowrap;
}
.outputs-download-all:hover {
    border-color: #5046d8;
    background: #fff;
    color: #3f36c8;
    transform: translateY(-1px);
}
.outputs-download-all:focus-visible {
    outline: 3px solid rgba(80,70,216,.2);
    outline-offset: 2px;
}
.outputs-download-all-icon { font-size: 16px; line-height: 1; }
.outputs-download-all-caption {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .55px;
    line-height: 1;
    text-transform: uppercase;
}
.outputs-download-all.is-downloading {
    border-color: #8794ab;
    color: #66748e;
    pointer-events: none;
}
.outputs-download-all.is-downloading .outputs-download-all-icon { animation: output-download-spin .8s linear infinite; }
.outputs-download-all.is-started {
    border-color: #35a66f;
    background: #effaf4;
    color: #24794f;
}
@keyframes output-download-spin { to { transform: rotate(360deg); } }
#outputsList {
    flex: 1 1 auto;
    min-height: 0;
    margin-right: -24px;
    overflow-y: auto;
    padding-right: 18px;
    scrollbar-gutter: stable;
}
#outputsList::-webkit-scrollbar { width: 10px; }
#outputsList::-webkit-scrollbar-track { background: transparent; }
#outputsList::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #8e969f;
    background-clip: content-box;
}
.output-folder { border-bottom: 1px solid #dcefe2; }
.output-folder summary {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 1px 0;
    padding: 6px 7px 6px 0;
    border-radius: 8px;
    color: #31476b;
    cursor: pointer;
    list-style: none;
    transition: background-color .14s ease, color .14s ease;
}
.output-folder summary::-webkit-details-marker { display: none; }
.output-folder summary:hover {
    background: rgba(71,116,168,.08);
    color: #213b62;
}
.output-folder summary:focus-visible {
    outline: 2px solid rgba(71,116,168,.28);
    outline-offset: -1px;
}
.output-folder-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 10px;
    color: #71819b;
    font-size: 9px;
    transition: transform .16s ease;
}
.output-folder[open] > summary .output-folder-chevron { transform: rotate(90deg); }
.output-folder-name {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.output-folder-icon { flex: 0 0 auto; color: #4774a8; font-size: 14px; }
.output-folder-icon-open { display: none; }
.output-folder[open] > summary .output-folder-icon-closed { display: none; }
.output-folder[open] > summary .output-folder-icon-open { display: inline-block; }
.output-folder-count {
    min-width: 21px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(71,116,168,.08);
    color: #71809a;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    text-align: center;
}
.output-folder-contents {
    margin-left: 5px;
    padding-left: 27px;
    border-left: 1px solid rgba(71,116,168,.16);
}
.output-folder-contents .list-group-item {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
}

.detail-row {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}

.detail-row + .detail-row {
    border-top: 1px solid var(--gray-100);
}

.detail-label {
    width: 180px;
    flex-shrink: 0;
    font-weight: 500;
    color: var(--gray-500);
}

.detail-value {
    flex: 1;
    min-width: 0;
    color: var(--gray-900);
    word-break: break-all;
}

/* ---------- Polished workspace refresh ---------- */
:root {
    --navy-950: #10152d;
    --navy-900: #171d3b;
    --violet-600: #5146d8;
    --violet-100: #eeedff;
    --teal-500: #18a999;
    --line-soft: #e7eaf1;
}

body {
    background:
        radial-gradient(circle at 88% -10%, rgba(81, 70, 216, 0.10), transparent 30rem),
        linear-gradient(180deg, #f8f9fc 0%, #f4f6fa 100%);
}

.portal-topnav {
    background: rgba(16, 21, 45, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 28px rgba(16, 21, 45, 0.12);
    padding: 14px 32px;
}

.portal-brand { color: #fff; gap: 12px; }
.portal-brand:hover { color: #fff; }
.portal-logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--white);
    border: 1px solid #dce3f5;
    box-shadow: none;
    font-size: 17px;
}
.portal-brand-copy { display: flex; flex-direction: column; gap: 1px; }
.portal-brand-kicker { color: #aeb7df; font-size: 9px; font-weight: 700; letter-spacing: 1.3px; }
.portal-brand-title { color: #fff; font-size: 14px; letter-spacing: 0.1px; }
.portal-brand-copy, .portal-topnav-user { min-width: 0; }
.portal-nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.portal-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #cbd2ee;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.portal-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    border: 1px solid rgba(174,183,223,.18);
    border-radius: 7px;
    background: rgba(255,255,255,.06);
    color: #c5ccef;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.portal-nav-icon i { color: currentColor; font-size: 13px; line-height: 1; }
.portal-nav-link:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.10); color: #fff; transform: translateY(-1px); }
.portal-nav-link:hover .portal-nav-icon { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.22); color: #fff; transform: scale(1.04); }
.portal-nav-link:focus-visible, .portal-logout-link:focus-visible { outline: 3px solid rgba(122, 113, 255, .55); outline-offset: 2px; }
.portal-nav-link.is-active:not(.portal-nav-link-primary) { background: rgba(255,255,255,.08); color: #fff; }
.portal-nav-link.is-active:not(.portal-nav-link-primary) { border-color: rgba(155,148,255,.20); box-shadow: inset 0 -2px 0 #8d85ff; }
.portal-nav-link.is-active:not(.portal-nav-link-primary) .portal-nav-icon { background: rgba(122,113,255,.22); border-color: rgba(190,185,255,.36); color: #fff; }
.portal-nav-link-primary {
    background: linear-gradient(135deg, rgba(119,109,255,.34), rgba(81,70,216,.48));
    border-color: rgba(155,148,255,.38);
    color: #fff;
    box-shadow: 0 6px 16px rgba(4, 7, 24, .20);
}
.portal-nav-link-primary .portal-nav-icon { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.30); color: #fff; }
.portal-nav-link-primary.is-active { background: linear-gradient(135deg, rgba(139,129,255,.48), rgba(81,70,216,.62)); border-color: rgba(213,209,255,.58); box-shadow: 0 0 0 2px rgba(122,113,255,.18), 0 8px 20px rgba(4, 7, 24, .24); }
.portal-nav-link-primary:hover { background: linear-gradient(135deg, rgba(145,135,255,.48), rgba(81,70,216,.58)); border-color: rgba(210,205,255,.52); color: #fff; }
.portal-topnav-user { display: flex; align-items: center; gap: 10px; color: #d9def2; flex-shrink: 0; }
.portal-user-identity { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 9px 3px 4px; border: 1px solid rgba(255,255,255,.10); border-radius: 999px; background: rgba(255,255,255,.045); }
.portal-avatar { background: #fff; color: var(--navy-900); width: 30px; height: 30px; }
.portal-user-email { max-width: 210px; overflow: hidden; color: #e5e8f4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.portal-topnav-divider { background: rgba(255,255,255,.22); }
.portal-logout-link { display: inline-flex; align-items: center; gap: 6px; color: #cbd2ee; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.portal-logout-link i { font-size: 15px; }
.portal-logout-link:hover { color: #fff; }
.portal-environment-badge { color: #a7f3d0; background: rgba(16,185,129,.14); border: 1px solid rgba(110,231,183,.25); border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 700; letter-spacing: .3px; }

.portal-main { max-width: 1600px; padding: 32px 56px 16px; }
.portal-footer { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 0 20px; }
.portal-footer-separator { color: #b9c0d1; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--violet-600); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.eyebrow i { font-size: 11px; }

.page-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    min-height: 205px;
    padding: 34px 38px;
    margin-bottom: 22px;
    border: 1px solid #dfe2f0;
    border-radius: 20px;
    background: linear-gradient(118deg, #fff 0%, #fafaff 54%, #f0efff 100%);
    box-shadow: 0 14px 34px rgba(24, 31, 62, .07);
}
.page-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: 10%; top: -150px; border: 1px solid rgba(81,70,216,.13); border-radius: 50%; box-shadow: 0 0 0 28px rgba(81,70,216,.035), 0 0 0 56px rgba(81,70,216,.025); pointer-events: none; }
.page-hero-copy, .page-hero-action { position: relative; z-index: 1; }
.page-hero .page-title { font-size: clamp(28px, 3vw, 40px); letter-spacing: -1.2px; margin: 9px 0 8px; }
.page-hero .page-subtitle { max-width: 660px; color: #5b6680; font-size: 15px; line-height: 1.55; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; color: #68738c; font-size: 12px; }
.hero-meta i { color: var(--teal-500); margin-right: 4px; }
.page-hero-action { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 190px; }
.hero-action-label { color: #68738c; font-size: 11px; font-weight: 700; }
.btn-hero { padding: 13px 17px; box-shadow: 0 9px 18px rgba(67,56,202,.20); }
.btn-hero i:last-child { font-size: 11px; margin-left: 9px; opacity: .8; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.workspace-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { position: relative; overflow: hidden; min-height: 116px; padding: 18px 22px 20px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255,255,255,.84); box-shadow: 0 5px 18px rgba(24,31,62,.035); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-card::after { content: ""; position: absolute; width: 92px; height: 92px; right: -34px; bottom: -48px; border: 1px solid rgba(81,70,216,.08); border-radius: 50%; pointer-events: none; }
.metric-card:hover { transform: translateY(-2px); border-color: #d9d6ff; box-shadow: 0 10px 24px rgba(24,31,62,.07); }
.metric-card-accent { border-color: #d9d6ff; background: linear-gradient(135deg, #fff, #f6f5ff); }
.metric-card-heading { display: flex; align-items: center; gap: 8px; min-height: 30px; margin-bottom: 11px; }
.metric-icon { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 9px; font-size: 14px; }
.metric-icon-violet { color: #5146d8; background: #eeedff; }
.metric-icon-teal { color: #168a7e; background: #e9f8f5; }
.metric-icon-blue { color: #3f76b5; background: #edf5ff; }
.metric-icon-green { color: #23845d; background: #ecf9f1; }
.metric-context { color: #8a94a8; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.metric-label, .metric-note { display: block; color: #758098; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.metric-value { display: block; color: #1a2140; font-size: 28px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -.6px; }
.metric-value small { color: #68738c; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.metric-value-icon { color: #168a7e; font-size: 18px; letter-spacing: 0; }
.metric-value-icon i { font-size: 15px; margin-right: 4px; }
.metric-note { color: #9099ac; font-size: 10px; letter-spacing: .1px; text-transform: none; font-weight: 500; }

.empty-state-panel { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(260px, 330px); align-items: center; gap: 28px; min-height: 260px; padding: 32px 38px; border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(255,255,255,.82); box-shadow: 0 8px 24px rgba(24,31,62,.035); text-align: left; }
.empty-state-visual { position: relative; display: flex; align-items: center; justify-content: center; width: 126px; height: 126px; border-radius: 32px; background: linear-gradient(145deg, #f0efff, #e9fbf8); color: var(--violet-600); font-size: 43px; }
.empty-state-orbit { position: absolute; border: 1px solid rgba(81,70,216,.20); border-radius: 50%; }
.empty-state-orbit-one { width: 84px; height: 84px; transform: rotate(28deg) scaleX(1.45); }
.empty-state-orbit-two { width: 58px; height: 58px; transform: rotate(-35deg) scaleX(1.45); border-color: rgba(24,169,153,.26); }
.empty-state-content h2 { color: #1a2140; font-size: 23px; letter-spacing: -.4px; margin: 7px 0 7px; }
.empty-state-content p { max-width: 470px; color: #68738c; font-size: 13px; line-height: 1.6; margin: 0 0 17px; }
.empty-next-steps { display: grid; gap: 9px; padding-left: 22px; border-left: 1px solid #e3e6ee; }
.next-step { display: flex; align-items: flex-start; gap: 10px; }
.next-step > span { color: var(--violet-600); font: 800 10px/1.8 Inter, sans-serif; }
.next-step strong, .next-step small { display: block; }
.next-step strong { color: #27304e; font-size: 12px; }
.next-step small { color: #8a94a8; font-size: 11px; line-height: 1.35; margin-top: 2px; }

.upload-page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.upload-page-header .page-title { margin: 0 0 7px; font-size: 31px; letter-spacing: -.8px; }
.upload-page-header .page-subtitle { color: #68738c; font-size: 14px; }
.upload-trust-banner { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid #cfeee8; border-radius: 11px; background: #f1fbf9; color: #168a7e; white-space: nowrap; }
.upload-trust-banner > i { font-size: 18px; }
.upload-trust-banner strong, .upload-trust-banner small { display: block; }
.upload-trust-banner strong { font-size: 12px; }
.upload-trust-banner small { color: #5f8d88; font-size: 10px; margin-top: 2px; }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); align-items: start; gap: 24px; max-width: 1488px; }
.upload-card { max-width: none; padding: 34px 38px; border-radius: 16px; box-shadow: 0 10px 28px rgba(24,31,62,.06); }
.upload-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #edf0f5; }
.upload-input-grid .upload-section { min-width: 0; padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.upload-section { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid #edf0f5; }
.upload-section:last-of-type { border-bottom: 0; }
.upload-section-title { color: #26304f; font-size: 14px; }
.upload-dropzone { min-height: 170px; border: 1px dashed #b8bee1; border-radius: 13px; background: linear-gradient(145deg, #fafaff, #f6fbfb); transition: border-color .2s, box-shadow .2s, transform .2s; }
.upload-dropzone:hover, .upload-dropzone:focus-within { border-color: var(--violet-600); box-shadow: 0 0 0 4px rgba(81,70,216,.09); transform: translateY(-1px); }
.upload-dropzone:focus-visible { outline: 3px solid rgba(81,70,216,.24); outline-offset: 3px; }
.upload-dropzone.is-dragover { border-color: var(--teal-500); background: linear-gradient(145deg, #f1fbf9, #f4f3ff); box-shadow: 0 0 0 4px rgba(24,169,153,.12); transform: translateY(-1px); }
.upload-dropzone.has-file { border-style: solid; border-color: #9bd8cf; background: linear-gradient(145deg, #f7fffd, #f8f7ff); }
.upload-dropzone-compact { min-height: 112px; padding: 20px 24px; }
.upload-input-grid .upload-dropzone-compact { min-height: 170px; }
.upload-dropzone-icon { background: #eeedff; color: var(--violet-600); }
.upload-dropzone-label { color: #27304e; }
.upload-card .form-control, .upload-card .form-select { min-height: 43px; border-color: #d7dbe6; }
.upload-card .form-label { color: #4c5872; }
.advanced-toggle { display: inline-flex; align-items: center; padding: 10px 12px; border-radius: 9px; background: #f6f7fb; color: #4b5680; }
.advanced-toggle:hover { background: #eeedff; color: var(--violet-600); text-decoration: none; }
.advanced-option-help { color: #7a849a; font-size: 11px; line-height: 1.45; margin: 7px 0 0; }
.advanced-option-help strong { color: #5c6680; font-weight: 700; }
.job-progress-card { margin: 20px 0 24px; padding: 22px 24px; border: 1px solid #e1e5f0; border-radius: 16px; background: linear-gradient(145deg, #fbfbff, #f5fbfa); box-shadow: 0 8px 24px rgba(24,31,62,.045); }
.job-progress-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.job-progress-kicker { color: var(--violet-600); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; }
.job-progress-header h2 { margin: 6px 0 0; color: #1a2140; font-size: 19px; line-height: 1.25; }
.job-progress-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: #68738c; text-align: right; }
.job-progress-meta strong { color: var(--violet-600); font-size: 20px; }
.job-progress-meta small { font-size: 11px; }
.job-progress-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.job-progress-step { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 27px auto; align-items: start; gap: 9px; min-width: 0; padding-right: 8px; color: #7d879c; }
.job-progress-step:not(:last-child)::after { content: ""; position: absolute; top: 13px; left: 28px; right: -10px; height: 1px; background: #dfe3ed; z-index: 0; }
.job-progress-step-marker { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; border: 1px solid #d8ddea; border-radius: 50%; background: #fff; color: #a0a8b9; font-size: 13px; }
.job-progress-step-copy { position: relative; z-index: 1; min-width: 0; }
.job-progress-step-copy strong, .job-progress-step-copy small { display: block; }
.job-progress-step-copy strong { color: #707b91; font-size: 12px; line-height: 1.3; }
.job-progress-step-copy small { margin-top: 4px; color: #8a94a8; font-size: 10px; line-height: 1.35; }
.job-progress-step-copy .job-progress-step-time { color: #5f6b84; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.job-progress-step.is-complete .job-progress-step-marker { border-color: #8ed2c4; background: #eafaf6; color: #168c78; }
.job-progress-step.is-complete .job-progress-step-copy strong { color: #27766b; }
.job-progress-step.is-active .job-progress-step-marker { border-color: #aaa2f1; background: #eeedff; color: var(--violet-600); box-shadow: 0 0 0 4px rgba(81,70,216,.08); }
.job-progress-step.is-active .job-progress-step-copy strong { color: var(--violet-600); }
.job-progress-step.is-active .bi-arrow-repeat { animation: job-progress-spin 1.3s linear infinite; }
.job-progress-step.is-failed .job-progress-step-marker { border-color: #e3a0a0; background: #fff1f1; color: #bd3e3e; }
.job-progress-step.is-failed .job-progress-step-copy strong { color: #a93838; }
@keyframes job-progress-spin { to { transform: rotate(360deg); } }
.upload-aside { display: grid; gap: 14px; }
.upload-aside-card { border: 1px solid #e1e5f0; border-radius: 16px; padding: 24px; box-shadow: 0 8px 24px rgba(24,31,62,.045); }
.upload-aside-card-primary { background: linear-gradient(145deg, #f8f7ff 0%, #f1fbfa 100%); border-color: #dcdcf4; }
.upload-aside-card-neutral { background: rgba(255,255,255,.86); }
.upload-aside-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--violet-600); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; }
.upload-aside-kicker i { font-size: 13px; }
.upload-aside-card h2 { color: #1a2140; font-size: 21px; line-height: 1.2; letter-spacing: -.35px; margin: 12px 0 9px; }
.upload-aside-card p { color: #68738c; font-size: 12px; line-height: 1.55; margin: 0; }
.upload-checklist { display: grid; gap: 15px; margin: 22px 0 0; padding: 0; list-style: none; }
.upload-checklist li { display: flex; align-items: flex-start; gap: 11px; }
.upload-checklist li > span { color: var(--violet-600); font-size: 10px; font-weight: 800; letter-spacing: .4px; line-height: 1.8; }
.upload-checklist strong, .upload-checklist small { display: block; }
.upload-checklist strong { color: #303a58; font-size: 12px; }
.upload-checklist small { color: #7f8aa1; font-size: 11px; line-height: 1.4; margin-top: 2px; }
.upload-checklist code { color: #5a4bc2; font-size: 10px; }
.upload-aside-title { display: flex; align-items: center; gap: 8px; color: #303a58; font-size: 13px; font-weight: 700; }
.upload-aside-title i { color: #168a7e; font-size: 16px; }
.upload-expectations { display: grid; gap: 13px; margin: 17px 0 0; padding: 0; list-style: none; }
.upload-expectations li { display: flex; align-items: flex-start; gap: 10px; color: #68738c; font-size: 12px; line-height: 1.45; }
.upload-expectations i { flex: 0 0 16px; color: #168a7e; font-size: 14px; margin-top: 1px; }
#uploadAlert { position: fixed; right: 24px; bottom: 24px; z-index: 1080; width: min(420px, calc(100vw - 32px)); margin: 0; padding: 14px 16px 14px 42px; border-radius: 12px; box-shadow: 0 14px 30px rgba(24,31,62,.16); }
#uploadAlert::before { content: "\f33a"; position: absolute; left: 16px; top: 14px; font-family: "bootstrap-icons"; font-size: 16px; }

/* ---------- Responsive layout ---------- */
@media (max-width: 1199px) {
    .portal-main { padding: 30px 38px 16px; }
    .page-hero { min-height: 185px; padding: 28px 30px; }
    .empty-state-panel { grid-template-columns: 126px minmax(0, 1fr) minmax(230px, 290px); gap: 22px; min-height: 230px; padding: 26px 30px; }
    .empty-state-visual { width: 108px; height: 108px; font-size: 38px; }
    .metric-card { min-height: 104px; padding: 18px 20px; }
    .upload-card { padding: 30px 32px; }
}

@media (max-width: 1100px) {
    .portal-user-email { display: none; }
    .portal-topnav-divider { display: none; }
}

@media (max-width: 900px) {
    .portal-main { padding: 24px 22px 14px; }
    .portal-topnav { padding: 12px 18px; }
    .portal-nav-links { gap: 4px; }
    .portal-nav-link { min-width: 36px; padding: 9px 10px; justify-content: center; }
    .portal-nav-link > span:not(.portal-nav-icon), .portal-logout-link span { display: none; }
    .portal-nav-link .portal-nav-icon { display: inline-flex; }
    .portal-logout-link { min-width: 30px; justify-content: center; }
    .portal-topnav-divider { display: none; }

    .page-hero {
        align-items: flex-start;
        flex-direction: column;
        min-height: 0;
        padding: 26px 24px;
        gap: 18px;
    }
    .page-hero-action {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
    }
    .hero-action-label { font-size: 10px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { min-height: 102px; padding: 17px 18px; }
    .metric-value { font-size: 25px; }

    .empty-state-panel {
        grid-template-columns: 98px minmax(0, 1fr);
        gap: 20px;
        min-height: 0;
        padding: 24px 24px;
    }
    .empty-state-visual { width: 94px; height: 94px; font-size: 32px; }
    .empty-next-steps {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        padding: 18px 0 0;
        border-left: 0;
        border-top: 1px solid #e3e6ee;
    }
    .next-step { gap: 7px; }
    .next-step strong { font-size: 11px; }
    .next-step small { font-size: 10px; }

    .upload-page-header { align-items: flex-start; flex-direction: column; gap: 14px; }
    .upload-trust-banner { white-space: normal; }
    .upload-layout { grid-template-columns: 1fr; gap: 16px; }
    .upload-card { width: 100%; padding: 26px 22px; }
    .upload-input-grid { grid-template-columns: 1fr; gap: 0; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid #edf0f5; }
    .upload-input-grid .upload-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #edf0f5; }
    .upload-input-grid .upload-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
}

@media (max-width: 700px) {
    .portal-main { padding: 22px 16px 20px; }
    .portal-topnav { padding: 10px 12px; }
    .portal-topnav-inner { gap: 6px; }
    .portal-brand-title { font-size: 11px; }
    .portal-user-identity { padding: 3px; }
    .portal-topnav-user { gap: 6px; }
    .portal-environment-badge { font-size: 0; padding: 5px 7px; }
    .portal-environment-badge i { font-size: 12px; margin: 0; }

    .page-hero { padding: 22px 18px; margin-bottom: 16px; gap: 14px; border-radius: 16px; }
    .page-hero .page-title { font-size: clamp(27px, 8vw, 34px); letter-spacing: -.8px; }
    .page-hero .page-subtitle { font-size: 14px; line-height: 1.45; }
    .hero-meta { gap: 9px 14px; margin-top: 13px; font-size: 11px; }
    .page-hero-action { gap: 10px; }
    .btn-hero { padding: 10px 13px; font-size: 13px; white-space: nowrap; }
    .job-progress-card { padding: 18px; }
    .job-progress-header { gap: 12px; }
    .job-progress-header h2 { font-size: 17px; }
    .job-progress-meta strong { font-size: 18px; }
    .job-progress-steps { grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
    .job-progress-step { display: flex; grid-template-columns: none; grid-template-rows: none; gap: 9px; padding-right: 0; }
    .job-progress-step:not(:last-child)::after { top: 27px; bottom: -12px; left: 13px; right: auto; width: 1px; height: auto; }
    .metric-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
    .metric-card { min-height: 0; padding: 15px 17px; }
    .metric-value { margin: 6px 0 4px; font-size: 23px; }

    .empty-state-panel { grid-template-columns: 1fr; gap: 14px; padding: 20px 18px; border-radius: 14px; }
    .empty-state-visual { width: 84px; height: 84px; font-size: 29px; border-radius: 24px; }
    .empty-state-orbit-one { width: 58px; height: 58px; }
    .empty-state-orbit-two { width: 42px; height: 42px; }
    .empty-state-content h2 { font-size: 21px; margin: 4px 0 6px; }
    .empty-state-content p { font-size: 12px; line-height: 1.5; margin-bottom: 13px; }
    .empty-next-steps { gap: 9px; padding-top: 14px; }
    .next-step { display: block; }
    .next-step > span { display: block; margin-bottom: 2px; }
    .next-step strong { font-size: 11px; }
    .next-step small { font-size: 10px; line-height: 1.3; }

    .upload-page-header { margin-bottom: 16px; }
    .upload-page-header .page-title { font-size: 27px; }
    .upload-card { padding: 22px 18px; border-radius: 14px; }
    .upload-section { padding-bottom: 18px; margin-bottom: 18px; }
    .upload-dropzone { min-height: 145px; padding: 24px 16px; }
    .upload-card .form-control, .upload-card .form-select { min-height: 41px; font-size: 13px; }
    .upload-input-grid .upload-dropzone-compact { min-height: 145px; }
    #productLine { max-width: 100% !important; }
    .history-toolbar { align-items: flex-start; }
    .table-card { overflow-x: auto; }
    .portal-table { min-width: 650px; }
    .portal-table thead th, .portal-table tbody td { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 900px) {
    .results-detail-grid { grid-template-columns: 1fr; }
    .results-output-column .outputs-card {
        height: auto;
        max-height: none;
        margin-bottom: 20px;
    }
}

@media (max-width: 520px) {
    #uploadAlert { right: 16px; bottom: 16px; width: calc(100vw - 32px); }
    .portal-brand-kicker { display: none; }
    .portal-brand { gap: 8px; }
    .portal-logo-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 15px; }
    .portal-brand-title { font-size: 11px; white-space: nowrap; }
    .portal-topnav-user { gap: 6px; }
    .portal-avatar { width: 28px; height: 28px; }
    .portal-footer { padding: 12px 16px 18px; font-size: 11px; flex-wrap: wrap; }
    .back-link { margin-bottom: 16px; }
    .upload-trust-banner { width: 100%; }
    .results-toolbar { align-items: flex-start; }
    .results-toolbar .btn { white-space: nowrap; }
    .details-card, .outputs-card, .submission-details-card { padding: 20px 18px; }
    #outputsList { margin-right: -12px; padding-right: 9px; }
    .submission-options-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
    .portal-environment-badge { font-size: 0; padding: 5px 7px; }
    .portal-environment-badge i { font-size: 12px; margin: 0; }
    .hero-action-label { display: none; }
    .page-hero-action { justify-content: flex-start; }
    .btn-hero { width: 100%; }
    .results-toolbar { flex-direction: column; align-items: stretch; }
    .results-toolbar .btn { width: 100%; }
}
