/* ============================================
   NoukhaInsight PDF Analyser
   Production Design System
   ============================================ */

:root {
    --primary: #4D4DFF;
    --primary-hover: #3d3de6;
    --primary-light: #B5B5FF;
    --primary-bg: rgba(77, 77, 255, 0.06);
    --primary-ring: rgba(77, 77, 255, 0.12);
    --bg: #f4f5f7;
    --bg-white: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --green: #10b981;
    --green-bg: rgba(16,185,129,0.08);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.06);
    --amber: #f59e0b;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.05);
    --t: 0.2s ease;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===================== HEADER ===================== */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    height: 60px;
}

.header-inner {
    width: 100%;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-brand-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.header-brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===================== FOOTER ===================== */
.footer {
    margin-top: auto;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 20px 0;
}

.footer-inner {
    width: 100%;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-powered {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.footer-powered strong {
    color: var(--text);
    font-weight: 600;
}

.footer-right {
    display: flex;
    align-items: center;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
}

/* Status Chip */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-chip--ok {
    background: var(--green-bg);
    color: #059669;
}

.status-chip--err {
    background: var(--red-bg);
    color: var(--red);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===================== CONTAINER ===================== */
.container {
    width: 100%;
    padding: 0 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===================== STEPS ===================== */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 0 16px;
    flex-shrink: 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.35;
    transition: opacity var(--t);
}

.step.active { opacity: 1; }
.step.done { opacity: 0.7; }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t);
}

.step.active .step-num {
    background: var(--primary);
    color: #fff;
}

.step.done .step-num {
    background: var(--green);
    color: #fff;
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.step.active .step-label {
    color: var(--text);
    font-weight: 600;
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 12px;
    border-radius: 2px;
    transition: background var(--t);
}

.step-line.done {
    background: var(--green);
}

/* ===================== SECTION ===================== */
.section {
    padding-bottom: 32px;
    animation: fadeUp 0.35s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================== SECTION GRID (Upload) ===================== */
.section-grid {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 24px;
    align-items: stretch;
    flex: 1;
}

/* ===================== CARDS ===================== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: border-color var(--t), box-shadow var(--t);
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-section {
    padding: 20px 24px;
}

.card-section:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-section:last-child .textarea {
    flex: 1;
    min-height: 120px;
}

.card-divider {
    height: 1px;
    background: var(--border);
}

.card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}

/* ===================== UPLOAD ZONE ===================== */
.card--upload {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-zone {
    margin: 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--t);
    background: var(--bg);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

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

.upload-icon-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 8px;
}

.upload-heading {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.upload-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.upload-link {
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

.upload-constraint {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* ===================== FILE ATTACHED ===================== */
.file-attached {
    padding: 20px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.file-chip-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-chip-info { flex: 1; min-width: 0; }

.file-chip-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip-meta {
    font-size: 11.5px;
    color: var(--text-muted);
}

.file-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--t);
    flex-shrink: 0;
}

.file-chip-remove:hover {
    color: var(--red);
    background: var(--red-bg);
}

/* ===================== SETTINGS CARD ===================== */
.card--settings {
    display: flex;
    flex-direction: column;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.setting-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.setting-desc {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

.prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.prompt-header .card-label { margin-bottom: 0; }

/* Toggle */
.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 22px;
    transition: background var(--t);
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--t);
    box-shadow: var(--shadow-xs);
}

.toggle input:checked + .toggle-track {
    background: var(--primary);
}

.toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(18px);
}

/* ===================== TEXTAREA ===================== */
.textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 12.5px;
    font-family: 'Poppins', sans-serif;
    line-height: 1.65;
    resize: vertical;
    min-height: 90px;
    transition: border-color var(--t), box-shadow var(--t);
}

.textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    background: var(--bg-white);
}

.textarea::placeholder { color: var(--text-muted); }

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    transition: all var(--t);
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(77,77,255,0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(77,77,255,0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--border-hover);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    padding: 0;
    transition: opacity var(--t);
}

.btn-text:hover { opacity: 0.7; }

/* ===================== PROCESSING ===================== */
.card--processing {
    padding: 40px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.proc-grid { display: flex; align-items: flex-start; gap: 48px; justify-content: center; flex-wrap: wrap; }

.proc-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; flex-shrink: 0; }
.proc-ring { position: relative; width: 140px; height: 140px; }
.proc-ring svg { display: block; }
.proc-ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--primary); }
.proc-ring-label { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; }

.proc-pipeline { min-width: 300px; max-width: 380px; }
.proc-pipeline-head { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.proc-pipeline-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.proc-pipeline-title { font-size: 13px; font-weight: 700; color: var(--text); }
.proc-pipeline-sub { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }

.proc-steps { display: flex; flex-direction: column; }

.proc-step { display: flex; align-items: flex-start; gap: 12px; position: relative; padding: 9px 0; }
.proc-step:not(:last-child)::after { content: ''; position: absolute; left: 9px; top: 30px; width: 1.5px; height: calc(100% - 14px); background: var(--border); transition: background .3s ease; }
.proc-step.done:not(:last-child)::after { background: var(--green); }

.proc-step-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-white); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; z-index: 1; transition: all .3s ease; }
.proc-step.active .proc-step-dot { border-color: var(--primary); background: var(--primary-bg); }
.proc-step.active .proc-step-dot::after { content: ''; width: 8px; height: 8px; border: 1.5px solid transparent; border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.proc-step.done .proc-step-dot { border-color: var(--green); background: var(--green); }
.proc-step.done .proc-step-dot svg { display: block; }
.proc-step:not(.done) .proc-step-dot svg { display: none; }

.proc-step-info { flex: 1; min-width: 0; padding-top: 1px; }
.proc-step-label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); transition: color .3s ease; }
.proc-step.active .proc-step-label { color: var(--text); font-weight: 600; }
.proc-step.done .proc-step-label { color: var(--text-secondary); }

