:root {
    --indigo: #2563eb;
    --indigo-hover: #1d4ed8;
    --indigo-light: #f0f6ff;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --green: #10b981;
    --green-light: #ecfdf5;
    --amber: #f59e0b;
    --amber-light: #fffbeb;
    --red: #ef4444;
    --red-light: #fef2f2;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Full-screen Loader ── */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.loader-content {
    padding: 2.5rem 1.5rem;
    max-width: 420px;
    width: 100%;
}

.modern-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--indigo);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

#loader-message {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

#loader-subtext {
    font-size: 0.88rem;
    color: var(--text-muted);
}

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

.hidden { display: none !important; }
.desktop-only { display: flex !important; }

/* ── Mobile Layout Fixes ── */
@media (max-width: 1024px) {
    .sidebar { display: none !important; }
    .desktop-only { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .dashboard-body { padding: 1rem !important; margin-top: 0 !important; margin-bottom: 100px !important; }
}

/* ── Sidebar (Hidden) ── */
.sidebar {
    display: none !important;
}
.brand { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--border); }
.brand-logo { width: 40px; height: 40px; border-radius: 8px; }
.brand h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; color: var(--indigo); }
.brand-tag { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }

.sidebar nav { flex: 1; padding: 1rem 0; }
.sidebar nav ul { list-style: none; }
.sidebar nav li {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar nav li:hover { color: var(--indigo); background: var(--indigo-light); }
.sidebar nav li.active { color: var(--indigo); background: var(--indigo-light); border-right: 3px solid var(--indigo); }
.nav-icon { font-size: 1.25rem; }

.sidebar-footer { padding: 1.5rem; border-top: 1px solid var(--border); }
.system-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.pulse-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } 100% { opacity: 1; transform: scale(1); } }

/* ── Mobile App Bar (Now Primary Header) ── */
.mobile-app-bar {
    display: flex;
    position: sticky;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
    box-shadow: var(--shadow-sm);
}
.app-bar-back { background: none; border: none; color: var(--text-main); padding: 0.5rem; cursor: pointer; }
.app-bar-brand { display: flex; align-items: center; gap: 0.75rem; }
.app-bar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: 6px; 
}
.app-bar-title { font-weight: 800; font-size: 1.1rem; color: var(--indigo); }

/* ── Step Indicator ── */
.step-indicator {
    padding: 1rem;
    margin-top: 60px;
    background: #fff;
}
.step-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 0.5rem; }
.step-fill { height: 100%; background: var(--indigo); width: 16.66%; transition: width 0.4s ease; }
.step-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Main Content Area ── */
.main-content {
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
}
.top-nav { height: 70px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 2.5rem; }
.nav-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.crumb.active { color: var(--text-main); font-weight: 700; }
.user-profile { background: var(--bg-body); padding: 0.5rem 1.25rem; border-radius: var(--radius-full); font-weight: 600; font-size: 0.85rem; border: 1px solid var(--border); }

