:root {
    --bg-color: #0b1121;
    /* Darker slate for pro look */
    --sidebar-bg: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(148, 163, 184, 0.1);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #0ea5e9;
    /* Sky blue */
    --accent-dark: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.25);
    --success: #10b981;
    --error: #ef4444;
    --font-family: 'Outfit', sans-serif;
    --font-mono: 'Courier New', monospace;
    --premium: #f59e0b;
    /* Amber/Gold for Premium items */
}

/* Premium Lock Overlays */
.premium-locked {
    position: relative;
    opacity: 0.6;
    filter: grayscale(0.4);
    pointer-events: none !important;
    user-select: none;
    cursor: not-allowed;
}

.premium-locked::after {
    content: '🔒 PREMIUM';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--premium);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    letter-spacing: 0.5px;
}

.premium-locked .copy-btn {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Tech Background Grid */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Base Layout Structure (Dashboard) */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.sidebar-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    font-size: 2rem;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
    line-height: 1.2;
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 1.2rem;
    opacity: 0.8;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent);
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.05), transparent 40%);
}

.view-section {
    max-width: 1200px;
    margin: 0 auto;
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-section.hidden {
    display: none;
}

.view-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.view-header .subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Glass Panels (Generic Container) */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Dashboard Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

/* Global Utility */
.hidden {
    display: none !important;
}

/* --- ADAPTED HASHING STYLES (From Original App) --- */

/* Mode Toggles */
.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1.5rem;
    gap: 4px;
}

.mode-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: var(--text-main);
}

.mode-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mode Sections Visibility */
.mode-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.mode-section.active {
    display: block;
}

/* Comparison Layout */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: start;
}

.compare-divider {
    align-self: center;
    font-weight: bold;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.mini-results {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid var(--glass-border);
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.mini-hash {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    word-break: break-all;
}

/* Upload Section Adjustment */
.upload-section {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.upload-section:hover {
    border-color: var(--accent);
    background: rgba(14, 165, 233, 0.05);
}

/* Results & Cards */
.hash-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.hash-value {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.85rem;
    word-break: break-all;
}

/* Status Indicators */
.match-result {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* --- Common Components --- */
.primary-btn,
.action-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.primary-btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Modal Styling (Adapted) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Printing logic remains same but needs scope check */
@media print {

    .sidebar,
    .app-container {
        display: none !important;
        /* Hide app structure */
    }

    body * {
        visibility: hidden;
        /* Hide everything else */
    }

    #report-modal,
    #report-modal * {
        visibility: visible;
        /* Show only modal content */
    }

    #report-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
        color: black;
    }

    .modal-content {
        box-shadow: none;
        border: none;
        width: 100%;
    }

    .modal-header,
    .close-modal,
    .modal-footer,
    .report-inputs {
        display: none !important;
    }

    .report-body {
        color: black;
        overflow: visible;
    }

    .report-table th,
    .report-table td {
        border-color: black;
        color: black;
    }
}

/* --- FORM STYLES (Evidence Module) --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.forensic-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 6px;
    color: white;
    font-family: var(--font-family);
    outline: none;
    transition: all 0.2s;
}

.forensic-input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.secondary-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* Evidence List Grid */
.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.evidence-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    transition: transform 0.2s;
}

.evidence-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.evidence-card h4 {
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.evidence-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.evidence-status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--glass-border);
    border-radius: 4px;
}

