/* ============================================================
   ENCBYT DASHBOARD - LEAN & OPTIMIZED CSS v10.9
   Strict CSP Compliant | Zero Redundancy | Dark Mode Ready
   Path: frontend/pwa/css/dashboard.css
   ============================================================ */

:root {
    --bg-light: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-primary: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #e0e7ff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --font-family: 'Plus Jakarta Sans', sans-serif;
    
    --shadow-subtle: 0 4px 12px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);

    --upload-zone-bg: #ffffff;
    --upload-zone-hover: #f8fafc;
}

[data-theme="dark"], body.dark-mode {
    --bg-light: #0b0f19;
    --card-bg: #111827;
    --border-color: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #312e81;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    
    --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);

    --upload-zone-bg: #111827;
    --upload-zone-hover: #1e293b;
}

/* ============================================================
   GLOBAL RESETS & BASE STYLES
   ============================================================ */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: var(--font-family); 
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.fa-solid, .fa-regular, .fa-brands, .fas, .far, .fab {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
}

.dashboard-container { 
    display: flex; 
    min-height: 100vh; 
}

/* ============================================================
   ZERO-FLASH SPA VIEWPORT ENGINE
   ============================================================ */
.spa-view-viewport {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 80px);
    overflow-x: hidden;
}

.spa-stage {
    width: 100%;
    opacity: 1;
    /* ⚠️ Removed transform — it breaks backdrop-filter on modals */
    transition: opacity 0.16s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.spa-stage.is-swapping {
    opacity: 0.05;
}

.spa-loader-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    width: 100%;
}

.spa-error-container {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-top: 20px;
}

.spa-error-icon {
    font-size: 2.8rem;
    color: var(--danger-color);
    margin-bottom: 14px;
}

