/* ==================== VARIABLES ==================== */
:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #00d4aa;
    --error: #ff6b6b;
    --warning: #feca57;
    
    /* Light Theme */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f5;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #a8a8a8;
    --border: #2d3748;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    overflow-x: hidden;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Waves Background */
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="%23667eea" fill-opacity="0.1"/></svg>');
    background-size: cover;
    opacity: 0.5;
    z-index: 0;
}

.wave1 {
    animation: wave 15s linear infinite;
}

.wave2 {
    animation: wave 10s linear infinite;
    bottom: 10px;
    opacity: 0.3;
}

.wave3 {
    animation: wave 20s linear infinite;
    bottom: 5px;
    opacity: 0.2;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Login Container */
.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 24px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    overflow: hidden;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

/* Login Left */
.login-left {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header i {
    font-size: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    background: var(--bg-tertiary);
    padding: 6px;
    border-radius: 12px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    background: var(--bg-secondary);
    color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow);
}

.tab i {
    font-size: 18px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 20px;
    transition: var(--transition);
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.input-group input:focus + i,
.input-group input:not(:placeholder-shown) + i {
    color: var(--primary);
}

.toggle-password {
    left: auto !important;
    right: 16px !important;
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary i {
    font-size: 20px;
}

/* Form Note */
.form-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: var(--primary);
    margin-top: 12px;
}

.form-note i {
    font-size: 18px;
}

/* Messages */
.message {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message i {
    font-size: 20px;
}

.message.error {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 107, 107, 0.3);
    display: flex;
}

.message.success {
    background: rgba(0, 212, 170, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 212, 170, 0.3);
    display: flex;
}

.message.info {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border: 1px solid rgba(102, 126, 234, 0.3);
    display: flex;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary);
}

.theme-toggle i {
    font-size: 24px;
}

.theme-toggle span {
    font-size: 14px;
    font-weight: 500;
}

/* Login Right - QR Section */
.login-right {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-right::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.qr-section {
    position: relative;
    z-index: 1;
}

.qr-header {
    text-align: center;
    color: white;
    margin-bottom: 32px;
}

.qr-header i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.qr-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.qr-header p {
    opacity: 0.9;
    font-size: 14px;
}

/* QR Display */
.qr-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.qr-display img {
    max-width: 250px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; scale: 0.9; }
    to { opacity: 1; scale: 1; }
}

.qr-loader {
    color: var(--primary);
}

.qr-loader i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.qr-loader p {
    font-size: 14px;
    color: var(--text-secondary);
}

.qr-timer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.qr-timer i {
    font-size: 18px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.qr-error {
    color: var(--error);
}

.qr-error i {
    font-size: 48px;
    margin-bottom: 16px;
}

.qr-error p {
    margin-bottom: 20px;
    font-size: 14px;
}

.btn-retry {
    width: auto;
    padding: 10px 20px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* QR Info */
.qr-info {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 13px;
}

.info-item i {
    font-size: 20px;
    opacity: 0.9;
}

/* QR Steps */
.qr-steps {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.qr-steps h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.step {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    margin-bottom: 16px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.step p {
    font-size: 14px;
    opacity: 0.9;
}

/* Scanner Overlay */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.scanner-frame {
    width: 250px;
    height: 250px;
    border: 3px solid white;
    border-radius: 12px;
    position: relative;
    margin-bottom: 20px;
}

.scanner-frame::before,
.scanner-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid var(--success);
}

.scanner-frame::before {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.scanner-frame::after {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

/* ==================== ANIMATION CONTAINER ==================== */
.animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.animation-container.hidden {
    display: none;
}

/* ==================== DASHBOARD ==================== */
.dashboard {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    font-weight: 500;
}

.nav-menu a i {
    font-size: 20px;
}

.nav-menu a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-menu a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--error);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.storage-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.storage-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.storage-used {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: var(--transition);
    border-radius: 4px;
}

.storage-info p {
    font-size: 12px;
    text-align: center;
    color: var(--text-secondary);
}

/* Content */
.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    max-height: 100vh;
}

.section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.section.active {
    display: block;
}

.section h2 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Tables */
.files-table,
.admin-table {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

.files-table thead,
.admin-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.files-table th,
.admin-table th {
    padding: 16px;
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.files-table td,
.admin-table td {
    padding: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.files-table tbody tr,
.admin-table tbody tr {
    transition: var(--transition);
}

.files-table tbody tr:hover,
.admin-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.files-table tbody tr:last-child td,
.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.files-table button,
.admin-table button {
    padding: 8px 16px;
    margin: 0 4px;
    width: auto;
    font-size: 13px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.btn-approve {
    background: var(--success) !important;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.btn-reject {
    background: var(--error) !important;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* Search Bar */
.search-bar {
    margin-bottom: 24px;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="%236c757d" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Upload Area */
.upload-area {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.drop-zone {
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
    background: var(--bg-tertiary);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* Viewer */
.viewer-controls,
.editor-controls {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.viewer-controls select,
.editor-controls select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
}

.viewer-controls button,
.editor-controls button {
    width: auto;
    padding: 12px 24px;
}

.viewer-container {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    min-height: 400px;
}

/* PDF Editor */
.pdf-editor {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.editor-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.editor-toolbar button {
    width: auto;
    padding: 12px 20px;
}

#pdfContainer {
    max-height: 600px;
    overflow-y: auto;
}

/* Notifications */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.notification:hover {
    transform: translateX(4px);
}

.notification.unread {
    border-left-color: var(--error);
    background: rgba(255, 107, 107, 0.05);
}

.notification h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 16px;
}

.notification p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
}

.notification small {
    color: var(--text-secondary);
    font-size: 12px;
}

.notification button {
    width: auto;
    padding: 8px 16px;
    margin-top: 12px;
}

/* Profile */
.profile-form,
.notification-form,
.settings-section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    max-width: 600px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* QR Display in Dashboard */
.qr-display {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    text-align: center;
    max-width: 400px;
}

#userQrCode {
    margin: 24px 0;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#userQrCode img {
    max-width: 280px;
    border-radius: 12px;
}

/* Admin Dashboard */
.admin-dashboard .sidebar {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.admin-dashboard .nav-menu a.active {
    background: linear-gradient(135deg, var(--error) 0%, #c0392b 100%);
}

/* Settings */
.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 20px;
}

.settings-section h4 {
    font-size: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 5% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px var(--shadow-lg);
    animation: slideDown 0.3s;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close:hover {
    color: var(--error);
    background: rgba(255, 107, 107, 0.1);
}

.modal-content h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Video for QR Scanner */
#qrVideo {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
}

#qrCanvas {
    display: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .login-right {
        display: none;
    }

    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .logo {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        border-right: 1px solid var(--border);
        padding-right: 20px;
        font-size: 20px;
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        flex: 1;
        margin-left: 20px;
    }

    .nav-menu li {
        flex: 1;
        min-width: 140px;
        margin-bottom: 0;
    }

    .nav-menu a {
        justify-content: center;
        font-size: 13px;
        padding: 10px 12px;
    }

    .storage-info {
        display: none;
    }

    .content {
        padding: 20px;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .login-page {
        padding: 16px;
    }

    .login-left {
        padding: 40px 30px;
    }

    .login-header h1 {
        font-size: 28px;
    }

    .tabs {
        gap: 8px;
    }

    .tab {
        padding: 10px 16px;
        font-size: 14px;
    }

    .tab i {
        display: none;
    }

    .section h2 {
        font-size: 24px;
    }

    .files-table,
    .admin-table {
        font-size: 13px;
    }

    .files-table th,
    .admin-table th,
    .files-table td,
    .admin-table td {
        padding: 12px 8px;
    }

    .files-table button,
    .admin-table button {
        padding: 6px 12px;
        font-size: 12px;
        margin: 2px;
    }

    .viewer-controls,
    .editor-controls {
        flex-direction: column;
    }

    .editor-toolbar {
        flex-wrap: wrap;
    }

    .editor-toolbar button {
        flex: 1;
        min-width: 120px;
    }

    .profile-form,
    .notification-form,
    .settings-section {
        padding: 24px;
    }

    .sidebar {
        flex-direction: column;
    }

    .logo {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .nav-menu {
        margin-left: 0;
        flex-direction: column;
    }

    .nav-menu li {
        min-width: 100%;
    }

    .nav-menu a {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .login-left {
        padding: 30px 20px;
    }

    .login-header i {
        font-size: 48px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .input-group input {
        padding: 12px 12px 12px 44px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 15px;
    }

    .content {
        padding: 16px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .files-table,
    .admin-table {
        display: block;
        overflow-x: auto;
    }

    .modal-content {
        width: 95%;
        padding: 24px;
        margin: 10% auto;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes zoomIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .sidebar,
    .viewer-controls,
    .editor-controls,
    button,
    .theme-toggle,
    .tabs,
    .wave {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    .section {
        display: block !important;
    }

    body {
        background: white;
    }
}

/* ==================== ACCESSIBILITY ==================== */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --shadow: rgba(0, 0, 0, 0.5);
    }

    [data-theme="dark"] {
        --border: #fff;
    }
}

/* ==================== UTILITIES ==================== */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-secondary {
    color: var(--text-secondary);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-100 {
    width: 100%;
}

.hidden {
    display: none;
}

/* ==================== CUSTOM COMPONENTS ==================== */
.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 16px var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.chip-primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.chip-success {
    background: rgba(0, 212, 170, 0.1);
    color: var(--success);
}

.chip-error {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error);
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-primary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-button {
    height: 40px;
    border-radius: 12px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-lg);
    padding: 8px 0;
    z-index: 1000;
    min-width: 180px;
    border: 1px solid var(--border);
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.context-menu-item:hover {
    background: var(--bg-tertiary);
}

.context-menu-item i {
    font-size: 18px;
}

.context-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Status Indicators */
.status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    background: var(--success);
}

.status-offline {
    background: var(--text-secondary);
}

.status-busy {
    background: var(--error);
}

.status-away {
    background: var(--warning);
}

/* Progress Circle */
.progress-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, var(--bg-tertiary) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary);
    position: absolute;
}

.progress-circle span {
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: 14px;
}

/* ==================== DASHBOARD IMPROVEMENTS ==================== */

/* Sidebar Improvements */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

.logo i {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    display: none;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 24px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details p {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
}

.sidebar-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.theme-toggle-btn {
    flex: 0;
    padding: 10px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background: var(--primary);
    color: white;
}

.theme-toggle-btn i {
    font-size: 20px;
}

.logout-btn {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 107, 107, 0.1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--error);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
}

.logout-btn:hover {
    background: var(--error);
    color: white;
}

.logout-btn i {
    font-size: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Content Header */
.content-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.header-title p {
    font-size: 14px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
}

.icon-btn i {
    font-size: 20px;
}

/* Content Body */
.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Section Toolbar */
.section-toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.toolbar-actions {
    display: flex;
    gap: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.stat-icon.success {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
}

.stat-icon.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
}

.stat-details h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-details p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Card */
.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header i {
    font-size: 22px;
}

.card-body {
    padding: 24px;
}

.btn-icon {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-name i {
    font-size: 24px;
    color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-tertiary);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.upload-zone i {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: 16px;
    display: block;
}

.upload-zone h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Upload Progress */
.upload-progress {
    margin-top: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-info span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
}

.info-item i {
    font-size: 20px;
    color: var(--success);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 212, 170, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-primary i,
.btn-secondary i,
.btn-success i {
    font-size: 18px;
}

/* Form Controls */
.form-control,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

/* Viewer/Editor Controls */
.viewer-controls,
.editor-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.viewer-controls select,
.editor-controls select {
    flex: 1;
    min-width: 200px;
}

.viewer-controls button,
.editor-controls button {
    width: auto;
}

.viewer-container,
.pdf-container {
    min-height: 400px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.pdf-container {
    max-height: 600px;
    overflow-y: auto;
    display: block;
    padding: 0;
}

.pdf-container canvas {
    display: block;
    margin: 0 auto 16px;
}

/* Notifications List */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.notification-item.unread {
    background: rgba(102, 126, 234, 0.05);
    border-left-color: var(--primary);
}

.notification-item:hover {
    transform: translateX(4px);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.notification-icon.active {
    background: var(--primary);
    color: white;
}

.notification-content {
    flex: 1;
}

.notification-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.notification-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.notification-content small {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-content small i {
    font-size: 14px;
}

/* Profile Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Alert */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-info {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.alert i {
    font-size: 20px;
}

/* QR Grid */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.qr-display-dashboard {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.qr-display-dashboard img {
    max-width: 280px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
}

.qr-info-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.qr-info-text i {
    font-size: 16px;
}

/* Steps List */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    border-left: 4px solid var(--success);
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 24px;
    flex-shrink: 0;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.error i {
    color: var(--error);
}

.toast.info {
    border-left-color: var(--primary);
}

.toast.info i {
    color: var(--primary);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.warning i {
    color: var(--warning);
}

.toast span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .nav-menu span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .storage-info p,
.sidebar.collapsed .storage-header span,
.sidebar.collapsed .logout-btn span {
    display: none;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .nav-menu a {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .badge {
    top: 8px;
    right: 8px;
    transform: none;
}

.sidebar.collapsed .sidebar-actions {
    flex-direction: column;
}

.sidebar.collapsed .logout-btn {
    padding: 10px;
}

/* ==================== RESPONSIVE DASHBOARD ==================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-body {
        padding: 24px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }

    .sidebar-toggle {
        display: block;
    }

    .content-header {
        padding: 20px 24px;
    }

    .header-title h1 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 12px var(--shadow-lg);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .content-header {
        padding: 16px 20px;
    }

    .header-title h1 {
        font-size: 20px;
    }

    .header-title p {
        display: none;
    }

    .header-actions {
        display: none;
    }

    .content-body {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-toolbar {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .toolbar-actions button {
        flex: 1;
    }

    .card-header {
        padding: 16px 20px;
        flex-wrap: wrap;
    }

    .card-body {
        padding: 20px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }

    .file-name span {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .upload-zone {
        padding: 40px 20px;
    }

    .upload-zone i {
        font-size: 48px;
    }

    .upload-zone h3 {
        font-size: 18px;
    }

    .viewer-controls,
    .editor-controls {
        flex-direction: column;
    }

    .viewer-controls select,
    .editor-controls select {
        width: 100%;
    }

    .editor-toolbar {
        flex-direction: column;
    }

    .editor-toolbar button {
        width: 100%;
    }

    .profile-grid,
    .qr-grid {
        grid-template-columns: 1fr;
    }

    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .content-header {
        padding: 12px 16px;
    }

    .header-title h1 {
        font-size: 18px;
    }

    .content-body {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .stat-details h3 {
        font-size: 24px;
    }

    .card-header h3 {
        font-size: 16px;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .btn-primary,
    .btn-secondary,
    .btn-success {
        padding: 10px 20px;
        font-size: 14px;
    }

    .upload-zone {
        padding: 30px 16px;
    }

    .viewer-container,
    .pdf-container {
        min-height: 300px;
    }

    .qr-display-dashboard {
        min-height: 250px;
    }

    .qr-display-dashboard img {
        max-width: 220px;
    }
}

/* Empty State in Dashboard */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
    display: block;
}

.empty-state p {
    font-size: 14px;
}

/* QR Loader in Dashboard */
.qr-loader {
    text-align: center;
    color: var(--text-secondary);
}

.qr-loader i {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--primary);
}

.qr-loader p {
    font-size: 14px;
}

/* Chip variations for file types */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chip-PDF {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error);
}

.chip-Imagen {
    background: rgba(0, 212, 170, 0.1);
    color: var(--success);
}

.chip-Video {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.chip-Word {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
}

.chip-Excel {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.chip-Texto {
    background: rgba(158, 158, 158, 0.1);
    color: #757575;
}

.chip-Otro {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

/* Smooth Scrollbar */
.content-body::-webkit-scrollbar,
.pdf-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.content-body::-webkit-scrollbar-track,
.pdf-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.content-body::-webkit-scrollbar-thumb,
.pdf-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.content-body::-webkit-scrollbar-thumb:hover,
.pdf-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.section.active {
    animation: slideInRight 0.4s ease;
}

/* Loading State for Cards */
.card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Focus visible for better accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles for dashboard */
@media print {
    .sidebar,
    .content-header,
    .section-toolbar,
    .action-buttons,
    button,
    .toast {
        display: none !important;
    }

    .main-content {
        width: 100%;
    }

    .content-body {
        padding: 0;
    }

    .card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ==================== QR SCANNER ==================== */
.qr-scanner-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    min-height: 400px;
    margin: 0 auto 24px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrVideo {
    width: 100%;
    height: auto;
    display: none;
    border-radius: 16px;
}

.qr-scanner-container.scanning #qrVideo {
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.qr-scanner-container:not(.scanning) .scanner-overlay {
    background: transparent;
}

.scanner-frame {
    width: 280px;
    height: 280px;
    position: relative;
    margin-bottom: 20px;
}

.scanner-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid var(--success);
}

.scanner-corner.tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 12px;
}

.scanner-corner.tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 12px;
}

.scanner-corner.bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 12px;
}

.scanner-corner.br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 12px;
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(277px);
    }
}

.qr-scanner-container:not(.scanning) .scanner-line {
    display: none;
}

.scanner-text {
    color: white;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    padding: 0 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.qr-scanner-container:not(.scanning) .scanner-text {
    color: var(--text-secondary);
    text-shadow: none;
}

.scanner-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.scan-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    color: var(--primary);
    font-weight: 500;
}

.scan-status i {
    font-size: 24px;
}

/* QR Scanner Responsive */
@media (max-width: 768px) {
    .qr-scanner-container {
        min-height: 350px;
    }

    .scanner-frame {
        width: 220px;
        height: 220px;
    }

    .scanner-corner {
        width: 30px;
        height: 30px;
    }

    @keyframes scan {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(217px);
        }
    }
}

@media (max-width: 480px) {
    .qr-scanner-container {
        min-height: 300px;
    }

    .scanner-frame {
        width: 180px;
        height: 180px;
    }

    .scanner-corner {
        width: 25px;
        height: 25px;
        border-width: 3px;
    }

    @keyframes scan {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(177px);
        }
    }

    .scanner-controls {
        flex-direction: column;
    }

    .scanner-controls button {
        width: 100%;
    }
}

/* ==================== ADMIN DASHBOARD STYLES ==================== */
.admin-dashboard .sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.admin-logo {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-user-info {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.admin-avatar {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.admin-dashboard .nav-menu a.active {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.admin-dashboard .nav-menu a:hover {
    background: rgba(231, 76, 60, 0.1);
}

.admin-header {
    background: var(--bg-secondary);
    border-bottom: 2px solid #e74c3c;
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell i {
    font-size: 24px;
    color: var(--primary);
}

/* Storage Cell */
.storage-cell {
    min-width: 150px;
}

.storage-cell span {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
}

.mini-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #00b894 100%);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Notification Grid */
.notification-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Notification Templates */
.notification-templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.template-item {
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    border: 2px solid transparent;
}

.template-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.template-item i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.template-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.template-item p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Settings Divider */
.settings-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 600;
}

.settings-divider i {
    font-size: 20px;
    color: var(--primary);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--bg-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label i {
    font-size: 18px;
    color: var(--primary);
}

/* System Info */
.system-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.info-label i {
    font-size: 18px;
    color: var(--primary);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Button Variants */
.btn-danger {
    background: var(--error) !important;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 8px;
}

/* Modal Header */
/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    color: var(--text-primary);
}

.modal-header i {
    font-size: 24px;
    color: var(--primary);
}

.modal-header .close {
    position: static;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-tertiary);
    margin: 0;
}

.modal-body {
    padding: 0;
}

/* Responsive Admin */
@media (max-width: 1024px) {
    .notification-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .notification-templates {
        grid-template-columns: 1fr;
    }

    .template-item {
        padding: 16px;
    }

    .admin-dashboard .data-table {
        font-size: 12px;
    }

    .user-cell span {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .storage-cell {
        min-width: 120px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-buttons button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-actions {
        width: 100%;
    }

    .card-actions button {
        flex: 1;
    }
}