.dashboard-body { padding: 2rem 2.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ── Common Section Styles ── */
section { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.section-header { margin-bottom: 2rem; }
.section-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem; 
}
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

/* ── Phase 1: App Type Grid ── */
.app-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.app-type-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.app-type-card:hover { border-color: var(--indigo); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-icon { 
    font-size: 2.2rem; 
    flex-shrink: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.card-content { display: flex; flex-direction: column; justify-content: center; flex: 1; }
.card-name { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.15rem; color: var(--text-main); }
.card-cat-count { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ── Phase 2: Workspace ── */
.phase-workspace { 
    padding-bottom: 120px; /* NEW: Ensure list isn't hidden behind bottom bar */
}
.workspace-header { margin-bottom: 2rem; }
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.btn-back { background: none; border: 1px solid var(--border); padding: 0.5rem 1rem; border-radius: var(--radius-md); font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-back:hover { background: var(--bg-body); }
.workspace-title h1 { font-size: 1.5rem; font-weight: 800; }
.workspace-title .subtitle { font-size: 0.95rem; color: var(--text-muted); }

.upload-instruction-text {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 600;
    margin: 1.5rem 0 2rem;
    text-align: center;
    padding: 1rem;
    background: var(--indigo-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--indigo);
}

/* Direct Enclosure List (No Box) */
.consent-doc-list-direct {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
    padding: 0;
}

.consent-doc-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    animation: slideInUp 0.3s ease;
}

.consent-doc-number {
    width: 32px;
    height: 32px;
    background: var(--indigo);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.consent-doc-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.consent-doc-tag {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.consent-doc-tag.required {
    background: var(--red-light);
    color: var(--red);
}

.consent-doc-tag.optional {
    background: var(--bg-body);
    color: var(--text-muted);
}

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

/* Premium AI Scanning Loader */
.ai-scanning-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    border: 1px solid #bae6fd;
}

.ai-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.ai-loader-animation {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-loader-ring {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: aiSpin 2s linear infinite;
}

.ai-loader-ring:nth-child(1) {
    width: 120px;
    height: 120px;
    border-top-color: #2563eb;
    animation-duration: 2s;
}

.ai-loader-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    border-right-color: #10b981;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.ai-loader-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    border-bottom-color: #6366f1;
    animation-duration: 1s;
}

.ai-loader-core {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 1;
    animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes aiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ai-loader-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Document Upload Rows */
.document-upload-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.document-upload-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    animation: slideInLeft 0.5s ease;
}

.document-upload-row.processing {
    border-color: var(--indigo);
    background: var(--indigo-light);
}

.document-upload-row.completed {
    border-color: var(--green);
    background: var(--green-light);
}

.doc-row-preview {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.doc-row-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.doc-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.doc-row-filename {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.doc-row-status {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-row-status.verified {
    color: var(--green);
}

.doc-row-status.completed {
    color: var(--green);
}

.doc-row-status.error {
    color: var(--red);
}

.doc-row-checkmark {
    font-size: 1.1rem;
    animation: checkmarkPop 0.3s ease-out;
}

.doc-row-error {
    font-size: 1.1rem;
}

@keyframes checkmarkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.doc-row-animation {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.doc-row-animation.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Validation Error Modal */
.validation-modal-card {
    max-width: 400px;
    text-align: center;
}

.validation-modal-header {
    margin-bottom: 2rem;
}

.validation-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.validation-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.validation-modal-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.workspace-progress { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    background: #fff; 
    padding: 0.85rem 1.5rem; 
    border-radius: var(--radius-full); 
    border: 1px solid var(--border);
    min-width: 160px;
}

.progress-ring { 
    position: relative; 
    width: 60px; 
    height: 60px; 
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring svg { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.progress-ring #progress-ring-static {
    transform: rotate(-90deg);
}

.progress-ring .pl {
    width: 100%;
    height: 100%;
    display: none;
}

.progress-ring .pl.active {
    display: block;
}

.ring-bg { 
    fill: none; 
    stroke: #e2e8f0; 
    stroke-width: 4; 
}

.ring-fill { 
    fill: none; 
    stroke: var(--green); 
    stroke-width: 4; 
    stroke-linecap: round; 
    stroke-dasharray: 163.36; 
    stroke-dashoffset: 163.36; 
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1); 
}

.ring-text { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    font-size: 0.7rem; 
    font-weight: 800; 
    color: var(--text-main); 
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
}

.progress-count {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    line-height: 1;
}

.count-verified { 
    font-size: 1.5rem; 
    font-weight: 900; 
    color: var(--green); 
}

.count-separator {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.count-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.count-label { 
    font-size: 0.75rem; 
    font-weight: 600; 
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile adjustments for workspace progress */
@media (max-width: 768px) {
    .workspace-progress {
        padding: 0.75rem 1.25rem;
        min-width: 140px;
    }
    
    .progress-ring {
        width: 50px;
        height: 50px;
    }
    
    .count-verified {
        font-size: 1.35rem;
    }
    
    .count-separator,
    .count-total {
        font-size: 1.15rem;
    }
    
    .count-label {
        font-size: 0.7rem;
    }
}

/* Bulk Upload Zone */
.bulk-upload-zone {
    background: var(--indigo-light);
    border: 2px dashed var(--indigo);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    transition: all 0.2s;
    margin-top: 1rem;
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .bulk-upload-zone {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 1.5rem 2rem;
    }
    .bulk-upload-inner { flex-direction: row; text-align: left; }
}
.bulk-upload-inner { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.bulk-upload-icon { font-size: 2rem; }
.bulk-upload-text strong { font-size: 1.1rem; display: block; margin-bottom: 0.25rem; }
.bulk-upload-text p { color: var(--text-muted); font-size: 0.85rem; }
.bulk-note { font-size: 0.75rem; font-weight: 700; color: var(--indigo); margin-top: 0.25rem; }
.btn-upload-bulk { background: var(--indigo); color: #fff; padding: 0.75rem 1.5rem; border-radius: var(--radius-full); font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: all 0.2s; box-shadow: var(--shadow-md); white-space: nowrap; }
.btn-upload-bulk:hover { background: var(--indigo-hover); transform: translateY(-2px); }

/* Mobile Optimizations */
@media (max-width: 768px) {
    .dashboard-body { 
        padding: 1rem !important; 
        margin-top: 0 !important; 
        margin-bottom: 100px !important; 
    }
    
    .consent-doc-item {
        padding: 0.85rem;
        gap: 0.75rem;
    }
    
    .consent-doc-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .consent-doc-name {
        font-size: 0.9rem;
    }
    
    .document-upload-row {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .doc-row-preview,
    .doc-row-icon {
        width: 50px;
        height: 50px;
    }
    
    .doc-row-filename {
        font-size: 0.9rem;
    }
    
    .ai-loader-animation {
        width: 100px;
        height: 100px;
    }
    
    .ai-loader-ring:nth-child(1) {
        width: 100px;
        height: 100px;
    }
    
    .ai-loader-ring:nth-child(2) {
        width: 75px;
        height: 75px;
    }
    
    .ai-loader-ring:nth-child(3) {
        width: 50px;
        height: 50px;
    }
    
    .ai-loader-core {
        width: 35px;
        height: 35px;
    }
    
    .bulk-upload-zone {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .upload-instruction-text {
        font-size: 0.9rem;
        padding: 0.75rem;
        margin: 1rem 0 1.5rem;
    }
}

/* ── Phase 4: Media Capture ── */
.media-capture-container { max-width: 500px; margin: 0 auto; }
.media-step-header { text-align: center; margin-bottom: 2rem; }
.step-icon-circle { width: 80px; height: 80px; background: var(--indigo-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 1.5rem; }
.media-step-header h2 { font-size: 1.75rem; font-weight: 900; margin-bottom: 0.5rem; }
.media-step-header p { color: var(--text-muted); }

.photo-guidelines { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 2rem; }
.guideline-title { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--indigo); margin-bottom: 1rem; }
.guideline-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.guideline-list li { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; font-weight: 500; }
.guide-check { color: var(--green); font-weight: 900; }
.guide-cross { color: var(--red); font-weight: 900; }

.media-capture-zone {
    background: #fff;
    border: 3px dashed var(--border);
    border-radius: var(--radius-lg);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    transition: all 0.2s;
}
.media-capture-zone:hover { border-color: var(--indigo); background: var(--indigo-light); }
.capture-placeholder { text-align: center; color: var(--text-muted); }
.capture-icon { font-size: 3rem; margin-bottom: 1rem; }
.capture-placeholder p { font-weight: 700; margin-bottom: 0.25rem; }
.capture-hint { font-size: 0.75rem; opacity: 0.8; }

.capture-preview-container { width: 100%; height: 100%; position: relative; }
.capture-preview-img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-circle { border-radius: 50%; border: 4px solid #fff; box-shadow: var(--shadow-lg); margin: auto; max-width: 80%; max-height: 80%; }
.ai-verify-status { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); color: #fff; padding: 0.5rem 1rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; backdrop-filter: blur(4px); white-space: nowrap; }

.capture-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.btn-capture-upload, .btn-capture-camera { background: #fff; border: 1px solid var(--border); padding: 1rem; border-radius: var(--radius-md); font-weight: 700; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.75rem; transition: all 0.2s; }
.btn-capture-upload:hover, .btn-capture-camera:hover { border-color: var(--indigo); color: var(--indigo); }

.btn-full { width: 100%; }
.btn-primary { background: var(--indigo); color: #fff; padding: 1rem 2rem; border-radius: var(--radius-full); font-weight: 800; border: none; cursor: pointer; transition: all 0.3s; box-shadow: var(--shadow-md); font-size: 1rem; }
.btn-primary:hover { background: var(--indigo-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); box-shadow: none; transform: none; cursor: not-allowed; }

/* Signature Specific */
.sig-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--border); padding: 4px; border-radius: var(--radius-md); margin-bottom: 2rem; }
.sig-tab { background: none; border: none; padding: 0.75rem; font-weight: 700; font-size: 0.85rem; border-radius: 8px; cursor: pointer; transition: all 0.2s; color: var(--text-muted); }
.sig-tab.active { background: #fff; color: var(--indigo); box-shadow: var(--shadow-sm); }
.sig-zone { aspect-ratio: 2/1; }
.sig-canvas-wrapper { background: #fff; border: 2px solid var(--border); border-radius: var(--radius-md); position: relative; margin-bottom: 1.5rem; touch-action: none; }
.sig-canvas { width: 100%; height: 200px; display: block; }
.sig-canvas-hint { position: absolute; bottom: 0.5rem; right: 1rem; font-size: 0.7rem; color: var(--text-muted); font-weight: 600; pointer-events: none; }
.sig-draw-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-bottom: 2rem; }
.btn-outline { background: none; border: 1px solid var(--border); padding: 0.75rem 1.5rem; border-radius: var(--radius-full); font-weight: 700; cursor: pointer; }
.btn-text-link { background: none; border: none; color: var(--text-muted); font-weight: 600; font-size: 0.85rem; cursor: pointer; display: block; margin: 1rem auto; text-decoration: underline; }

/* ── Phase 5: Missing Fields ── */
.missing-fields-list { display: flex; flex-direction: column; gap: 1.5rem; max-width: 600px; margin: 0 auto 3rem; }
.missing-field-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.field-label-group { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.field-label { font-weight: 800; font-size: 0.85rem; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.5px; }
.field-badge { font-size: 0.65rem; font-weight: 800; padding: 0.25rem 0.6rem; border-radius: 4px; text-transform: uppercase; }
.field-badge.required { background: var(--red-light); color: var(--red); }
.field-badge.optional { background: var(--bg-body); color: var(--text-muted); }
.field-input { width: 100%; padding: 1rem; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: 1rem; font-weight: 500; transition: all 0.2s; }
.field-input:focus { border-color: var(--indigo); outline: none; background: #fff; }

/* ── Phase 6: Final Preview ── */
.preview-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.btn-edit-toggle { background: #fff; border: 1px solid var(--border); padding: 0.75rem 1.5rem; border-radius: var(--radius-full); font-weight: 700; font-size: 0.9rem; cursor: pointer; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 0.5rem; }
.btn-edit-toggle:hover { border-color: var(--indigo); color: var(--indigo); }

.preview-card-hero { background: var(--indigo); color: #fff; border-radius: var(--radius-lg); padding: 2.5rem; display: flex; align-items: center; gap: 2.5rem; margin-bottom: 2.5rem; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.preview-card-hero::before { content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px; background: rgba(255,255,255,0.1); border-radius: 50%; pointer-events: none; }

.preview-hero-photo { width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; border: 4px solid rgba(255,255,255,0.3); }
.hero-photo-circle { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hero-photo-placeholder { font-size: 3.5rem; opacity: 0.5; }

.preview-hero-info { flex: 1; }
.preview-name { font-size: 2rem; font-weight: 900; letter-spacing: -0.5px; margin-bottom: 0.5rem; }
.preview-category-badge { display: inline-block; background: rgba(255,255,255,0.2); padding: 0.4rem 1rem; border-radius: var(--radius-full); font-size: 0.85rem; font-weight: 700; backdrop-filter: blur(4px); }

.preview-sig-mini { margin-top: 1.5rem; background: rgba(255,255,255,0.1); padding: 1rem; border-radius: var(--radius-md); display: inline-flex; flex-direction: column; gap: 0.5rem; border: 1px solid rgba(255,255,255,0.1); }
.preview-sig-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; opacity: 0.7; }
.preview-sig-img { height: 40px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.9; }

.preview-form-sections { display: flex; flex-direction: column; gap: 2rem; }
.preview-section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.preview-section-title { background: var(--bg-body); padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--indigo); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; padding: 1.5rem; }
.preview-item { display: flex; flex-direction: column; gap: 0.25rem; }
.preview-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.preview-value { font-size: 1rem; font-weight: 600; color: var(--text-main); }
.preview-value.locked { color: var(--text-main); }
.preview-value.unlocked input { width: 100%; border: 1px solid var(--indigo); border-radius: 4px; padding: 2px 8px; font-size: 1rem; font-family: inherit; font-weight: 600; }

.preview-declaration { margin-top: 3rem; background: #fff; padding: 2rem; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.declaration-checkbox-wrap { display: flex; gap: 1.25rem; cursor: pointer; align-items: flex-start; }
.declaration-text { font-size: 0.95rem; font-weight: 500; color: var(--text-main); line-height: 1.6; }
.btn-payment { margin-top: 2rem; background: #000 !important; font-size: 1.25rem !important; }
.payment-note { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 1rem; font-weight: 500; }

/* ── Completion Screen ── */
.completion-screen { text-align: center; padding: 4rem 2rem; }
.completion-animation { width: 100px; height: 100px; background: var(--green); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 4rem; margin: 0 auto 2rem; animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.completion-ref { background: var(--bg-body); padding: 1rem 2rem; border-radius: var(--radius-md); font-weight: 800; font-size: 1.25rem; color: var(--indigo); margin: 2rem 0; font-family: var(--mono); }

/* ── Sticky Action Bar (Mobile) ── */
.sticky-action-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 1rem 1rem calc(1rem + var(--safe-bottom));
    z-index: 1002;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}
.sticky-bar-progress { height: 3px; background: var(--border); position: absolute; top: 0; left: 0; right: 0; }
.sticky-bar-fill { height: 100%; background: var(--indigo); width: 16.66%; transition: width 0.4s ease; }
.sticky-bar-content { display: flex; align-items: center; justify-content: space-between; }
.sticky-bar-info { display: flex; flex-direction: column; }
.sticky-bar-label { font-weight: 800; font-size: 1rem; }
.sticky-bar-step { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.sticky-bar-btn { background: var(--indigo); color: #fff; border: none; padding: 0.75rem 1.75rem; border-radius: var(--radius-full); font-weight: 800; cursor: pointer; }

/* ── Verification Portal (Full-screen Loader) ── */
.verification-portal {
    background: rgba(255, 255, 255, 0.85);
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.portal-header {
    margin-bottom: 2rem;
}

.portal-title-small {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.portal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.portal-progress-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.svg-loader-container {
    margin: 1.5rem 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-message-static {
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: -0.01em;
    animation: pulseMessage 2s ease-in-out infinite;
}

@keyframes pulseMessage {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* From Uiverse.io by Nawsome */
.pl {
    width: 6em;
    height: 6em;
    display: block;
}

.pl__ring {
    animation: ringA 2s linear infinite;
}

.pl__ring--a {
    stroke: #f42f25;
}

.pl__ring--b {
    animation-name: ringB;
    stroke: #f49725;
}

.pl__ring--c {
    animation-name: ringC;
    stroke: #255ff4;
}

.pl__ring--d {
    animation-name: ringD;
    stroke: #f42582;
}

/* Mobile-friendly loader size */
@media (max-width: 768px) {
    .pl {
        width: 5em;
        height: 5em;
    }
}

/* Animations */
@keyframes ringA {
    from, 4% {
        stroke-dasharray: 0 660;
        stroke-width: 20;
        stroke-dashoffset: -330;
    }
    12% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -335;
    }
    32% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -595;
    }
    40%, 54% {
        stroke-dasharray: 0 660;
        stroke-width: 20;
        stroke-dashoffset: -660;
    }
    62% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -665;
    }
    82% {
        stroke-dasharray: 60 600;
        stroke-width: 30;
        stroke-dashoffset: -925;
    }
    90%, to {
        stroke-dasharray: 0 660;
        stroke-width: 20;
        stroke-dashoffset: -990;
    }
}

@keyframes ringB {
    from, 12% {
        stroke-dasharray: 0 220;
        stroke-width: 20;
        stroke-dashoffset: -110;
    }
    20% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -115;
    }
    40% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -195;
    }
    48%, 62% {
        stroke-dasharray: 0 220;
        stroke-width: 20;
        stroke-dashoffset: -220;
    }
    70% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -225;
    }
    90% {
        stroke-dasharray: 20 200;
        stroke-width: 30;
        stroke-dashoffset: -305;
    }
    98%, to {
        stroke-dasharray: 0 220;
        stroke-width: 20;
        stroke-dashoffset: -330;
    }
}

@keyframes ringC {
    from {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: 0;
    }
    8% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -5;
    }
    28% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -175;
    }
    36%, 58% {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -220;
    }
    66% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -225;
    }
    86% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -395;
    }
    94%, to {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -440;
    }
}

@keyframes ringD {
    from, 8% {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: 0;
    }
    16% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -5;
    }
    36% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -175;
    }
    44%, 50% {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -220;
    }
    58% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -225;
    }
    78% {
        stroke-dasharray: 40 400;
        stroke-width: 30;
        stroke-dashoffset: -395;
    }
    86%, to {
        stroke-dasharray: 0 440;
        stroke-width: 20;
        stroke-dashoffset: -440;
    }
}

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.4); backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.bottom-sheet-card {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    position: relative;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    animation: sheetUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (max-width: 768px) {
    .modal-overlay { 
        align-items: flex-end; 
        padding: 0; 
        background: rgba(15,23,42,0.6);
    }
    
    .bottom-sheet-card { 
        border-radius: 24px 24px 0 0; 
        max-width: none; 
        padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bottom));
    }
    
    .bottom-sheet-handle { 
        width: 40px; 
        height: 5px; 
        background: var(--border); 
        border-radius: 10px; 
        margin: -0.75rem auto 1rem; 
    }
    
    .modal-header {
        margin-bottom: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.35rem;
    }
    
    .modal-header p {
        font-size: 0.95rem;
    }
    
    .modal-icon {
        font-size: 2.5rem;
    }
}

.modal-close { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.modal-header { text-align: center; margin-bottom: 2rem; }
.modal-icon { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.modal-header h2 { font-size: 1.65rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.75rem; color: var(--text-main); }
.modal-header p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.5; font-weight: 500; }

/* Typing animation for conversational AI */
.typing-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 10px 0;
}
.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--indigo);
    border-radius: 50%;
    opacity: 0.3;
    animation: typingPulse 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 1; }
}

.category-list { display: flex; flex-direction: column; gap: 0.75rem; }
.category-btn { background: var(--bg-body); border: 1px solid var(--border); padding: 1.25rem; border-radius: var(--radius-md); text-align: left; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; }
.category-btn:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-light); }

/* ── AI Toast ── */
.ai-toast { 
    position: fixed; 
    bottom: 120px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: #fff; 
    color: var(--text-main); 
    padding: 1rem 1.5rem; 
    border-radius: var(--radius-lg); 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    z-index: 3000; 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); 
    font-size: 0.95rem; 
    font-weight: 600; 
    animation: slideInUp 0.3s ease;
    border: 1px solid var(--border);
    max-width: 90%;
}

.ai-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ai-toast-text {
    line-height: 1.4;
}

@keyframes slideInUp { 
    from { transform: translate(-50%, 20px); opacity: 0; } 
    to { transform: translate(-50%, 0); opacity: 1; } 
}

/* Mobile Toast Adjustments */
@media (max-width: 768px) {
    .ai-toast {
        bottom: 100px;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        max-width: 85%;
    }
    
    .ai-toast-icon {
        font-size: 1.1rem;
    }
}

/* ── Lightbox Sheet ── */
.lightbox-sheet { max-width: 900px; max-height: 90vh; display: flex; flex-direction: column; }
.lightbox-body { display: grid; grid-template-columns: 1fr 300px; overflow: hidden; height: 70vh; }
.lightbox-image-wrapper { background: #0f172a; display: flex; align-items: center; justify-content: center; padding: 1rem; overflow: auto; }
.lightbox-image-wrapper img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-info { padding: 2rem; border-left: 1px solid var(--border); overflow-y: auto; background: var(--bg-body); }

@media (max-width: 768px) {
    .lightbox-body { grid-template-columns: 1fr; }
    .lightbox-info { border-left: none; border-top: 1px solid var(--border); }
}

/* ── Validation Modal ── */
.validation-card { 
    border-top: 5px solid var(--amber); 
    display: flex; 
    flex-direction: column; 
    max-height: 85vh; 
    padding-bottom: 1.5rem;
}

.validation-icon-ring { 
    width: 60px; 
    height: 60px; 
    background: var(--amber-light); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
    flex-shrink: 0;
}

.validation-error-list { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    margin: 1rem 0; 
    text-align: left; 
    overflow-y: auto; 
    flex: 1; 
    padding: 0.5rem;
    max-height: 60vh;
}

.validation-list { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    margin: 1rem 0; 
    text-align: left; 
    overflow-y: auto; 
    flex: 1; 
    padding: 0.5rem;
}

.validation-item { 
    display: flex; 
    gap: 0.75rem; 
    background: var(--bg-body); 
    padding: 1rem; 
    border-radius: var(--radius-md);
    border-left: 3px solid var(--amber);
}

.val-bullet { 
    font-size: 1rem; 
}

.val-text { 
    font-size: 0.9rem; 
    font-weight: 500; 
    color: var(--text-main); 
    line-height: 1.4; 
}

.val-text b { 
    font-weight: 800; 
    color: var(--indigo); 
}

/* Validation Group Styles */
.val-group {
    margin-bottom: 1.5rem;
}

.val-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.val-group-icon {
    font-size: 1.25rem;
}

.val-group-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.val-group-body {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-body);
}

.val-group-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.val-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.val-sub-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #fff;
    border-radius: var(--radius-sm);
}

.val-sub-bullet {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.val-sub-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
}

.val-docs-bg {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.val-fields-bg {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.val-other-bg {
    background: var(--indigo-light);
    border: 1px solid #bfdbfe;
}

.modal-footer { 
    margin-top: 1rem; 
    padding-top: 1rem; 
    border-top: 1px solid var(--border); 
    background: #fff;
    flex-shrink: 0;
}

/* Mobile Validation Modal Adjustments */
@media (max-width: 768px) {
    .validation-card {
        max-height: 80vh;
        padding: 1.25rem;
    }
    
    .validation-icon-ring {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    
    .validation-error-list {
        max-height: 50vh;
        font-size: 0.875rem;
    }
    
    .val-group-header {
        gap: 0.5rem;
    }
    
    .val-group-icon {
        font-size: 1.1rem;
    }
    
    .val-group-title {
        font-size: 0.95rem;
    }
    
    .val-group-body {
        padding: 0.75rem;
    }
    
    .val-sub-text {
        font-size: 0.85rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-header p {
        font-size: 0.875rem;
    }
}

/* --- Document Previews & Badges --- */
.slot-preview-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-preview-wrapper:hover {
    transform: scale(1.05);
    border-color: #4f46e5;
}

.slot-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slot-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #cbd5e1;
}

.verified-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(4px);
    animation: fadeInScale 0.3s ease-out;
}

.verified-badge::before {
    content: '✓';
    font-size: 10px;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Full Preview Modal Enhancements */
.preview-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.preview-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.preview-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.preview-modal-overlay.active .preview-modal-content {
    transform: translateY(0);
}

.preview-modal-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.preview-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border: none;
}

.preview-modal-footer {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-modal-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 16px;
}

.preview-modal-pdf {
    width: 100%;
    min-width: 600px;
    height: 75vh;
    border: none;
    border-radius: 12px;
    display: block;
}

@media (max-width: 768px) {
    .preview-modal-pdf {
        min-width: 100%;
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .slot-preview-wrapper {
        width: 50px;
        height: 50px;
    }
}

/* --- Unrecognized Documents Gallery --- */
.unrecognized-gallery {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 24px;
    animation: slideUp 0.4s ease-out;
}

.unrecognized-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.unrecognized-icon {
    font-size: 2.5rem;
    background: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.unrecognized-info h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
}

.unrecognized-info p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.unrecognized-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
}

.unmatched-card {
    background: white;
    padding: 0.75rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: transform 0.2s;
}

.unmatched-card:hover {
    transform: translateY(-4px);
}

.unmatched-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.unmatched-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════════════════
   PHOTO VERIFICATION MODAL
   ════════════════════════════════════════════════════════════ */
.photo-modal-overlay {
    z-index: 2500;
    align-items: flex-end; /* Mobile bottom sheet style */
    padding: 0;
}

.photo-modal-container {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
    margin: 0 auto;
}

@media (min-width: 768px) {
    .photo-modal-overlay {
        align-items: center;
        padding: 1rem;
    }
    .photo-modal-container {
        border-radius: 24px;
    }
}

.photo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.btn-close-modal {
    background: var(--bg-body);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.photo-modal-instruction {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    padding: 12px 16px;
    border-radius: 12px;
}

.instruction-icon {
    font-size: 20px;
}

.instruction-text {
    font-size: 14px;
    line-height: 1.4;
    color: #92400e;
}

.photo-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.photo-modal-preview-zone {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4; /* Passport proportion */
    max-height: 45vh; /* Keep it from taking over the entire screen on mobile */
    background: var(--bg-body);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
}

.photo-modal-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
}

.photo-modal-placeholder .camera-icon {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.photo-modal-preview-zone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Eye-Catching Scanner Overlay */
.photo-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.scanner-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #3b82f6;
    box-shadow: 0 0 15px 5px rgba(59, 130, 246, 0.5);
    animation: scan 2s infinite ease-in-out;
}

@keyframes scan {
    0% { top: 0%; }
    50% { top: calc(100% - 4px); }
    100% { top: 0%; }
}

.scanner-text {
    color: white;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    animation: pulseText 1.5s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.photo-modal-result {
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    justify-content: center;
}

.photo-modal-result.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.photo-modal-result.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.photo-modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-direction: column; /* Stack buttons vertically on mobile */
}

@media (min-width: 768px) {
    .photo-modal-footer {
        flex-direction: row; /* Side-by-side on desktop */
    }
}

.btn-primary, .btn-secondary {
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-block;
}

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

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

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-full {
    width: 100%;
}
.upload-instruction-text { 
    font-size: 0.68rem; 
    color: var(--text-muted); 
    white-space: nowrap; 
    text-align: center; 
    margin-top: 1.25rem; 
    margin-bottom: 0.5rem; 
    font-weight: 700;
    letter-spacing: -0.02em;
    width: 100%;
    overflow: visible;
}

.btn-remove-doc {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fff;
    color: #ef4444;
    border: 1px solid #fee2e2;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    opacity: 0;
    transform: scale(0.5);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
    to { opacity: 1; transform: scale(1); }
}

.btn-remove-doc:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
}

.btn-remove-doc:hover {
    background: #f87171;
    color: white;
}

.btn-faded {
    opacity: 0.5 !important;
    cursor: not-allowed;
}

.optional-tag {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 4px;
}

.required-sign {
    color: #ef4444;
    font-weight: 900;
    margin-left: 4px;
}

.sticky-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sticky-bar-back {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.sticky-bar-back:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.validation-error-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.validation-item {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.val-bullet {
    font-size: 1.2rem;
}

.val-text {
    color: #991b1b;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-card {
    border: 2px solid #fee2e2;
}

.alert-icon {
    color: #ef4444;
    background: #fef2f2;
}

/* ════════════════════════════════════════════════════════════
   REAL-TIME CHAT PANEL — WhatsApp-style Missing Doc Resolution
   ════════════════════════════════════════════════════════════ */
.chat-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.12), 0 2px 8px rgba(0,0,0,0.06);
    animation: chatSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

.chat-panel.minimized .chat-messages,
.chat-panel.minimized .chat-input-area {
    display: none;
}

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

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #fff;
    cursor: pointer;
}

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

.chat-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar-icon {
    font-size: 1.3rem;
}

.chat-avatar-pulse {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #4f46e5;
    animation: pulse 2s infinite;
}

.chat-title {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.chat-status {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 500;
}

.chat-minimize {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-minimize:hover {
    background: rgba(255,255,255,0.3);
}

.chat-panel.minimized .chat-minimize svg {
    transform: rotate(180deg);
}

/* Chat Messages Container */
.chat-messages {
    max-height: 420px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.5;
    font-weight: 500;
    animation: bubbleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    word-wrap: break-word;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.bot {
    background: #fff;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.chat-bubble.user {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-bubble.system {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.8rem;
    text-align: center;
    align-self: center;
    max-width: 95%;
    border-radius: 12px;
    padding: 8px 14px;
}

.chat-bubble.success-msg {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.8rem;
    text-align: center;
    align-self: center;
    max-width: 95%;
    border-radius: 12px;
    padding: 8px 14px;
}

/* Bot label */
.chat-bot-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--indigo);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Document name highlight */
.chat-doc-name {
    display: inline-block;
    background: var(--indigo-light);
    color: var(--indigo);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    margin-top: 6px;
}

/* Chat Action Buttons */
.chat-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chat-action-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-action-btn.primary {
    background: var(--indigo);
    color: #fff;
}
.chat-action-btn.primary:hover {
    background: var(--indigo-hover);
    transform: translateY(-1px);
}

.chat-action-btn.secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border);
}
.chat-action-btn.secondary:hover {
    background: #e2e8f0;
}

.chat-action-btn.danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.chat-action-btn.danger:hover {
    background: #fee2e2;
}

.chat-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Inline Upload Widget inside Chat */
.chat-upload-widget {
    background: #fff;
    border: 2px dashed var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-top: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-upload-widget:hover {
    border-color: var(--indigo);
    background: var(--indigo-light);
}

.chat-upload-widget label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
}

.chat-upload-widget .upload-icon {
    font-size: 1.5rem;
}

.chat-upload-preview {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: 10px;
    margin-top: 8px;
    border: 1px solid var(--border);
}

/* Chat inline verification status */
.chat-verify-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 8px;
}

.chat-verify-status.verifying {
    background: var(--indigo-light);
    color: var(--indigo);
}

.chat-verify-status.verified {
    background: #ecfdf5;
    color: #059669;
}

.chat-verify-status.failed {
    background: #fef2f2;
    color: #dc2626;
}

.chat-verify-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--indigo-light);
    border-top: 2px solid var(--indigo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Chat Input Area */
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.chat-reason-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--font);
    resize: none;
    transition: border-color 0.2s;
}

.chat-reason-input:focus {
    border-color: var(--indigo);
    outline: none;
}

.chat-input-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

/* Typing Indicator */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    animation: bubbleIn 0.3s ease;
}

.chat-typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--indigo);
    border-radius: 50%;
    opacity: 0.4;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* Progress bar inside chat */
.chat-progress-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    align-self: center;
    width: 100%;
    max-width: 95%;
    margin: 4px 0;
}

.chat-progress-track {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.chat-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--indigo), #818cf8);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.chat-progress-text {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Alternative suggestions inside chat */
.chat-alternatives {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.chat-alt-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.chat-alt-item strong {
    color: var(--indigo);
    font-size: 0.78rem;
}

.chat-alt-item p {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin: 2px 0 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-messages {
        max-height: 350px;
    }
    .chat-bubble {
        max-width: 92%;
        font-size: 0.85rem;
    }
}

/* ─── Grouped Validation Modal Styles ─── */
.val-group {
    margin-bottom: 1.25rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.01);
    border: 1px solid var(--border);
    background: #fff;
    transition: all 0.3s ease;
}

.val-group:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.val-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
}