.spa-error-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.spa-error-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.spa-error-btn {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ============================================================
   STRICT CSP UTILITIES
   ============================================================ */
.col-span-8 { grid-column: span 8; }
.col-span-4 { grid-column: span 4; }
.is-hidden, .u-hidden { display: none !important; }

.dashboard-empty-cell {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #94a3b8);
}

/* ============================================================
   SIDEBAR COMPONENT SHELL
   ============================================================ */
.sidebar {
    width: 280px; 
    background: var(--card-bg); 
    border-right: 1px solid var(--border-color);
    display: flex; 
    flex-direction: column; 
    padding: 12px 20px;
    position: fixed; 
    height: 100vh; 
    z-index: 10; 
    overflow-y: auto;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.logo-area-login-style {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 32px;
    background: var(--bg-light); 
    padding: 12px; 
    border-radius: 14px; 
    border: 1px solid var(--border-color);
}

.brand-badge {
    background: transparent;
    width: 42px; 
    height: 42px; 
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: var(--shadow-md); 
    flex-shrink: 0;
}

.brand-badge .brand-icon { 
    color: #ffffff; 
    font-size: 20px; 
}

.brand-text h2 { 
    font-size: 17px; 
    font-weight: 800; 
    letter-spacing: -0.3px; 
    color: var(--text-main); 
    line-height: 1.2; 
}

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

.nav-menu, .sidebar-nav { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.nav-item {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 11px 14px;
    color: var(--text-muted); 
    text-decoration: none; 
    border-radius: 10px;
    font-size: 14px; 
    font-weight: 600; 
    transition: all 0.2s ease; 
    cursor: pointer;
}

.nav-item i { 
    width: 20px; 
    text-align: center; 
    font-size: 15px; 
}

.nav-item:hover { 
    color: var(--text-main); 
    background: var(--bg-light); 
}

.nav-item.active { 
    color: var(--accent-primary); 
    background: var(--accent-light); 
    font-weight: 700; 
}

.nav-item.active i { 
    color: var(--accent-primary); 
}

.sidebar-footer { 
    margin-top: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.quota-mini { 
    background: var(--bg-light); 
    padding: 14px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
}

.quota-labels { 
    display: flex; 
    justify-content: space-between; 
    font-size: 12px; 
    margin-bottom: 6px; 
    color: var(--text-muted); 
    font-weight: 600; 
}

.progress-bar { 
    width: 100%; 
    height: 6px; 
    background: var(--border-color); 
    border-radius: 4px; 
    overflow: hidden; 
}

.progress-fill { 
    height: 100%; 
    background: var(--accent-primary); 
    border-radius: 4px; 
    transition: width 0.4s ease;
}

.upgrade-btn {
    background: var(--accent-primary); 
    color: #ffffff; 
    text-align: center; 
    padding: 12px;
    border-radius: 10px; 
    font-weight: 700; 
    text-decoration: none; 
    font-size: 13px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    box-shadow: var(--shadow-md); 
    transition: all 0.2s;
}

.upgrade-btn:hover { 
    background: var(--accent-hover); 
    transform: translateY(-1px); 
}

.logout-btn, .btn-sidebar-logout {
    background: var(--card-bg); 
    border: 1px solid var(--border-color); 
    color: var(--danger-color);
    padding: 12px; 
    border-radius: 10px; 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px; 
    font-family: var(--font-family); 
    transition: all 0.2s;
    border-bottom: none !important;
    box-shadow: none !important;
}

.logout-btn:hover, .btn-sidebar-logout:hover { 
    background: var(--bg-light); 
}

/* ============================================================
   MODAL DIALOG ACTIONS
   ============================================================ */
.cv-dialog-actions, .dialog-actions, .swal2-actions, .modal-actions {
    display: flex !important;
    gap: 12px !important;
    justify-content: flex-end !important;
    margin-top: 16px !important;
}

.cv-dialog-btn, .dialog-btn {
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.main-content { 
    margin-left: 280px; 
    flex: 1; 
    padding: 32px 36px; 
    min-height: 100vh; 
}

/* ============================================================
   DASHBOARD GRID & CARDS
   ============================================================ */
.dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(12, 1fr); 
    gap: 20px; 
}

.grid-card { 
    background: var(--card-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 16px; 
    padding: 24px; 
    box-shadow: var(--shadow-subtle); 
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.stats-section { grid-column: span 7; }
.daily-quota-card { grid-column: span 5; }
.wide-card { grid-column: span 8; }
.audit-section { grid-column: span 4; }

/* Row 2 (new): Recent Files (left, span 8) | Security + Audit stacked (right, span 4).
   The right stack fills the same row height as Recent Files; Audit grows to use the rest. */
.dash-right-stack {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
.dash-right-stack > .grid-card { margin: 0; }
.dash-recent-card { display: flex; flex-direction: column; min-width: 0; }
.dash-audit-card { flex: 1 1 auto; display: flex; flex-direction: column; }
.dash-audit-card .audit-list { flex: 1 1 auto; }

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

.card-header h3 { 
    font-size: 16px; 
    font-weight: 700; 
}

.status-indicator { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 12px; 
    font-weight: 600; 
    padding: 5px 10px; 
    border-radius: 8px; 
}

.status-indicator.online { 
    background: rgba(16, 185, 129, 0.15); 
    color: var(--success-color); 
}

.circular-stats-container { 
    display: flex; 
    justify-content: space-around; 
    gap: 16px; 
}

.circle-stat-box { text-align: center; }

.circle-wrapper { 
    position: relative; 
    width: 80px; 
    height: 80px; 
    margin: 0 auto 10px; 
}

.progress-circle { 
    transform: rotate(-90deg); 
    width: 100%; 
    height: 100%; 
}

.circle-bg { 
    fill: none; 
    stroke: var(--border-color); 
    stroke-width: 3; 
}

.circle-stroke-img, .circle-stroke-doc, .circle-stroke-vault { 
    fill: none; 
    stroke-width: 3; 
    stroke-linecap: round; 
    transition: stroke-dasharray 0.6s ease;
}

.circle-stroke-img { stroke: var(--accent-primary); }
.circle-stroke-doc { stroke: var(--success-color); }
.circle-stroke-vault { stroke: #d946ef; }

.circle-inner-icon { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    font-size: 18px; 
}

.img-color { color: var(--accent-primary); } 
.doc-color { color: var(--success-color); } 
.vault-color { color: #d946ef; }

.circle-stat-box h4 { 
    font-size: 14px; 
    font-weight: 600; 
    margin-bottom: 2px; 
}

.circle-stat-box p { 
    font-size: 12px; 
    color: var(--text-muted); 
}

/* ============================================================
   QUICK UPLOAD ZONE
   ============================================================ */
.quick-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    background: var(--upload-zone-bg);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

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

.quick-upload-icon {
    font-size: 36px;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.quick-upload-primary {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.quick-upload-secondary {
    font-size: 12px;
    color: var(--text-muted);
}

.quick-upload-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================================
   SUPPORTED FORMATS LIST
   ============================================================ */
.formats-wrapper {
    margin-top: 14px;
}

.formats-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
}

.formats-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.format-tag { 
    font-size: 10px; 
    background: var(--bg-light); 
    border: 1px solid var(--border-color); 
    padding: 2px 7px; 
    border-radius: 6px; 
    color: var(--text-muted); 
    font-weight: 600; 
    text-transform: uppercase; 
    display: inline-block;
}

/* ============================================================
   SECURITY ENGINE TOGGLES
   ============================================================ */
.security-toggles { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.toggle-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 14px; 
    background: var(--bg-light); 
    border: 1px solid var(--border-color); 
    border-radius: 10px; 
    font-size: 13px; 
    font-weight: 600; 
}

.toggle-row i { 
    margin-right: 6px; 
    color: var(--text-muted); 
    font-size: 14px; 
}

.badge-active { 
    background: rgba(16, 185, 129, 0.15); 
    color: var(--success-color); 
    padding: 3px 8px; 
    border-radius: 6px; 
    font-size: 11px; 
    font-weight: 700; 
}

/* ============================================================
   RECENT FILES TABLE & AUDIT STREAM
   ============================================================ */
.card-header-actions { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 16px; 
    flex-wrap: wrap; 
    gap: 10px; 
}

.card-header-actions h3 { 
    font-size: 16px; 
    font-weight: 700; 
    margin: 0; 
}

.view-all-link {
    font-size: 12px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.view-all-link:hover {
    opacity: 0.8;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.premium-table { 
    width: 100%; 
    border-collapse: collapse; 
    text-align: left; 
}

.premium-table th { 
    padding: 10px 14px; 
    color: var(--text-muted); 
    font-weight: 600; 
    font-size: 12px; 
    border-bottom: 1px solid var(--border-color); 
    white-space: nowrap;
}

.premium-table td { 
    padding: 12px 14px; 
    font-size: 13px; 
    border-bottom: 1px solid var(--border-color); 
    color: var(--text-main);
    white-space: nowrap;
}

.premium-table tbody tr:hover { 
    background: var(--bg-light); 
}

.premium-table td i { 
    margin-right: 6px; 
    font-size: 14px; 
    color: var(--accent-primary);
}

.table-loading-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

.audit-list { 
    list-style: none; 
    padding: 0;
    margin: 0;
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.audit-item { 
    display: flex; 
    gap: 12px; 
    align-items: flex-start; 
    padding: 12px 14px; 
    border-radius: 10px; 
    background: var(--bg-light); 
    border: 1px solid var(--border-color); 
}

.audit-item i { 
    font-size: 16px; 
    margin-top: 2px; 
    flex-shrink: 0; 
}

.audit-item.success i { color: var(--success-color); } 
.audit-item.warning i { color: var(--warning-color); }

.audit-info p { 
    font-size: 13px; 
    font-weight: 600; 
    line-height: 1.3; 
    margin: 0;
    color: var(--text-main);
}

.audit-info span { 
    font-size: 11px; 
    color: var(--text-muted); 
    display: block;
    margin-top: 2px;
}

/* ============================================================
   GLOBAL FLOATING OVERLAYS (COLLAPSED TO PREVENT VIEWPORT GAPS)
   ============================================================ */
.upload-panel-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

.upload-panel-container.u-hidden,
.upload-panel-container.is-hidden,
.upload-panel-container:empty {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.upload-panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 380px;
}

.upload-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.upload-panel-header strong {
    font-size: 13px;
    color: var(--text-main);
}

.upload-panel-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
}

.upload-item {
    margin-bottom: 8px;
}

.upload-item:last-child {
    margin-bottom: 0;
}

.upload-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

.upload-item-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    color: var(--text-main);
}

.upload-progress-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.media-player-container {
    position: fixed;
    bottom: 84px;
    right: 20px;
    z-index: 99998;
}

.media-player-container.u-hidden,
.media-player-container.is-hidden,
.media-player-container:empty {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.media-player-card {
    background: #0f172a;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    min-width: 320px;
    max-width: 400px;
    border: 1px solid #1e293b;
}

.media-player-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.media-player-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    flex-shrink: 0;
}

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

.media-player-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-player-subtitle {
    font-size: 11px;
    color: #94a3b8;
}

.media-player-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.media-player-audio {
    width: 100%;
}

.media-player-video {
    width: 100%;
    border-radius: 8px;
    max-height: 220px;
    background: #000;
}

/* ============================================================
   CSP-COMPLIANT DYNAMIC COMPONENT CLASSES
   ============================================================ */
.upload-progress-bar.status-uploading {
    background: var(--accent-primary, #4f46e5);
}

.upload-progress-bar.status-complete {
    background: var(--success-color, #10b981);
}

.upload-progress-bar.status-error {
    background: var(--danger-color, #ef4444);
}

.upload-status-text.status-uploading {
    color: var(--accent-primary, #4f46e5);
}

.upload-status-text.status-complete {
    color: var(--success-color, #10b981);
}

.upload-status-text.status-error {
    color: var(--danger-color, #ef4444);
}

/* ============================================================
   PROGRESS WIDTH STEP UTILITIES (0% - 100%)
   ============================================================ */
.prog-w-0   { width: 0%; }
.prog-w-5   { width: 5%; }
.prog-w-10  { width: 10%; }
.prog-w-15  { width: 15%; }
.prog-w-20  { width: 20%; }
.prog-w-25  { width: 25%; }
.prog-w-30  { width: 30%; }
.prog-w-35  { width: 35%; }
.prog-w-40  { width: 40%; }
.prog-w-45  { width: 45%; }
.prog-w-50  { width: 50%; }
.prog-w-55  { width: 55%; }
.prog-w-60  { width: 60%; }
.prog-w-65  { width: 65%; }
.prog-w-70  { width: 70%; }
.prog-w-75  { width: 75%; }
.prog-w-80  { width: 80%; }
.prog-w-85  { width: 85%; }
.prog-w-90  { width: 90%; }
.prog-w-95  { width: 95%; }
.prog-w-100 { width: 100%; }

/* ============================================================
   RESPONSIVE MEDIA QUERIES
   ============================================================ */
@media (max-width: 1200px) { 
    .stats-section,
    .daily-quota-card,
    .wide-card,
    .audit-section,
    .dash-right-stack,
    .col-span-8,
    .col-span-4 { 
        grid-column: span 12; 
    } 
}

@media (max-width: 768px) {
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
    } 
    .main-content { 
        margin-left: 0; 
        padding: 20px; 
    }
    .dashboard-container { 
        flex-direction: column; 
    } 
    .dashboard-grid { 
        grid-template-columns: 1fr; 
    }
}/* test Sun Sep 13 11:35:36 AM IST 2026 */
/* test commit */

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR BRAND HEADER — thoda neeche (8px breathing room)
   ═══════════════════════════════════════════════════════════════ */
.sidebar .cv-brand-header,
.sidebar .brand-header,
.sidebar > div:first-child {
    margin-top: 16px;
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR BRAND HEADER — koi extra gap nahi
   ═══════════════════════════════════════════════════════════════ */
.sidebar .cv-brand-header,
.sidebar .brand-header,
.sidebar > div:first-child {
    margin-top: 0;
}


/* ═══ Item Properties Modal ═══ */
.cv-props-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2147483646;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cv-props-fade 0.15s ease;
}

@keyframes cv-props-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cv-props-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cv-props-slide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes cv-props-slide {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cv-props-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.cv-props-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.cv-props-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.cv-props-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.cv-props-card-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.cv-props-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    margin-bottom: 18px;
}

.cv-props-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.cv-props-icon.is-folder {
    background: #fef3c7;
    color: #d97706;
}

.cv-props-icon.is-file {
    background: #dbeafe;
    color: #2563eb;
}

.cv-props-title {
    flex: 1;
    min-width: 0;
}

.cv-props-filename {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
    margin-bottom: 2px;
}

.cv-props-subtitle {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cv-props-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cv-props-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.12s ease;
}

.cv-props-row:hover {
    background: #f8fafc;
}

.cv-props-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.cv-props-label i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

.cv-props-value {
    font-size: 13px;
    color: #0f172a;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cv-props-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #f1f5f9;
    color: #64748b;
    text-transform: uppercase;
}

.cv-props-badge-ok {
    background: #d1fae5;
    color: #059669;
}

.cv-props-card-footer {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    background: #f8fafc;
}

.cv-props-btn {
    padding: 9px 22px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.cv-props-btn-primary {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}

.cv-props-btn-primary:hover {
    background: #4338ca;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

@media (max-width: 480px) {
    .cv-props-card { max-width: 100%; }
    .cv-props-card-body { padding: 16px; }
    .cv-props-filename { font-size: 14px; }
}

/* ═══════════════════════════════════════════════════════════
SIDEBAR OFFER WIDGET
(Only shown to FREE users, NO close button)
═══════════════════════════════════════════════════════════ */
.sidebar-offer-slot {
    padding: 0 0 12px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.sidebar-offer-widget {
    padding: 12px 11px 10px;
    border: 1px solid;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
    animation: sidebarOfferIn 0.35s ease, sidebarOfferPulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

/* Continuous glow pulse — always active */
@keyframes sidebarOfferPulse {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
    }
}

/* Shimmer/shine sweep — every 5 seconds */
.sidebar-offer-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 40%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 0.5) 60%,
        transparent 100%
    );
    animation: sidebarOfferShine 3s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes sidebarOfferShine {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}
@keyframes sidebarOfferIn {
    0% {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(2px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sidebar-offer-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-offer-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    animation: sidebarOfferIconBounce 1.8s ease-in-out infinite;
    transform-origin: center;
}

@keyframes sidebarOfferIconBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.15) rotate(-10deg);
    }
    50% {
        transform: scale(1) rotate(0deg);
    }
    75% {
        transform: scale(1.15) rotate(10deg);
    }
}

.sidebar-offer-label {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.85;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* Sparkle dot next to label */
.sidebar-offer-label::after {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
    animation: sidebarOfferSparkle 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

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

.sidebar-offer-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.1px;
}

.sidebar-offer-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-offer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    margin-top: 4px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    animation: sidebarOfferCtaGlow 1.5s ease-in-out infinite;
}

@keyframes sidebarOfferCtaGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.3), 0 0 0 0 rgba(59, 130, 246, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 16px rgba(59, 130, 246, 0.5), 0 0 0 8px rgba(59, 130, 246, 0);
        transform: scale(1.02);
    }
}

/* CTA continuous shine — no pause */
.sidebar-offer-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    animation: sidebarOfferCtaShine 1.8s linear infinite;
    pointer-events: none;
}

@keyframes sidebarOfferCtaShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}
.sidebar-offer-cta:hover {
    transform: translateY(-1px);
}
.sidebar-offer-cta:active {
    transform: translateY(0);
}
.sidebar-offer-cta i {
    font-size: 10px;
    transition: transform 0.15s;
}
.sidebar-offer-cta:hover i {
    transform: translateX(2px);
}

/* Mobile — hide on small screens (space issue) */
@media (max-width: 768px) {
    .sidebar-offer-slot {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD PROGRESS BAR — COLOR ANIMATION (FINAL)
   ═══════════════════════════════════════════════════════════ */

@keyframes upload-gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes upload-glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5),
                    0 0 10px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.8),
                    0 0 25px rgba(6, 182, 212, 0.5);
    }
}

@keyframes upload-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* OVERRIDE dashboard.css with animation */
.upload-progress-bar {
    position: relative !important;
    height: 100% !important;
    border-radius: inherit !important;
    background: linear-gradient(
        90deg,
        #3b82f6 0%,
        #06b6d4 25%,
        #8b5cf6 50%,
        #06b6d4 75%,
        #3b82f6 100%
    ) !important;
    background-size: 200% 100% !important;
    animation: upload-gradient-flow 3s ease infinite !important;
    transition: width 0.3s ease !important;
    overflow: hidden !important;
}

.upload-progress-bar.status-uploading {
    animation: 
        upload-gradient-flow 3s ease infinite,
        upload-glow-pulse 2s ease-in-out infinite !important;
}

.upload-progress-bar.status-uploading::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    ) !important;
    animation: upload-shimmer 2s ease-in-out infinite !important;
}

.upload-progress-bar.status-paused {
    background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%) !important;
    animation: none !important;
    box-shadow: none !important;
}

.upload-progress-bar.status-paused::after {
    display: none !important;
}

.upload-progress-bar.status-saving {
    background: linear-gradient(
        90deg,
        #f59e0b 0%,
        #f97316 50%,
        #f59e0b 100%
    ) !important;
    background-size: 200% 100% !important;
    animation: upload-gradient-flow 1.5s ease infinite !important;
}

.upload-progress-bar.status-complete {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%) !important;
    animation: none !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5) !important;
}

.upload-progress-bar.status-complete::after {
    display: none !important;
}

.upload-progress-bar.status-error {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%) !important;
    animation: none !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important;
}

.upload-progress-bar.status-error::after {
    display: none !important;
}

/* Track styling */
.upload-progress-track {
    position: relative !important;
    height: 6px !important;
    background: #f1f5f9 !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    margin: 8px 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD ITEM — NEW LAYOUT (meta + actions row below bar)
   ═══════════════════════════════════════════════════════════ */

.upload-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 14px 16px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.upload-item-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
}

.upload-item-name-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.upload-item-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.upload-status-text {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    letter-spacing: 0.3px !important;
}

.upload-status-text.status-uploading {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #2563eb !important;
}

.upload-status-text.status-saving {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #d97706 !important;
}

.upload-status-text.status-paused {
    background: rgba(100, 116, 139, 0.1) !important;
    color: #64748b !important;
}

.upload-status-text.status-complete {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
}

.upload-status-text.status-error {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

/* ✅ Progress bar full width, higher z-index */
.upload-progress-track {
    width: 100% !important;
    order: 2 !important;
}

/* ✅ Meta + Actions row below progress bar */
.upload-meta-actions-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    order: 3 !important;
}

.upload-item-meta {
    display: flex !important;
    gap: 12px !important;
    font-size: 11px !important;
    color: #64748b !important;
    flex: 1 !important;
}

.upload-item-actions {
    display: flex !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.upload-action-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #64748b !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    font-size: 12px !important;
}

.upload-action-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.upload-action-btn[data-action="pause"]:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #2563eb !important;
    border-color: #93c5fd !important;
}

.upload-action-cancel:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD ITEM — CLEAN LAYOUT (SVG Reference)
   ═══════════════════════════════════════════════════════════ */

.upload-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 14px 16px !important;
    background: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

/* Row 1: Header (icon + name + actions) */
.upload-item-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.upload-item-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.upload-file-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    background: #e0f2fe !important;
    color: #0284c7 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
}

.upload-item-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Actions */
.upload-item-actions {
    display: flex !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.upload-action-btn {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #475569 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    font-size: 11px !important;
    padding: 0 !important;
}

.upload-action-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

.upload-action-btn[data-action="pause"]:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: #93c5fd !important;
    color: #2563eb !important;
}

.upload-action-cancel {
    color: #ef4444 !important;
}

.upload-action-cancel:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

.upload-action-btn.u-hidden {
    display: none !important;
}

/* Row 2: Progress bar (full width) */
.upload-progress-track {
    position: relative !important;
    width: 100% !important;
    height: 8px !important;
    background: #e2e8f0 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

/* Row 3: Meta + Status */
.upload-meta-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.upload-meta-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #64748b !important;
}

.upload-meta-dot {
    color: #cbd5e1 !important;
    font-size: 10px !important;
}

.upload-status-text {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
}

.upload-status-text.status-uploading {
    color: #3b82f6 !important;
}

.upload-status-text.status-saving {
    color: #d97706 !important;
}

.upload-status-text.status-paused {
    color: #f59e0b !important;
}

.upload-status-text.status-complete {
    color: #10b981 !important;
}

.upload-status-text.status-error {
    color: #ef4444 !important;
}

/* Downloads: distinct from uploading (blue) */
.upload-status-text.status-downloading {
    color: #0ea5e9 !important;
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR LOGO — Encbyt (logo only, no text)
   ═══════════════════════════════════════════════════════════════ */
aside.sidebar > .cv-brand-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: -12px;
    padding: 0 0 20px;
}

.sidebar .sidebar-logo {
    height: 64px;
    width: auto;
    display: block;
    margin: 0;
}

/* --- Dark Mode Refinements — Dashboard --- */
[data-theme="dark"] body.dashboard-body,
body.dark-mode.dashboard-body {
    background: #0b0f19 !important;
}

[data-theme="dark"] .dashboard-container,
body.dark-mode .dashboard-container {
    background: #0b0f19 !important;
}

[data-theme="dark"] .grid-card,
[data-theme="dark"] .stats-section,
body.dark-mode .grid-card,
body.dark-mode .stats-section {
    background: #111827 !important;
    border-color: #1f2937 !important;
}