/* --- PRESERVATION STYLES --- */
.device-state-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.state-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    padding: 2rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.state-btn .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.state-btn span {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.state-btn:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.state-btn.on:hover,
.state-btn.on.selected {
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.state-btn.off:hover,
.state-btn.off.selected {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.report-section-title {
    border-bottom: 2px solid #ccc;
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
    text-transform: uppercase;
    margin-top: 10px;
}

.golden-rule-box {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    animation: fadeIn 0.5s;
}

.checklist-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.check-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.check-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

/* --- CHAIN OF CUSTODY TIMELINE --- */
.chain-timeline-container {
    position: relative;
    padding: 20px 0;
    margin-top: 2rem;
}

/* Vertical Line */
.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
    z-index: 0;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-node {
    position: relative;
    padding-left: 50px;
    z-index: 1;
}

/* The Dot */
.timeline-node::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 5px;
    /* Align with title */
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid var(--accent);
    z-index: 2;
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.timeline-action {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.timeline-responsible {
    font-size: 0.95rem;
    color: var(--text-main);
}

.timeline-hash {
    margin-top: 5px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 4px;
    display: inline-block;
    color: #fdba74;
    /* Orange-ish for warnings/hashes */
}

/* --- MODULE 6: METADATA & EOF --- */

/* DROP ZONE STYLING (Missing Fix) */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(14, 165, 233, 0.05);
}

.drop-zone .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* Meta Header Card */
.meta-header-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 20px;
}

.meta-thumb {
    width: 80px;
    height: 80px;
    background: #333;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--accent);
}

.meta-info-basic h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.2rem;
}

.meta-info-basic p {
    margin: 2px 0 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* EOF Alert Box */
.alert-box {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-box.clean {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    color: #34d399;
}

.alert-box.warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #f87171;
    animation: pulse-red 2s infinite;
}

.alert-box.error {
    background: rgba(255, 255, 0, 0.1);
    border: 1px solid #eab308;
    color: #facc15;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Metadata Grid */
.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.meta-column h4 {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 5px;
    margin-bottom: 15px;
    color: var(--accent);
    font-size: 1rem;
}

.meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.meta-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

.meta-list li strong {
    color: var(--text-muted);
    font-weight: 500;
}

.meta-list li span {
    color: var(--text-main);
    text-align: right;
    font-family: var(--font-mono);
}

/* PDF / PRINT EXPORT STYLES (COMPLIANCE) */
@media print {

    /* Hide UI elements */
    .sidebar,
    .mode-toggle,
    .close-modal,
    .secondary-btn,
    .primary-btn,
    .action-btn,
    .drop-zone,
    button,
    .alert-box {
        display: none !important;
    }

    /* Layout Reset */
    .app-container {
        height: auto;
        overflow: visible;
        display: block;
    }

    main {
        margin: 0;
        padding: 0;
        background: white;
        color: black;
        position: static;
        height: auto;
        display: block;
    }

    body {
        background: white;
        color: black;
        overflow: visible;
    }

    /* Report Container */
    #view-report,
    .forensic-modal {
        position: static;
        background: white;
        width: 100%;
        height: auto;
        border: none;
        display: block !important;
    }

    .modal-content {
        background: white;
        border: none;
        box-shadow: none;
        color: black;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    /* Typography */
    h1,
    h2,
    h3 {
        color: black !important;
        border-bottom: 1px solid #ccc;
    }

    p,
    span,
    td,
    th {
        color: black !important;
    }

    table {
        border: 1px solid #ccc;
        width: 100%;
        border-collapse: collapse;
    }

    th {
        background: #eee !important;
        color: black !important;
        border: 1px solid #ccc;
    }

    td {
        border: 1px solid #ccc;
    }

    /* Hash Specific */
    .hash-value {
        font-family: 'Courier New', monospace;
        font-size: 9pt;
    }

    /* Ensure signatures are visible at bottom */
    #report-body {
        display: block;
    }
}

/* Missing Comparison Mode Styles */
.mini-results {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.3s ease;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.mini-hash {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75em;
    color: var(--accent);
    word-break: break-all;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 4px;
}

.compare-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
    font-size: 1.2em;
}

.compare-actions {
    margin-top: 20px;
    text-align: center;
}

.match-result {
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.match-result.match {
    background: rgba(16, 185, 129, 0.1);
    /* Green tint */
    border: 1px solid var(--success);
    color: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.match-result.mismatch {
    background: rgba(239, 68, 68, 0.1);
    /* Red tint */
    border: 1px solid var(--error);
    color: var(--error);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

/* --- PRINT STYLES (PDF Generation) --- */
@media print {

    /* Hide everything globally first */
    body * {
        visibility: hidden;
    }

    /* Hide scrollbars */
    body {
        overflow: hidden;
        background: white;
    }

    /* Target the Report Modal specifically */
    #report-modal,
    #report-modal * {
        visibility: visible;
    }

    /* Position the modal content to fill the page, ignoring screen layout */
    #report-modal {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: white;
        z-index: 9999;
        display: block !important;
        /* Force display if hidden */
        padding: 0;
        margin: 0;
    }

    .modal-content {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* HIDE the UI controls we don't want in the PDF */
    #report-modal .modal-header,
    #report-modal footer,
    #report-controls,
    .close-modal {
        display: none !important;
        visibility: hidden !important;
    }

    /* Main Report Body formatting for Print */
    #report-body {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 20px 40px !important;
        /* Add standard document margins */
        overflow: visible !important;
        font-size: 12pt;
        /* Professional font size */
        color: black;
    }

    /* Ensure colors print correctly (browsers often strip background colors) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* --- FINAL PRINT OVERRIDES (Retry) --- */
@media print {
    :root {
        --bg-main: #ffffff !important;
        --text-main: #000000 !important;
        --glass-panel: #ffffff !important;
    }

    html,
    body {
        background-color: #ffffff !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    #report-modal,
    .modal-content,
    #report-body {
        background-color: white !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
    }

    h1,
    h2,
    h3,
    h4,
    p,
    span,
    td,
    th {
        color: black !important;
        text-shadow: none !important;
    }

    .match-result {
        color: black !important;
        border: 2px solid black !important;
        background: transparent !important;
    }
}


/* --- PAPER VIEW STYLES (Screen) --- */
.paper-view {
    background: white;
    color: black;
    width: 210mm;
    /* A4 Width */
    min-height: 297mm;
    /* A4 Height */
    margin: 20px auto;
    padding: 20mm;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    font-family: 'Times New Roman', serif;
    position: relative;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.agency-logo {
    font-size: 3em;
}

.report-title h2 {
    margin: 0;
    font-size: 1.4em;
    border: none;
    color: black;
}

.report-title p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    border: none;
}

.report-meta p {
    margin: 2px 0;
    font-size: 0.9em;
    text-align: right;
    color: black;
}

.report-divider {
    border: 0;
    border-top: 2px solid black;
    margin: 10px 0 20px 0;
}

.report-section {
    margin-bottom: 30px;
}

.report-section h3 {
    font-size: 1.1em;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
    padding-bottom: 5px;
    color: black;
    text-transform: uppercase;
}

.report-grid {
    width: 100%;
}

.report-grid td {
    padding: 5px;
    border: none;
    color: black;
}

.report-grid .label {
    font-weight: bold;
    width: 15%;
}

.report-grid .value {
    border-bottom: 1px solid #eee;
    width: 35%;
}

/* Timeline specific */
.timeline-logs {
    font-family: sans-serif;
    font-size: 0.85em;
}

.log-entry {
    page-break-inside: avoid;
}

/* Signatures */
.signatures {
    margin-top: 50px;
    display: flex;
    justify-content: space-around;
}

.sig-box {
    text-align: center;
    width: 40%;
}

.sig-box .line {
    border-top: 1px solid black;
    margin-bottom: 5px;
    margin-top: 40px;
}

.report-footer {
    position: absolute;
    bottom: 10mm;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.7em;
    color: #999;
}

/* Print specific for this view */
@media print {
    #view-report.hidden {
        display: none !important;
    }

    .print-hidden {
        display: none !important;
    }

    .paper-view {
        margin: 0;
        box-shadow: none;
        width: 100%;
        min-height: auto;
    }
}


/* UTILITIES (Restored) */
.hidden {
    display: none !important;
}

/* Privacy Toggle Switch Styles */
.switch input:checked+.slider {
    background-color: var(--accent);
}

.switch input:focus+.slider {
    box-shadow: 0 0 1px var(--accent);
}

.switch input:checked+.slider:before {
    transform: translateX(16px);
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* --- MOBILE RESPONSIVENESS (Fase 15) --- */

/* Mobile Header (Hidden by default) */
.mobile-header {
    display: none;
    background: var(--sidebar-bg);
    padding: 10px 15px;
    border-bottom: 1px solid var(--glass-border);
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Rules (< 768px) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        padding: 80px 15px 30px 15px;
        /* Space for mobile header */
        width: 100%;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 1.5rem;
    }

    .view-header h1 {
        font-size: 1.4rem;
    }

    /* Stack Grids */
    .dashboard-grid,
    .form-grid,
    .evidence-grid,
    .library-grid,
    .meta-grid {
        grid-template-columns: 1fr !important;
    }

    /* Comparison Hashing - Stack Vertical */
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .compare-divider {
        padding: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        margin: 0 auto;
    }

    /* Tables */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Forms */
    .device-state-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .state-btn {
        width: 100%;
        max-width: 300px;
        padding: 1.5rem;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .paper-view {
        width: 100%;
        padding: 10mm;
        transform: scale(1);
        transform-origin: top left;
    }

    /* Metadata specifically */
    .meta-header-card {
        flex-direction: column;
        text-align: center;
    }

    .meta-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .meta-list li span {
        text-align: left;
    }
}

/* Fix for ultra-small screens */
@media (max-width: 480px) {
    .view-header h1 {
        font-size: 1.2rem;
    }

    .glass-panel {
        padding: 1rem;
    }
}