.val-group-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.val-group-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.75px;
}

.val-group-body {
    padding: 1rem 1.25rem;
}

.val-group-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.val-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.val-sub-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.val-sub-bullet {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.val-sub-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.val-sub-text b {
    font-weight: 800;
    color: var(--indigo);
}

/* Premium Light Colored Category Backgrounds */
.val-docs-bg {
    background: linear-gradient(to right, #fef2f2, #fff5f5); /* Soft rose pink */
    border-left: 4px solid var(--red) !important;
}

.val-fields-bg {
    background: linear-gradient(to right, #fffbeb, #fffbeb); /* Warm golden cream */
    border-left: 4px solid var(--amber) !important;
}

.val-other-bg {
    background: linear-gradient(to right, #eef2ff, #f5f7ff); /* Soft lavender indigo */
    border-left: 4px solid var(--indigo) !important;
}

/* ════════════════════════════════════════════════════════════
   APPLICATION PREVIEW PAGE — Premium Structured White Sheet
   ════════════════════════════════════════════════════════════ */
#phase-final-preview {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    #phase-final-preview {
        padding: 20px 16px;
        border-radius: 16px;
        border: none;
        box-shadow: none;
    }
}

.preview-header {
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1.5rem;
    position: relative;
}

.preview-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 6px 0;
    letter-spacing: -0.03em;
}

.preview-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-edit-toggle {
    margin-top: 1rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: var(--indigo);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-edit-toggle:hover {
    background: var(--indigo);
    color: white;
    border-color: var(--indigo);
}

.btn-edit-toggle.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* Premium Applicant Sheet Header Card */
.preview-card-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 2.5rem;
}

@media (max-width: 576px) {
    .preview-card-hero {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }
}

.preview-hero-photo {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.hero-photo-circle {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #e2e8f0;
    color: #94a3b8;
}

.preview-hero-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.preview-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.preview-category-badge {
    align-self: flex-start;
    background: var(--indigo);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 576px) {
    .preview-category-badge {
        align-self: center;
    }
}

/* Mini Signature Preview in Hero */
.preview-sig-mini {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: flex-start;
}

@media (max-width: 576px) {
    .preview-sig-mini {
        align-self: center;
    }
}

.preview-sig-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-sig-img {
    height: 50px;
    object-fit: contain;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 8px;
    max-width: 150px;
}

/* Preview Form Sections List */
.preview-form-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.preview-section {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.preview-section-title {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
}

@media (max-width: 768px) {
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.preview-value.unlocked {
    background: #fff;
    border: 1.5px solid var(--indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.preview-value input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    padding: 0;
}

/* Premium Declaration and Checkbox Section */
.preview-declaration {
    margin-top: 2.5rem;
    padding: 20px;
    background: #f5f7ff;
    border: 1px solid #e0e7ff;
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.declaration-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    width: 100%;
}

.declaration-checkbox-wrap input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--indigo);
    cursor: pointer;
    flex-shrink: 0;
}

.declaration-text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-main);
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════
   PREMIUM PAYMENT RECEIPT & ATTESTED COPY STYLES
   ════════════════════════════════════════════════════════════ */
.receipt-container {
    margin: 2.5rem 0;
    text-align: left;
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.completion-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 2rem;
    width: 100%;
}

@media (max-width: 576px) {
    .completion-actions {
        flex-direction: column;
        align-items: center;
    }
    .completion-actions button {
        width: 100%;
        max-width: 320px;
    }
}

.attested-receipt-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 32px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    overflow: hidden;
    font-family: var(--font);
    color: var(--text-main);
}

/* Attestation Ribbon */
.attestation-ribbon {
    position: absolute;
    top: 25px;
    right: -45px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 6px 45px;
    transform: rotate(45deg);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    text-align: center;
    z-index: 10;
}

/* Header */
.receipt-card-header {
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.receipt-emblem {
    font-size: 2.2rem;
    background: #f0fdf4;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid #bbf7d0;
}

.receipt-title-block h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.2px;
}

.receipt-title-block p {
    margin: 2px 0 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.attested-tag {
    display: inline-block;
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 6px;
    letter-spacing: 0.5px;
    border: 1px solid #a7f3d0;
}

/* Attestation Seal */
.attestation-stamp-section {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.attestation-seal-gold {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #fcd34d 0%, #fbbf24 100%);
    border: 2px dashed #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(251, 191, 36, 0.25);
    flex-shrink: 0;
}

.seal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.seal-icon {
    font-size: 1.1rem;
}

.seal-text {
    font-size: 0.5rem;
    font-weight: 900;
    color: #78350f;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.attestation-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
}

.meta-row {
    font-weight: 500;
    color: var(--text-muted);
}

.meta-row strong {
    color: var(--text-dark);
}

.badge-success-glow {
    color: #059669;
    font-weight: 700;
    background: #d1fae5;
    padding: 1px 6px;
    border-radius: 4px;
}

/* Section Title */
.receipt-section {
    margin-bottom: 24px;
}

.receipt-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    border-bottom: 1.5px solid #f1f5f9;
    padding-bottom: 6px;
    text-transform: uppercase;
}

/* Tables */
.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.receipt-table tr {
    border-bottom: 1px solid #f8fafc;
}

.receipt-table tr:last-child {
    border-bottom: none;
}

.receipt-table td {
    padding: 10px 12px;
    font-weight: 500;
    color: var(--text-main);
}

.receipt-table td:first-child {
    width: 40%;
    color: var(--text-muted);
    font-weight: 600;
    padding-left: 0;
}

.receipt-table.condensed td {
    padding: 6px 12px;
}

.receipt-table.condensed td:first-child {
    width: 45%;
    padding-left: 0;
}

.ref-highlight {
    font-weight: 800;
    color: var(--indigo);
}

.status-payment-success {
    background: #10b981;
    color: #fff;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Profile Grid */
.receipt-profile-grid {
    display: flex;
    gap: 24px;
}

.receipt-profile-main {
    flex-grow: 1;
}

.receipt-profile-media {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 110px;
    flex-shrink: 0;
}

.media-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.media-label {
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.media-frame {
    width: 108px;
    height: 108px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-frame.signature {
    height: 52px;
}

.receipt-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: white;
}

.receipt-media-img.sig {
    object-fit: contain;
    padding: 4px;
}

.empty-media-placeholder {
    font-size: 2rem;
    color: #cbd5e1;
}

/* Legal Footer */
.receipt-legal-note {
    border-top: 2px solid #f1f5f9;
    padding-top: 16px;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.receipt-legal-note p {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.attested-barcoded-stamp {
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    display: inline-self;
    align-self: center;
}

.barcode-placeholder {
    font-family: monospace;
    font-size: 0.72rem;
    letter-spacing: 1px;
    color: var(--text-dark);
}

.barcode-id {
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* ==========================================
   OFFICIAL REGISTRATION DOSSIER LAYOUT (A4)
   ========================================== */
.dossier-page {
    position: relative;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 40px;
    margin: 24px auto;
    max-width: 800px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    overflow: hidden;
}

/* Watermark & Stamp ribbon */
.dossier-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 8rem;
    font-weight: 900;
    color: rgba(226, 232, 240, 0.22);
    user-select: none;
    pointer-events: none;
    z-index: 1;
}

.dossier-stamp-ribbon {
    position: absolute;
    top: 36px;
    left: -36px;
    transform: rotate(-45deg);
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 2px dashed #059669;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 6px 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 5;
    user-select: none;
}

/* Dossier Header */
.dossier-header {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 2px double #cbd5e1;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.dossier-header-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
}

.dossier-header-text {
    flex: 1;
}

.dossier-header-text h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.dossier-header-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.dossier-form-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4f46e5;
    background: #eef2ff;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* Metadata & Photo block */
.dossier-top-block {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 24px;
    margin-bottom: 24px;
}

.dossier-meta-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.dossier-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dossier-meta-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dossier-meta-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.text-indigo {
    color: #4f46e5 !important;
}

/* Photo slot */
.dossier-photo-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dossier-photo-inner {
    width: 120px;
    height: 140px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.dossier-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dossier-photo-placeholder {
    font-size: 2.5rem;
    color: #cbd5e1;
}

.dossier-photo-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dossier-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 20px 0;
}

/* Section styling */
.preview-section {
    margin-bottom: 24px;
    page-break-inside: avoid;
}

.preview-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e293b;
    background: #f1f5f9;
    padding: 6px 12px;
    border-left: 4px solid #4f46e5;
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.req-star {
    color: #ef4444;
    font-weight: 800;
}

.preview-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.preview-value.locked {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.preview-value.unlocked {
    background: #ffffff;
    border: 1px solid #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.preview-value input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    outline: none;
    padding: 0;
}

/* Dossier Footer Block */
.dossier-footer-block {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 32px;
    margin-top: 32px;
    align-items: end;
    page-break-inside: avoid;
}

.dossier-declaration-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.dossier-declaration-box h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.dossier-declaration-box p {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.45;
}

.dossier-signature-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dossier-signature-inner {
    width: 100%;
    height: 80px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.dossier-sig-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.dossier-sig-placeholder {
    font-size: 0.75rem;
    font-style: italic;
    color: #cbd5e1;
}

.dossier-signature-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}

/* Mobile Responsive Adjustments for Dossier Page & Attested Receipt Card */
@media (max-width: 768px) {
    /* Dossier Page Styles */
    .dossier-page {
        padding: 24px 16px;
        margin: 12px auto;
        border-radius: 8px;
        border: 1px solid #cbd5e1;
    }

    .dossier-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding-bottom: 16px;
        margin-bottom: 20px;
    }

    .dossier-header-logo {
        width: 56px;
        height: 56px;
    }

    .dossier-header-text h2 {
        font-size: 1.25rem;
    }

    .dossier-form-title {
        font-size: 0.85rem;
        padding: 4px 10px;
    }

    .dossier-top-block {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    .dossier-photo-frame {
        order: -1; /* Display photo above metadata on mobile */
        margin: 0 auto;
    }

    .dossier-photo-inner {
        width: 100px;
        height: 120px;
    }

    .dossier-meta-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dossier-meta-item {
        align-items: flex-start;
        text-align: left;
    }

    .dossier-footer-block {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 24px;
        text-align: center;
    }

    .dossier-declaration-box {
        padding: 12px;
        text-align: left;
    }

    .dossier-signature-frame {
        margin: 0 auto;
        width: 100%;
        max-width: 200px;
    }

    /* Attested Receipt Card Styles */
    .receipt-container {
        margin: 1.5rem 0;
        padding: 0 10px;
    }

    .attested-receipt-card {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .receipt-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding-bottom: 16px;
        margin-bottom: 20px;
    }

    .receipt-emblem {
        width: 48px;
        height: 48px;
        font-size: 1.8rem;
    }

    .receipt-title-block h3 {
        font-size: 1rem;
    }

    .receipt-profile-grid {
        flex-direction: column;
        gap: 20px;
    }

    .receipt-profile-media {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 20px;
    }

    .media-box {
        align-items: center;
    }

    .attestation-ribbon {
        top: 15px;
        right: -35px;
        padding: 4px 35px;
        font-size: 0.6rem;
    }
}

/* ════════════════════════════════════════════════════════════
   NATIVE VECTOR PRINT SUPPORT (@media print)
   ════════════════════════════════════════════════════════════ */
@media print {
    /* Hide everything on the page */
    body * {
        visibility: hidden;
    }
    
    /* Show receipt container or final preview container depending on which is visible */
    #receipt-container,
    #receipt-container *,
    #phase-final-preview,
    #phase-final-preview * {
        visibility: visible;
    }
    
    /* Position whichever is active absolute at the top-left */
    #receipt-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: white !important;
    }

    #phase-final-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    /* Hide buttons and interactive items in printing */
    .btn-edit-toggle,
    .workspace-actions,
    .payment-note,
    .preview-header p,
    .declaration-checkbox-wrap input[type="checkbox"] {
        display: none !important;
    }

    /* Force background colors to print for preview cards */
    .preview-card-hero {
        background: #f8fafc !important;
        border: 2px solid #cbd5e1 !important;
        padding: 16px !important;
        border-radius: 12px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .preview-section {
        border: 2px solid #cbd5e1 !important;
        background: #fff !important;
        page-break-inside: avoid !important;
    }

    .preview-section-title {
        background: #f1f5f9 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .preview-value {
        background: #f8fafc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .attested-receipt-card {
        border: 2px solid #a1a1a1 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 24px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .attestation-ribbon {
        border: 1px solid #10b981 !important;
        background: #10b981 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .badge-success-glow {
        border: 1px solid #059669 !important;
        background: #d1fae5 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .attestation-seal-gold {
        background: #fbbf24 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .status-payment-success {
        background: #10b981 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ════════════════════════════════════════════════════════════
   PREMIUM UPLOAD SUMMARY & UNMATCHED DOCUMENTS STYLING
   ════════════════════════════════════════════════════════════ */
.upload-summary-panel {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-summary-panel:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.upload-summary-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    user-select: none;
    transition: background-color 0.2s;
}

.upload-summary-header:hover {
    background: #f8fafc;
}

.upload-summary-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.05rem;
    color: #1e293b;
}

.upload-summary-icon {
    font-size: 1.25rem;
}

.upload-summary-toggle {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.upload-summary-panel.collapsed .upload-summary-toggle {
    transform: rotate(-90deg);
}

.upload-summary-body {
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, padding 0.3s;
    padding: 1.5rem;
}

.upload-summary-panel.collapsed .upload-summary-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.upload-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.summary-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.summary-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-stat::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #cbd5e1;
}

.summary-stat .stat-number {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.summary-stat .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-stat.stat-success::after { background: var(--green); }
.summary-stat.stat-success .stat-number { color: var(--green); }

.summary-stat.stat-warning::after { background: var(--amber); }
.summary-stat.stat-warning .stat-number { color: var(--amber); }

.summary-stat.stat-error::after { background: var(--red); }
.summary-stat.stat-error .stat-number { color: var(--red); }

@media (max-width: 640px) {
    .upload-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Unmatched Files Panel */
.unmatched-files-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.unmatched-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.unmatched-icon {
    font-size: 1.25rem;
}

.unmatched-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: #0f172a;
}

.unmatched-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.unmatched-files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.unmatched-file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-body);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1rem;
    gap: 1rem;
    transition: all 0.2s;
}

.unmatched-file-card:hover {
    border-color: #cbd5e1;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.unmatched-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.unmatched-thumb-wrap {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

.unmatched-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unmatched-thumb-icon {
    font-size: 1.5rem;
    color: #94a3b8;
}

.unmatched-meta {
    flex: 1;
    min-width: 0;
}

.unmatched-filename {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unmatched-detected-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.unmatched-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.unmatched-suggestion-chip {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--indigo);
    background: var(--indigo-light);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(79, 70, 229, 0.15);
    cursor: pointer;
    transition: all 0.15s;
}

.unmatched-suggestion-chip:hover {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}

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

.btn-assign-unmatched {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-assign-unmatched:hover {
    border-color: var(--indigo);
    color: var(--indigo);
    background: var(--indigo-light);
}

.unmatched-error-msg {
    font-size: 0.75rem;
    color: var(--red);
    font-weight: 600;
    margin-top: 0.25rem;
}

.btn-retry-failed {
    background: var(--red-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

@media (max-width: 640px) {
    .unmatched-file-card {
        flex-direction: column;
        align-items: stretch;
    }
    .unmatched-actions {
        justify-content: flex-end;
        margin-top: 0.5rem;
    }
}

/* ════════════════════════════════════════════════════════════
   PREMIUM COMPLETION SCREEN V2
   ════════════════════════════════════════════════════════════ */
.completion-screen-v2 {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    text-align: center;
}

.completion-hero {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.completion-icon-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    animation: completionPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.completion-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes completionPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.completion-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.completion-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
    font-weight: 500;
    max-width: 380px;
    margin: 0 auto;
}

.completion-ref-card {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.completion-actions-v2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.5rem;
}

.completion-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.completion-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.completion-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.completion-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ════════════════════════════════════════════════════════════
   MOBILE-FIRST POLISH — Smaller Fonts, Tighter Spacing
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Global spacing */
    .dashboard-body {
        padding: 0.75rem !important;
        margin-bottom: 90px !important;
    }

    /* Section headers */
    .section-header h1 {
        font-size: 1.2rem;
    }
    .section-header p {
        font-size: 0.85rem;
    }

    /* App type cards */
    .app-type-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .app-type-card {
        padding: 0.9rem;
        gap: 0.75rem;
    }
    .card-icon { font-size: 1.8rem; }
    .card-name { font-size: 0.92rem; }
    .card-cat-count { font-size: 0.72rem; }

    /* Workspace title */
    .workspace-title h1 { font-size: 1.15rem; }
    .workspace-title .subtitle { font-size: 0.8rem; }

    /* Bulk upload */
    .bulk-upload-zone { padding: 1rem; margin-top: 0.75rem; margin-bottom: 1.25rem; }
    .bulk-upload-text strong { font-size: 0.92rem; }
    .bulk-upload-text p { font-size: 0.78rem; }
    .btn-upload-bulk { padding: 0.6rem 1.15rem; font-size: 0.82rem; }

    /* Media capture */
    .media-capture-container { padding: 0 0.25rem; }
    .step-icon-circle { width: 60px; height: 60px; font-size: 2rem; margin-bottom: 1rem; }
    .media-step-header h2 { font-size: 1.25rem; margin-bottom: 0.35rem; }
    .media-step-header p { font-size: 0.82rem; }
    .guideline-list li { font-size: 0.82rem; gap: 0.5rem; }

    /* Missing fields */
    .missing-field-card { padding: 1rem; }
    .field-label { font-size: 0.78rem; }
    .field-input { padding: 0.75rem; font-size: 0.88rem; }

    /* Chat panel */
    .chat-header { padding: 10px 14px; }
    .chat-avatar { width: 34px; height: 34px; }
    .chat-avatar-icon { font-size: 1.1rem; }
    .chat-title { font-size: 0.88rem; }
    .chat-messages { padding: 12px; max-height: 320px; gap: 10px; }
    .chat-bubble { padding: 10px 13px; font-size: 0.82rem; }
    .chat-action-btn { padding: 7px 13px; font-size: 0.75rem; }

    /* Preview/Payment page */
    #phase-final-preview {
        padding: 14px 10px;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .preview-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    .preview-header h1 { font-size: 1.15rem; margin-bottom: 4px; }
    .preview-header p { font-size: 0.78rem; }

    .btn-edit-toggle {
        padding: 6px 12px;
        font-size: 0.75rem;
        margin-top: 0.6rem;
    }

    .preview-card-hero { padding: 14px; gap: 12px; margin-bottom: 1.5rem; }
    .preview-hero-photo { width: 70px; height: 70px; }
    .preview-name { font-size: 1.1rem; }
    .preview-category-badge { font-size: 0.65rem; padding: 3px 10px; }

    .preview-section-title {
        font-size: 0.72rem;
        padding: 8px 12px;
        letter-spacing: 0.4px;
    }
    .preview-grid { padding: 12px; gap: 12px; }
    .preview-label { font-size: 0.68rem; }
    .preview-value {
        font-size: 0.82rem;
        padding: 6px 10px;
        min-height: 32px;
    }

    .preview-declaration {
        margin-top: 1.5rem;
        padding: 14px;
    }
    .declaration-text { font-size: 0.78rem; line-height: 1.45; }
    .declaration-checkbox-wrap input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-top: 2px;
    }

    .btn-payment {
        margin-top: 1rem;
        font-size: 0.95rem !important;
        padding: 12px 16px;
    }
    .payment-note { font-size: 0.7rem; margin-top: 0.6rem; }

    /* Dossier page mobile tweaks */
    .dossier-page { padding: 16px 12px; }
    .dossier-header-text h2 { font-size: 1.1rem; }
    .dossier-header-subtitle { font-size: 0.72rem; }
    .dossier-form-title { font-size: 0.78rem; }
    .dossier-meta-label { font-size: 0.68rem; }
    .dossier-meta-val { font-size: 0.85rem; }
    .dossier-declaration-box h4 { font-size: 0.72rem; }
    .dossier-declaration-box p { font-size: 0.65rem; }

    /* Completion screen v2 */
    .completion-screen-v2 { padding: 1.5rem 0.75rem 2rem; }
    .completion-icon-ring { width: 68px; height: 68px; }
    .completion-icon-ring svg { width: 34px; height: 34px; }
    .completion-title { font-size: 1.3rem; }
    .completion-subtitle { font-size: 0.82rem; }
    .completion-ref-card { font-size: 0.82rem; padding: 0.85rem 1rem; }
    .completion-btn-primary { font-size: 0.85rem; padding: 12px 16px; }
    .completion-btn-secondary { font-size: 0.8rem; padding: 10px 16px; }

    /* Modal sizing */
    .modal-header h2 { font-size: 1.25rem; }
    .modal-header p { font-size: 0.85rem; }

    /* Sticky bar */
    .sticky-action-bar { padding: 0.65rem 0.75rem calc(0.65rem + var(--safe-bottom)); }
    .sticky-bar-label { font-size: 0.88rem; }
    .sticky-bar-step { font-size: 0.62rem; }
    .sticky-bar-btn { padding: 0.6rem 1.35rem; font-size: 0.82rem; }

    /* Upload summary */
    .upload-summary-title { font-size: 0.9rem; }
    .summary-stat { padding: 0.85rem 0.65rem; }
    .summary-stat .stat-number { font-size: 1.4rem; }
    .summary-stat .stat-label { font-size: 0.68rem; }
}

/* Extra small screens (< 375px) */
@media (max-width: 375px) {
    .section-header h1 { font-size: 1.05rem; }
    .workspace-title h1 { font-size: 1rem; }
    .preview-header h1 { font-size: 1rem; }
    .preview-name { font-size: 0.95rem; }
    .chat-title { font-size: 0.82rem; }
    .completion-title { font-size: 1.15rem; }
    .dossier-header-text h2 { font-size: 0.95rem; }
}

/* ════════════════════════════════════════════════════════════
   CHAT HEADER — Simplified "AI Assistant" only
   ════════════════════════════════════════════════════════════ */
.chat-header-info .chat-status {
    display: none;
}

/* ════════════════════════════════════════════════════════════
   DOCUMENT CONSENT / CHECKLIST PANEL
   ════════════════════════════════════════════════════════════ */
.doc-consent-panel {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px -8px rgba(79, 70, 229, 0.08);
    margin-top: 1rem;
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.consent-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.consent-icon-ring {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--indigo-light), #e0e7ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.15);
    animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 14px rgba(79, 70, 229, 0.15); }
    50% { box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3); }
}

.consent-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.consent-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 420px;
    margin: 0 auto;
}

/* Document Checklist Items */
.consent-doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.25rem;
}

.consent-doc-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    transition: all 0.2s ease;
    animation: fadeSlideUp 0.3s ease both;
}

.consent-doc-item:nth-child(odd) {
    background: #fff;
}

.consent-doc-item:hover {
    border-color: var(--indigo);
    background: var(--indigo-light);
    transform: translateX(4px);
}

.consent-doc-number {
    width: 28px;
    height: 28px;
    background: var(--indigo);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}

.consent-doc-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
    line-height: 1.3;
}

.consent-doc-tag {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.consent-doc-tag.required {
    background: var(--red-light);
    color: var(--red);
}

.consent-doc-tag.optional {
    background: var(--bg-body);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Consent Checkbox */
.consent-checkbox-wrap {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fefce8, #fffbeb);
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.consent-label input[type="checkbox"] {
    display: none;
}

.consent-checkmark-custom {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 2px;
    background: #fff;
    flex-shrink: 0;
}

.consent-label input[type="checkbox"]:checked + .consent-checkmark-custom {
    background: var(--green);
    border-color: var(--green);
    animation: checkBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.consent-label input[type="checkbox"]:checked + .consent-checkmark-custom::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

@keyframes checkBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.consent-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #92400e;
    line-height: 1.5;
}

.consent-proceed-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    padding: 1rem 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.consent-proceed-btn:not(:disabled) {
    animation: subtleShine 2s ease-in-out infinite;
}

@keyframes subtleShine {
    0%, 100% { box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3); }
    50% { box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5); }
}

/* Upload workspace area transition */
.upload-workspace-area {
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ════════════════════════════════════════════════════════════
   COMPACT GALLERY GRID (All images in same row, small)
   ════════════════════════════════════════════════════════════ */
.uploaded-gallery-panel {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.05);
}

.gallery-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.gallery-header-icon {
    font-size: 1.1rem;
}

.gallery-header-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    flex: 1;
}

.gallery-count-badge {
    background: var(--indigo);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.gallery-grid-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (min-width: 480px) {
    .gallery-grid-compact {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 768px) {
    .gallery-grid-compact {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }
}

.gallery-thumb-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    background: #f8fafc;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.gallery-thumb-item:hover {
    transform: scale(1.06);
    border-color: var(--indigo);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.gallery-thumb-item:active {
    transform: scale(0.96);
}

.gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb-pdf {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #dc2626;
}

.gallery-thumb-pdf-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.gallery-thumb-pdf-label {
    font-size: 0.55rem;
    font-weight: 800;
    margin-top: 2px;
}

.gallery-thumb-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    color: #fff;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 8px 3px 2px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* ════════════════════════════════════════════════════════════
   ENHANCED MOBILE OPTIMIZATIONS
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Consent panel mobile */
    .doc-consent-panel {
        padding: 1.25rem 1rem;
        margin-top: 0.75rem;
        border-radius: 16px;
    }

    .consent-icon-ring {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    .consent-title {
        font-size: 1.15rem;
    }

    .consent-subtitle {
        font-size: 0.82rem;
    }

    .consent-doc-item {
        padding: 0.7rem 0.85rem;
        gap: 0.6rem;
    }

    .consent-doc-number {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    .consent-doc-name {
        font-size: 0.82rem;
    }

    .consent-doc-list {
        max-height: 40vh;
    }

    .consent-text {
        font-size: 0.82rem;
    }

    .consent-proceed-btn {
        font-size: 0.92rem;
        padding: 0.85rem 1.5rem;
    }

    /* Phase transitions smoother on mobile */
    section {
        animation: mobileSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    /* Gallery compact grid on mobile */
    .gallery-grid-compact {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .gallery-thumb-item {
        border-radius: 6px;
        border-width: 1px;
    }

    .gallery-thumb-name {
        font-size: 0.45rem;
        padding: 6px 2px 2px;
    }

    /* Better workspace header on mobile */
    .workspace-header {
        margin-bottom: 1rem;
    }

    .header-top {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Better upload zone on mobile */
    .bulk-upload-zone {
        padding: 1rem;
        border-radius: 14px;
        gap: 0.6rem;
        margin-top: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .bulk-upload-icon {
        font-size: 1.6rem;
    }

    .bulk-upload-text strong {
        font-size: 0.95rem;
    }

    /* Chat panel mobile adjustments */
    .chat-panel {
        border-radius: 16px 16px 0 0;
    }

    .chat-messages {
        padding: 0.75rem;
    }

    .chat-bubble {
        max-width: 92%;
    }

    /* Step indicator tighter on mobile */
    .sticky-action-bar {
        padding: 0.75rem 0.75rem calc(0.75rem + var(--safe-bottom));
    }

    /* Upload instruction text */
    .upload-instruction-text {
        font-size: 0.75rem;
        margin: 1rem 0 0.5rem;
    }

    /* Better spacing for media capture */
    .media-capture-container {
        padding: 0 0.25rem;
    }

    .media-step-header h2 {
        font-size: 1.35rem;
    }

    .step-icon-circle {
        width: 64px;
        height: 64px;
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    /* Missing fields tighter */
    .missing-fields-list {
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .missing-field-card {
        padding: 1rem;
    }

    /* Photo guidelines mobile */
    .photo-guidelines {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .guideline-list li {
        font-size: 0.82rem;
        gap: 0.5rem;
    }
}

/* Extra small mobile screens */
@media (max-width: 380px) {
    .consent-title {
        font-size: 1.05rem;
    }

    .consent-doc-item {
        padding: 0.6rem 0.7rem;
    }

    .consent-doc-name {
        font-size: 0.78rem;
    }

    .consent-doc-tag {
        font-size: 0.58rem;
        padding: 0.15rem 0.4rem;
    }

    .gallery-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }

    .consent-proceed-btn {
        font-size: 0.85rem;
        padding: 0.8rem 1.25rem;
    }
}


/* ═══════════════════════════════════════════════════════════
   USER PROFILE MENU (Top Right Corner)
   ═══════════════════════════════════════════════════════════ */

.app-bar-user {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-menu-btn:hover {
    border-color: var(--indigo);
    background: var(--indigo-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo), #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 9999;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-menu-dropdown.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.user-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-body);
}

.user-menu-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.user-menu-mobile {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-menu-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    text-align: left;
}

.user-menu-item:hover {
    background: var(--bg-body);
}

.user-menu-item span {
    font-size: 1.2rem;
}

@media (max-width: 640px) {
    .user-name {
        display: none;
    }
    
    .user-menu-btn {
        padding: 6px;
    }
}