.proc-step-tag { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; background: var(--bg); color: var(--text-muted); transition: all .3s ease; }
.proc-step.active .proc-step-tag { background: var(--primary-bg); color: var(--primary); }
.proc-step.done .proc-step-tag { background: var(--green-bg); color: var(--green); }

/* ===================== SUMMARY BAR ===================== */
.summary-bar {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 18px 28px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.summary-stat {
    display: flex;
    flex-direction: column;
}

.summary-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.summary-label {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

/* ===================== RESULTS LIST ===================== */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color var(--t), box-shadow var(--t);
}

.result-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.result-badge {
    padding: 2px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.result-body {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.result-img {
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--bg);
    border-right: 1px solid var(--border);
}

.result-img img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}

.result-texts {
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-block {}

.result-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.result-value {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-light);
}

/* ===================== TOAST ===================== */
.toast-container {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s ease;
    max-width: 400px;
}

.toast--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.toast--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
    .section-grid {
        grid-template-columns: 1fr;
    }

    .card--settings {
        order: 2;
    }

    .card--upload {
        order: 1;
    }

    .result-body {
        grid-template-columns: 1fr;
    }

    .result-img {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .proc-grid {
        flex-direction: column;
        text-align: center;
    }

    .summary-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .summary-actions {
        margin-left: 0;
        width: 100%;
    }

    .summary-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .header-inner { padding: 0 16px; }
    .footer-inner { padding: 0 16px; flex-direction: column; text-align: center; }
    .header-brand-sub { display: none; }

    .steps { gap: 0; padding: 20px 0 16px; }
    .step-label { display: none; }
    .step-line { width: 32px; margin: 0 8px; }

    .upload-zone { padding: 36px 20px; margin: 16px; }
    .card-section { padding: 16px; }

    .card--processing { padding: 32px 20px; }
    .proc-ring { width: 100px; height: 100px; }
    .proc-ring-pct { font-size: 20px; }

    .result-body { grid-template-columns: 1fr; }
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===================== SAMPLE DOCUMENT ===================== */
.hint {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 4px 0 12px;
}

.btn-sm {
    padding: 7px 13px;
    font-size: 12.5px;
}

.sample-doc {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--primary-bg);
}

.sample-doc-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.sample-doc-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sample-doc-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sample-doc-meta {
    font-size: 11.5px;
    color: var(--text-muted);
}

.sample-doc-actions {
    display: flex;
    gap: 9px;
    margin-top: 11px;
}

.sample-doc-actions .btn { flex: 1; justify-content: center; }

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    animation: modalFade var(--t);
}

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 780px;
    height: 82vh;
    max-height: 900px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalRise var(--t);
}

@keyframes modalRise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t);
}

.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body {
    flex: 1;
    min-height: 0;
    background: var(--bg);
}

.sample-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
    .modal { height: 88vh; }
    .modal-foot .btn { flex: 1; justify-content: center; }
}

/* ===================== PROCESSING OVERLAY (modal loader) ===================== */
.proc-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    animation: modalFade var(--t);
}

.proc-overlay .card--processing {
    flex: none;
    width: 100%;
    max-width: 640px;
    padding: 34px 32px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modalRise var(--t);
}

@media (max-width: 640px) {
    .proc-overlay { padding: 16px; }
    .proc-overlay .card--processing { padding: 26px 18px; }
}

/* ===================== HEADER "ALL PRODUCTS" LINK ===================== */
.header-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition: all var(--t);
}
.header-link:hover { color: var(--primary); border-color: var(--primary-light); background: var(--primary-bg); }
@media (max-width: 560px) { .header-link span { display: none; } }

/* ===================== AUTOMATED DEMO CONTROL BAR (NOUKHA HR SUITE) ===================== */
#demoBar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: rgba(11, 16, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 8px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(77, 77, 255, 0.2);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  transition: opacity 0.3s ease, transform 0.3s ease;
  width: max-content;
  max-width: 95vw;
}

#demoBar.hidden {
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
}

.hr-demo-bar-content {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  white-space: nowrap;
}

.hr-demo-left-status {
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  padding-right: 16px;
  white-space: nowrap;
}

.hr-demo-dot-emerald {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: hr-pulse 1.5s infinite;
  flex-shrink: 0;
}

.hr-demo-dot-amber {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  flex-shrink: 0;
}

@keyframes hr-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.hr-demo-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.hr-demo-title-row span {
  white-space: nowrap;
}

.hr-demo-sub-text {
  font-size: 11px;
  font-weight: 500;
  color: #cbd5e1;
  margin: 0;
  white-space: nowrap;
}

.hr-demo-timer-badge {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 5px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hr-demo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.hr-demo-btn {
  border: none;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.hr-demo-btn span {
  white-space: nowrap;
}

.hr-demo-btn-secondary {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hr-demo-btn-secondary:hover {
  background: rgba(51, 65, 85, 1);
  border-color: rgba(255, 255, 255, 0.3);
}

.hr-demo-btn-danger {
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
}

.hr-demo-btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

@media (max-width: 650px) {
  #demoBar {
    width: 92%;
    padding: 8px 12px;
    bottom: 16px;
  }
  .hr-demo-bar-content {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .hr-demo-left-status {
    border-right: none;
    padding-right: 0;
  }
}
