        * { box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; }
       
        body {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
            color: white;
            padding: 0;
            margin: 0;
            min-height: 100vh;
        }
       
        .container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
       
        header {
            background: rgba(30, 30, 60, 0.8);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(167, 139, 250, 0.3);
            padding: 1rem 2rem;
            position: sticky;
            top: 0;
            z-index: 100;
        }
       
        .header-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
       
        .logo { display: flex; align-items: center; gap: 0.75rem; }
        .logo-icon { font-size: 2rem; }
       
        .logo h1 {
            font-size: 1.5rem;
            margin: 0;
            background: linear-gradient(135deg, #a78bfa, #ec4899);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
       
        .logo p { margin: 0; font-size: 0.75rem; color: #94a3b8; }
       
        h1 { color: #a78bfa; margin-bottom: 0.5rem; }
        h2 { color: #c4b5fd; margin-bottom: 1rem; font-size: 1.5rem; }
       
        .main-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            margin-top: 2rem;
        }
       
        @media (max-width: 1024px) {
            .main-grid { grid-template-columns: 1fr; }
        }
       
        .form-panel, .preview-panel {
            background: rgba(30, 30, 60, 0.6);
            border: 1px solid rgba(167, 139, 250, 0.2);
            border-radius: 1rem;
            padding: 1.5rem;
        }
       
        .section-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #a78bfa;
            font-weight: 600;
            font-size: 0.9rem;
            margin: 1.5rem 0 1rem 0;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid rgba(167, 139, 250, 0.2);
        }
       
        .section-title.cyan { color: #22d3ee; border-color: rgba(34, 211, 238, 0.2); }
        .section-title.green { color: #4ade80; border-color: rgba(74, 222, 128, 0.2); }
        .section-title.amber { color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
        .section-title.red { color: #f87171; border-color: rgba(248, 113, 113, 0.2); }
		.section-title.aqua { color: #00ffcc; border-color: rgba(0, 255, 204, 0.2); }
		.section-title.pink { color: #f57df5; border-color: rgba(245, 125, 245, 0.2); }
		.section-title.yellow { color: #f2f57d; border-color: rgba(242, 245, 125, 0.2); }
       
        .form-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 1rem;
        }
       
		/* Form group spacing */
		.form-group { margin-bottom: 1rem; }

		/* Checkbox label container */
		.checkbox-label {
			display: inline-flex;        /* keeps checkbox + text on one line */
			align-items: flex-start;     /* top-align text with checkbox */
			gap: 0.5rem;                 /* space between checkbox and text */
			cursor: pointer;             /* make whole label clickable */
			margin-bottom: 0.5rem;       /* spacing below each checkbox row */
			line-height: 1.3;            /* good for multi-line text */
			width: auto;                 /* do not stretch label across parent */
		}

		/* Checkbox input */
		.checkbox-label input[type="checkbox"] {
			margin: 0;                   /* remove default top/bottom margin */
			flex-shrink: 0;              /* prevent checkbox from shrinking */
			margin-top: 0.15em;          /* vertical alignment with first line of text */
			width: auto;                  /* keep natural browser width (~16px) */
			height: auto;                 /* keep natural height */
		}

		/* Optional: wrap long text nicely */
		.checkbox-label span {
			display: inline;             /* wrapped text stays next to checkbox */
			word-break: break-word;      /* break long words if needed */
		}
		
		label {
			display: block;
			margin-bottom: 0.4rem;
			color: #cbd5e1;
			font-weight: 500;
			font-size: 0.85rem;
		}
       
        input, select {
            width: 100%;
            padding: 0.65rem 0.85rem;
            border: 2px solid #334155;
            border-radius: 0.5rem;
            background: #0f172a;
            color: white;
            font-size: 0.95rem;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
       
        input:focus, select:focus {
            outline: none;
            border-color: #a78bfa;
            box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
        }
       
        input::placeholder { color: #64748b; }
       
        .ssn-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
       
        .ssn-group input {
            text-align: center;
            letter-spacing: 0.15em;
            font-family: monospace;
        }
       
        .ssn-group .separator {
            color: #64748b;
            font-size: 1.25rem;
            font-weight: bold;
        }
       
        .ssn-group input:first-of-type { width: 4.5rem; }
        .ssn-group input:nth-of-type(2) { width: 3.5rem; }
        .ssn-group input:last-of-type { width: 5.5rem; }
       
        .privacy-note {
            font-size: 0.7rem;
            color: #64748b;
            margin-top: 0.4rem;
        }
       
        .state-group {
            background: rgba(30, 30, 60, 0.5);
            border: 1px solid rgba(167, 139, 250, 0.15);
            border-radius: 0.5rem;
            padding: 1rem;
            margin-bottom: 0.75rem;
        }
       
        /* Preview Panel Styles */
        .pdf-viewer {
            background: white;
            border-radius: 0.5rem;
            overflow: hidden;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }
       
        .pdf-toolbar {
            background: #f1f5f9;
            border-bottom: 1px solid #e2e8f0;
            padding: 0.5rem 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
       
        .window-controls {
            display: flex;
            gap: 0.4rem;
            align-items: center;
        }
       
        .window-controls span {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            cursor: pointer;
        }
       
        .window-controls .close { background: #ef4444; }
        .window-controls .minimize { background: #fbbf24; }
        .window-controls .maximize { background: #22c55e; }
       
        .zoom-controls button {
            background: rgba(0,0,0,0.15);
            color: #333;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-weight: bold;
            font-size: 1.1rem;
        }
       
        .zoom-controls button:hover { background: rgba(0,0,0,0.25); }
       
        .zoom-controls span {
            min-width: 42px;
            text-align: center;
            font-family: monospace;
            font-size: 0.8rem;
            color: #333;
        }
       
        .pdf-filename {
            font-size: 0.75rem;
            color: #64748b;
            font-family: monospace;
            flex-grow: 1;
            text-align: center;
        }
       
        /* PDF Navigation Bar */
        .pdf-nav-bar {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            background: rgba(124, 58, 237, 0.15);
            border: 1px solid rgba(124, 58, 237, 0.3);
            border-radius: 0.5rem;
            padding: 0.75rem 1rem;
            margin-bottom: 1rem;
        }
       
        .pdf-nav-bar button {
            background: linear-gradient(135deg, #667eea, #764ba2);
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 0.35rem;
            cursor: pointer;
            font-size: 0.85rem;
            color: white;
            font-weight: 500;
        }
       
        .pdf-nav-bar button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            background: #475569;
        }
       
        .pdf-nav-bar .page-info {
            font-size: 0.8rem;
            color: #a78bfa;
            font-weight: 600;
            padding: 0 1rem;
        }
       
        .pdf-content {
            padding: 1.5rem;
            color: #1e293b;
            min-height: 400px;
            font-size: 0.85rem;
        }
       
		.pdf-canvas-container {
			display: block;                   /* changed from flex */
			background: #e2e8f0;
			overflow-y: auto;                 /* vertical scroll */
			overflow-x: auto;                 /* horizontal scroll when zoomed */
			padding: 10px;
			min-height: 400px;
			text-align: center;               /* centers each page horizontally */
		}

        /* Wrapper for multiple pages */
		.pdf-pages-wrapper {
			display: flex;
			flex-direction: column;
			align-items: center;
			gap: 20px;                        /* space between pages */
		}

        /* Each page canvas */
		.pdf-page-canvas {
			max-width: 100%;
			box-shadow: 0 4px 12px rgba(0,0,0,0.15);
			background: white;
			border: 1px solid #ccc;
		}
       
        .pdf-canvas-container canvas {
            max-width: 100% !important;
            height: auto;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
		
        #pdfCanvas {
            max-width: none;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
       
		#overlayContent {
			overflow-y: auto;
			overflow-x: auto;
			height: calc(95vh - 56px);
			background: #e2e8f0;
			padding: 20px;
			display: block;
		}

        #overlayContent .pdf-pages-wrapper {
            gap: 30px;
        }
       
        #overlayHtmlWrapper {
            transform-origin: top left;
            width: fit-content;
        }
       
        /* Document Count & Buttons */
        .doc-count {
            background: rgba(124, 58, 237, 0.15);
            border: 1px solid rgba(124, 58, 237, 0.3);
            border-radius: 0.5rem;
            padding: 1rem;
            margin: 1.5rem 0;
            text-align: center;
        }
       
        .doc-count strong {
            color: #a78bfa;
            font-size: 1.5rem;
        }
       
        .btn-primary {
            width: 100%;
            padding: 1rem;
            background: linear-gradient(135deg, #667eea, #764ba2);
            border: none;
            border-radius: 0.5rem;
            color: white;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
       
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
        }
       
        .btn-primary:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }
       
        .btn-secondary {
            background: rgba(100, 116, 139, 0.2);
            border: 1px solid rgba(100, 116, 139, 0.3);
            color: #94a3b8;
            padding: 0.75rem 1.5rem;
            border-radius: 0.5rem;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s;
        }
       
        .btn-secondary:hover {
            background: rgba(100, 116, 139, 0.3);
            color: white;
        }
       
        /* Progress */
        .progress-container {
            margin: 1.5rem 0;
        }
       
        .progress-bar {
            height: 8px;
            background: #334155;
            border-radius: 4px;
            overflow: hidden;
        }
       
        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea, #764ba2);
            width: 0%;
            transition: width 0.3s;
        }
       
        .progress-text {
            text-align: center;
            margin-top: 0.5rem;
            color: #94a3b8;
            font-size: 0.85rem;
        }
       
        /* Document List */
        .doc-list {
            background: #0f172a;
            border-radius: 0.5rem;
            padding: 1rem;
            margin: 1rem 0;
            max-height: 250px;
            overflow-y: auto;
        }
       
        .doc-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0;
            border-bottom: 1px solid #334155;
            font-size: 0.85rem;
        }
       
        .doc-item:last-child { border-bottom: none; }
       
        .doc-item.pending .icon { color: #64748b; }
        .doc-item.processing .icon { color: #fbbf24; }
        .doc-item.done .icon { color: #4ade80; }
        .doc-item.error .icon { color: #f87171; }
       
        /* Status Messages */
        .status {
            text-align: center;
            margin-top: 1rem;
            padding: 1rem;
            border-radius: 0.5rem;
        }
       
        .status.success {
            background: rgba(4, 120, 87, 0.2);
            border: 1px solid rgba(4, 120, 87, 0.3);
            color: #6ee7b7;
        }
       
        .status.error {
            background: rgba(127, 29, 29, 0.2);
            border: 1px solid rgba(127, 29, 29, 0.3);
            color: #fca5a5;
        }
       
        .status.info {
            background: rgba(59, 130, 246, 0.2);
            border: 1px solid rgba(59, 130, 246, 0.3);
            color: #93c5fd;
        }
       
        .status.warning {
            background: rgba(217, 119, 6, 0.2);
            border: 1px solid rgba(217, 119, 6, 0.3);
            color: #fcd34d;
        }
       
        /* Access Denied */
        .access-denied {
            text-align: center;
            padding: 4rem 2rem;
            max-width: 500px;
            margin: 0 auto;
        }
       
        .access-denied h1 {
            font-size: 4rem;
            margin-bottom: 1rem;
        }
       
        .access-denied p {
            color: #94a3b8;
            margin-bottom: 1.5rem;
        }
       
        .access-denied a {
            color: #a78bfa;
            text-decoration: underline;
        }
       
        /* Limit Popup Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }
       
        .modal-content {
            background: #1e1e3f;
            border: 1px solid rgba(167, 139, 250, 0.3);
            border-radius: 1rem;
            padding: 2rem;
            max-width: 450px;
            text-align: center;
        }
		
		/* Overlay */
        .modal-content.large-preview {
            background: white;
            padding: 0;
            max-width: 95vw;
            max-width: none; width: 95vw; /* Full wide for overlay */
            max-height: 95vh;
            border-radius: 0.75rem;
            overflow: hidden;
        }
       
        .modal-content h2 {
            color: #f87171;
            margin-bottom: 1rem;
        }
       
        .modal-content p {
            color: #94a3b8;
            margin-bottom: 1.5rem;
        }
       
        .modal-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
        }
       
	    /* Example link next to section title */
		.example-link {
			font-size: 0.75rem;
			color: #fbbf24;
			cursor: pointer;
			margin-left: 0.5rem;
			text-decoration: underline;
			font-weight: normal;
		}

		.example-link:hover {
			color: #fde68a;
		}

		/* Overlay */
		.example-overlay {
			position: fixed;
			inset: 0;
			background: rgba(0,0,0,0.85);
			display: none;
			align-items: center;
			justify-content: center;
			z-index: 2000;
		}

		/* Modal */
		.example-modal {
			position: relative;
			max-width: 95vw;
			max-height: 95vh;
			background: #111;
			padding: 1rem;
			border-radius: 0.75rem;
		}

		/* Image */
		.example-modal img {
			max-width: 100%;
			max-height: 85vh;
			display: block;
			border-radius: 0.5rem;
		}

		/* Close button */
		.example-close {
			position: absolute;
			top: 0.5rem;
			right: 0.5rem;
			background: rgba(0,0,0,0.6);
			color: white;
			border: none;
			font-size: 1.25rem;
			width: 32px;
			height: 32px;
			border-radius: 50%;
			cursor: pointer;
		}

		.example-close:hover {
			background: rgba(239,68,68,0.8);
		}
	   
        .btn-request {
            background: linear-gradient(135deg, #7c3aed, #a855f7);
            border: none;
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: 0.5rem;
            cursor: pointer;
            font-weight: 600;
        }
       
        .btn-close {
            background: transparent;
            border: 1px solid #64748b;
            color: #94a3b8;
            padding: 0.75rem 1.5rem;
            border-radius: 0.5rem;
            cursor: pointer;
        }
       
        /* Email Status */
        .email-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            background: rgba(34, 197, 94, 0.1);
            border: 1px solid rgba(34, 197, 94, 0.3);
            border-radius: 0.5rem;
            margin-top: 1rem;
        }
       
        .email-status.sending {
            background: rgba(251, 191, 36, 0.1);
            border-color: rgba(251, 191, 36, 0.3);
            color: #fbbf24;
        }
       
        .email-status.sent {
            background: rgba(34, 197, 94, 0.1);
            border-color: rgba(34, 197, 94, 0.3);
            color: #4ade80;
        }
       
        .email-status.error {
            background: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.3);
            color: #f87171;
        }
       
        /* Loading spinner */
        .spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
       
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
       
        /* Responsive */
        @media (max-width: 640px) {
            .container { padding: 1rem; }
            .form-panel, .preview-panel { padding: 1rem; }
            .form-row { grid-template-columns: 1fr; }
            .ssn-group { flex-wrap: wrap; justify-content: center; }
            .pdf-nav { flex-wrap: wrap; justify-content: center; }
        }

        .pdf-header { text-align: center; border-bottom: 2px solid #d97706; padding-bottom: 1rem; margin-bottom: 1rem; } .pdf-header .doc-type { font-size: 0.65rem; letter-spacing: 0.1em; color: #d97706; } .pdf-header h3 { margin: 0.25rem 0; color: #1e293b; font-size: 1.1rem; } .trust-banner { background: #fffbeb; border: 2px solid #d97706; border-radius: 0.5rem; padding: 0.75rem; text-align: center; margin-bottom: 1rem; } .trust-banner .label { font-size: 0.65rem; color: #d97706; } .trust-banner .value { font-size: 1rem; font-weight: bold; color: #1e293b; } .pdf-section { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid #e2e8f0; } .pdf-section-title { font-size: 0.7rem; font-weight: 600; margin-bottom: 0.5rem; } .pdf-section-title.amber { color: #d97706; } .pdf-section-title.cyan { color: #0891b2; } .pdf-section-title.purple { color: #7c3aed; } .pdf-field-row { display: flex; justify-content: space-between; font-size: 0.75rem; padding: 0.2rem 0; } .pdf-field-row .label { color: #64748b; } .pdf-field-row .value { color: #1e293b; font-family: monospace; } .pdf-footer { margin-top: 1.5rem; padding-top: 0.75rem; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; font-size: 0.7rem; color: #94a3b8; } 

.access-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 30, 80, 0.85); /* blue-ish tint to match security theme */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.access-content {
    text-align: center;
    padding: 2.5rem;
    background: rgba(30, 30, 63, 0.95); /* semi-transparent dark like main boxes */
    border-radius: 16px; /* rounded corners matching your main content */
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(167, 139, 250, 0.3); /* thin border, same purple-ish tone */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); /* subtle shadow for depth */
}

.access-content h1 {
    color: #a78bfa;
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
}

.password-form {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#accessCodeInput {
    padding: 14px;
    font-size: 1.1rem;
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.2);
    color: white;
}

#submitAccessCode {
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    width: 100%; /* full width to match input field */
}

#submitAccessCode:hover {
    background: linear-gradient(135deg, #5a6fd1, #6b4cc1);
}

.return-link {
    color: #a78bfa;
    text-decoration: underline;
    font-size: 1.1rem;
}

    /* Access Overlay Styles - Integrated with existing design */
    .access-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        padding: 2rem;
    }
    
    .access-content {
        max-width: 500px;
        width: 100%;
        background: rgba(30, 30, 60, 0.95);
        border-radius: 1rem;
        padding: 3rem 2.5rem;
        border: 1px solid rgba(167, 139, 250, 0.3);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
        text-align: center;
    }
    
    .access-icon {
        font-size: 4rem;
        margin-bottom: 1.5rem;
        animation: pulse 2s ease-in-out infinite;
    }
    
    .access-content h2 {
        color: #a78bfa;
        font-size: 1.75rem;
        margin-bottom: 1rem;
        font-weight: 700;
    }
    
    .access-content p {
        color: #94a3b8;
        line-height: 1.7;
        margin-bottom: 0.5rem;
    }
    
    .access-form {
        margin-top: 2rem;
    }
    
    .access-form input {
        width: 100%;
        padding: 0.875rem 1rem;
        background: rgba(15, 23, 42, 0.8);
        border: 2px solid #334155;
        border-radius: 0.5rem;
        color: #fff;
        font-size: 1rem;
        margin-bottom: 1rem;
        transition: border-color 0.2s, box-shadow 0.2s;
    }
    
    .access-form input:focus {
        outline: none;
        border-color: #a78bfa;
        box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
    }
    
    .access-form input::placeholder {
        color: #64748b;
    }
    
    .access-form button {
        width: 100%;
        padding: 1rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 0.5rem;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .access-form button:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
    
    .return-link {
        color: #a78bfa;
        text-decoration: none;
        font-size: 0.9rem;
        transition: color 0.2s;
    }
    
    .return-link:hover {
        color: #c4b5fd;
        text-decoration: underline;
    }
    
    @keyframes pulse {
        0%, 100% { 
            transform: scale(1); 
            opacity: 1; 
        }
        50% { 
            transform: scale(1.05); 
            opacity: 0.8; 
        }
    }
    
    /* Test mode notice styling */
    .test-mode-notice {
        background: rgba(251, 191, 36, 0.1);
        border: 1px solid rgba(251, 191, 36, 0.3);
        padding: 0.75rem;
        border-radius: 0.5rem;
        margin-top: 1rem;
        font-size: 0.9rem;
        color: #fbbf24;
    }
    
    .test-mode-notice strong {
        color: #fde68a;
    }
	
/* ============================================================
   HEADER - FANCY USER MENU STYLES
============================================================ */

.header-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Download Tracker - Fancy Version */
.download-tracker {
    background: rgba(30, 30, 60, 0.8);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    min-width: 140px;
}

.download-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.download-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.download-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #a78bfa;
}

.download-separator {
    color: #475569;
    margin: 0 2px;
}

.download-progress-bar {
    height: 4px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #a78bfa);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.download-warning {
    font-size: 0.65rem;
    color: #f59e0b;
    margin-top: 0.4rem;
    text-align: center;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(30, 30, 60, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #e2e8f0;
}

.user-menu-trigger:hover {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.15);
}

.user-menu-trigger:hover .user-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.05);
}

.user-menu-trigger:hover .user-name {
    color: #a78bfa;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    transition: all 0.2s ease;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    transition: color 0.2s ease;
}

.user-role {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dropdown-arrow {
    color: #64748b;
    transition: transform 0.2s ease;
}

.user-menu.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: linear-gradient(145deg, #1e1e30 0%, #252540 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(167, 139, 250, 0.05);
}

.dropdown-user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.dropdown-user-email {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.25rem 0;
}

.dropdown-section {
    padding: 0.5rem;
}

.dropdown-section-title {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.5rem 0.75rem 0.25rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
}

.dropdown-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.dropdown-shortcut {
    margin-left: auto;
    font-size: 0.7rem;
    color: #475569;
}

.dropdown-external {
    margin-left: auto;
    font-size: 0.75rem;
    color: #64748b;
}

.dropdown-item-danger {
    color: #f87171;
}

.dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-right {
        gap: 0.75rem;
    }
    
    .download-tracker {
        display: none; /* Hide on mobile, or show simplified version */
    }
    
    .user-info {
        display: none;
    }
    
    .user-menu-trigger {
        padding: 0.5rem;
    }
    
    .dropdown-arrow {
        display: none;
    }
    
    .user-dropdown {
        width: 260px;
        right: -10px;
    }
}

/* ============================================================
   DOWNLOAD HISTORY MODAL STYLES
   ============================================================ */

.download-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-history-item {
    background: rgba(30, 30, 60, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.download-history-item:hover {
    border-color: rgba(167, 139, 250, 0.3);
    background: rgba(167, 139, 250, 0.05);
}

.download-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.download-history-filename {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
    word-break: break-word;
}

.download-history-date {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    margin-left: 1rem;
}

.download-history-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.download-history-detail {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.download-history-detail-icon {
    font-size: 0.9rem;
}

.download-history-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.download-history-badge.direct {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.download-history-badge.email {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.download-history-badge.email-link {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.download-history-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.download-history-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.download-history-empty-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.download-history-empty-subtext {
    font-size: 0.85rem;
}

/* Redownload Button */
.btn-redownload {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #a78bfa;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-redownload:hover {
    background: rgba(167, 139, 250, 0.25);
    transform: translateY(-1px);
}

.btn-redownload.expired {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.3);
    color: #64748b;
    cursor: not-allowed;
}

/* ============================================================
   SUPPORT TICKET MODAL STYLES
   ============================================================ */

.support-tab {
    transition: all 0.2s ease;
}

.support-tab:hover {
    transform: translateY(-1px);
}

.support-tab.active {
    background: rgba(167, 139, 250, 0.2) !important;
    border-color: rgba(167, 139, 250, 0.3) !important;
    color: #a78bfa !important;
}

.support-tab:not(.active) {
    background: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.support-tab:not(.active):hover {
    background: rgba(100, 116, 139, 0.2);
}

/* Ticket List */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticket-item {
    background: rgba(30, 30, 60, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ticket-item:hover {
    border-color: rgba(167, 139, 250, 0.3);
    background: rgba(167, 139, 250, 0.05);
    transform: translateX(4px);
}

.ticket-item.has-unread {
    border-left: 3px solid #a78bfa;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.ticket-number {
    font-size: 0.75rem;
    color: #64748b;
    font-family: monospace;
}

.ticket-subject {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.ticket-preview {
    font-size: 0.85rem;
    color: #94a3b8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-status.open { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.ticket-status.in_progress { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.ticket-status.waiting_user { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.ticket-status.resolved { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.ticket-status.closed { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

/* Ticket Detail */
.ticket-detail-header {
    background: rgba(30, 30, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.ticket-detail-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.ticket-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

/* Conversation Thread */
.ticket-conversation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.conversation-message {
    padding: 1rem;
    border-radius: 12px;
    max-width: 85%;
}

.conversation-message.user {
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
    margin-left: auto;
}

.conversation-message.admin {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    margin-right: auto;
}

.conversation-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.conversation-message.user .conversation-sender { color: #a78bfa; }
.conversation-message.admin .conversation-sender { color: #60a5fa; }

.conversation-text {
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.conversation-time {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: right;
}

/* Reply Form */
.ticket-reply-form {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.ticket-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #334155;
    border-radius: 0.5rem;
    background: #0f172a;
    color: white;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 0.75rem;
}

.ticket-reply-form textarea:focus {
    outline: none;
    border-color: #a78bfa;
}

/* Empty State */
.tickets-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.tickets-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Unread Badge */
.unread-badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}

/* Auto-save indicator animations */
.save-indicator {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-50%) translateX(10px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* Add subtle glow to fields being saved */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   LOGIN PAGE LAYOUT
   ============================================ */
.login-page {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-page input.form-input {
    background-color: rgba(0,0,0,0.3) !important;
    color: #fff !important;
}

/* ============================================
   LOGIN PAGE COMPONENTS
   ============================================ */
.auth-container {
    max-width: 450px;
    width: 100%;
    background: linear-gradient(145deg, #1e1e30 0%, #252540 100%);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.auth-title {
    color: #fff;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #a0a0a0;
}

/* Inputs use global input styles */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

/* Info + Error Boxes */
.info-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #10b981;
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #ef4444;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.auth-footer a {
    color: #a78bfa;
    text-decoration: none;
}

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

/* Session timeout modal tweaks */
#session-timeout-countdown {
    color: #fbbf24;
}

#session-timeout-seconds {
    color: #fde68a;
}

/* ============================================
   PAGE LOADING SPINNER
   ============================================ */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-bottom-color: #764ba2;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto;
}

.loader-text {
    color: #a78bfa;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-subtext {
    color: #64748b;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg);
    }
    100% { 
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================
   PDF PREVIEW LOADING SPINNER
   ============================================ */
.pdf-canvas-container {
    position: relative;
    min-height: 400px;
}

#pdfPreviewLoader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

#pdfPreviewLoader.hidden {
    display: none;
}

.pdf-loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: pdfSpin 0.8s linear infinite;
    margin: 0 auto;
}

.pdf-loader-text {
    color: #a78bfa;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* ============================================
   Maintenance Mode Banner
   ============================================ */
.test-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    text-align: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 99999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.test-mode-banner ~ header {
    top: 42px;
}