:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --bg-color: #f7fafc;
    --sidebar-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #7c3aed;
    --primary-dark: #6d28d9;
    --secondary-color: #a855f7;
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Better scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

/* Touch feedback for interactive elements */
button, a, .file-card, .list-item, .nav-item, .btn {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
}

/* Auth Screen */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-container {
    background: var(--sidebar-bg);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.auth-logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 15px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
    min-height: 44px; /* iOS minimum touch target */
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-option.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-secondary);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    min-height: 44px; /* iOS touch target minimum */
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--sidebar-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0 !important;
    border-radius: 50% !important;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    padding: 12px;
    background: rgba(245, 101, 101, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--error-color);
}

/* App Layout */
#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

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

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
}

.btn-upload {
    margin-bottom: 12px;
    width: 100%;
}

.btn-upload-folder {
    margin-bottom: 24px;
    width: 100%;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 44px; /* iOS touch target */
    font-size: 15px;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-color);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    padding-bottom: 24px;
    border-top: 1px solid var(--border-color);
}

.storage-info {
    margin-bottom: 16px;
}

.storage-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.storage-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.storage-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

/* User Controls in Header */
.user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

.user-profile-btn {
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
}

.user-avatar-small {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
    overflow: hidden;
    position: relative;
}

.user-avatar-small.has-photo {
    background: none;
    padding: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-small svg {
    width: 18px;
    height: 18px;
}

.user-avatar-small:hover {
    transform: scale(1.05);
}

.logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0 !important;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: var(--border-color);
}

/* Profile Photo Section in Modal */
.profile-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
}

.current-profile-photo {
    position: relative;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 36px;
    overflow: hidden;
    position: relative;
}

.user-avatar-large.has-photo {
    background: none;
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-large svg {
    width: 40px;
    height: 40px;
}

.profile-photo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Old sidebar user-info styles (kept for backwards compatibility if needed) */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:not(.active) {
    cursor: pointer;
}

.breadcrumb-item:not(.active):hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

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

.top-bar-actions .btn-icon:not(.user-profile-btn) {
    background: transparent !important;
    color: var(--text-primary);
}

.top-bar-actions .btn-icon:not(.user-profile-btn):hover {
    background: rgba(102, 126, 234, 0.1) !important;
    color: var(--primary-color);
}

.top-bar-actions .btn-icon.active:not(.user-profile-btn) {
    background: rgba(102, 126, 234, 0.15) !important;
    color: var(--primary-color);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: var(--sidebar-bg);
}

.search-box input {
    border: none;
    background: transparent;
    font-size: 14px;
    width: 250px;
    font-family: inherit;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-box input:focus {
    outline: none;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 8px;
}

.view-toggle .btn-icon {
    padding: 0;
}

.view-toggle .btn-icon.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary-color);
}

[data-theme="dark"] .view-toggle .btn-icon.active {
    background: var(--primary-color);
    color: white;
}

/* Theme Switch - iOS Style */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: .4s;
    border-radius: 31px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch input:checked + .theme-slider {
    background-color: #667eea;
}

.theme-switch input:checked + .theme-slider:before {
    transform: translateX(20px);
}

/* Dark mode - moon icon on slider */
.theme-slider:after {
    content: "☀️";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.2s;
}

.theme-switch input:checked + .theme-slider:after {
    content: "🌙";
    left: auto;
    right: 8px;
}

/* Files Container */
.files-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* List View */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.files-list-header {
    display: grid;
    grid-template-columns: 40px 1fr 120px 150px 100px 40px;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.list-item {
    display: grid;
    grid-template-columns: 40px 1fr 120px 150px 100px 40px;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    align-items: center;
}

.list-item:hover {
    background: var(--bg-color);
}

.list-item-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item-icon svg {
    width: 24px;
    height: 24px;
}

/* Carpetas en lista con mayor intensidad */
.list-item[data-folder-id] .list-item-icon svg {
    opacity: 0.9;
    stroke-width: 2.5;
}

.list-item-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-size,
.list-item-date,
.list-item-owner {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-menu {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-card {
    background: var(--sidebar-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-card.has-thumbnail {
    padding: 0;
    overflow: hidden;
}

.file-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-loader {
    font-size: 24px;
    opacity: 0.3;
}

.file-card.has-thumbnail .file-name,
.file-card.has-thumbnail .file-meta {
    padding: 0 16px;
}

.file-card.has-thumbnail .file-name {
    margin-top: 12px;
}

.file-card.has-thumbnail .file-meta {
    margin-bottom: 16px;
}

.file-icon {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 0;
    position: relative;
}

/* Fondo adaptativo para carpetas en modo oscuro */
[data-theme="dark"] .file-card[data-folder-id] .file-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0.08;
    border-radius: 12px;
    pointer-events: none;
}

.file-icon svg {
    width: 120px;
    height: 120px;
    opacity: 0.3;
    display: block;
    position: relative;
    z-index: 1;
}

/* Carpetas con mayor intensidad de color */
.file-card[data-folder-id] .file-icon svg {
    opacity: 0.85;
    stroke-width: 2.5;
}

.file-icon svg.adobe-icon {
    opacity: 1;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    margin-top: 12px;
    padding: 0 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 56px 0 16px; /* Padding derecho para el botón de menú */
    margin-bottom: 4px;
}

/* Badge de compartido */
.shared-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 16px;
    margin: 0 16px 12px 16px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 6px;
    text-align: left;
}

[data-theme="dark"] .shared-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #a5b4fc;
}

.shared-badge.shared-by-me {
    background: rgba(72, 187, 120, 0.1);
    color: #16a34a;
}

[data-theme="dark"] .shared-badge.shared-by-me {
    background: rgba(72, 187, 120, 0.2);
    color: #86efac;
}

.file-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 1; /* Siempre visible */
    transition: opacity 0.2s;
    z-index: 10;
    pointer-events: auto;
}

.file-menu .btn-icon,
.file-menu-btn,
.folder-menu-btn {
    background: var(--primary-color) !important;
    color: white !important;
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    z-index: 11;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50% !important;
    padding: 0 !important;
}

.file-menu .btn-icon:hover,
.file-menu-btn:hover,
.folder-menu-btn:hover {
    background: var(--primary-color) !important;
    color: white !important;
    opacity: 0.9;
}

.file-menu .btn-icon svg,
.file-menu-btn svg,
.folder-menu-btn svg {
    color: white !important;
    stroke: white !important;
    pointer-events: none;
}

.file-card:hover .file-menu {
    opacity: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--sidebar-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

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

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* File Menu Options */
.file-menu-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    width: 100%;
    min-height: 48px; /* Larger touch target */
}

.menu-option:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.menu-option:active {
    transform: translateX(2px);
}

.menu-option.danger {
    background: #fee;
    color: #c00;
}

.menu-option.danger:hover {
    background: #c00;
    color: white;
}

.menu-option svg {
    flex-shrink: 0;
}

/* File Info Details */
.file-info-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-value {
    color: var(--text-primary);
    font-size: 14px;
    text-align: right;
    word-break: break-all;
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    background: var(--sidebar-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideInUp 0.3s ease;
}

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

.upload-progress-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.upload-progress-header h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.btn-close-progress {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-progress:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.upload-progress-body {
    padding: 20px;
}

.current-file {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

/* Mobile FAB (Floating Action Button) */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 999;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-fab:active {
    transform: scale(0.95);
}

.mobile-fab svg {
    width: 28px;
    height: 28px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Drag & Drop */
.drop-zone {
    border: 2px dashed var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: var(--bg-color);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 968px) {
    .auth-container {
        padding: 32px 24px;
        max-width: 95%;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    #app {
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
        padding-bottom: 100px; /* Espacio para la barra de navegación del móvil */
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        width: 100%;
    }

    .top-bar {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .breadcrumb {
        flex: 1;
        min-width: 0;
    }

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

    .top-bar-actions {
        width: 100%;
        margin-top: 12px;
        flex-wrap: wrap;
    }

    .search-box {
        flex: 1;
        min-width: 200px;
    }

    .search-box input {
        width: 100%;
    }

    .view-toggle {
        order: -1;
    }

    .files-container {
        padding: 16px;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .file-card {
        padding: 12px;
    }

    .file-thumbnail {
        height: 120px;
    }

    .file-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }

    .file-name {
        font-size: 13px;
    }

    .file-meta {
        font-size: 11px;
    }

    /* List view mobile */
    .files-list-header {
        display: none;
    }

    .list-item {
        grid-template-columns: 40px 1fr 40px;
        gap: 12px;
        padding: 12px;
    }

    .list-item-size,
    .list-item-date,
    .list-item-owner {
        display: none;
    }

    .list-item-name {
        font-size: 13px;
    }

    /* Modals */
    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-large,
    .modal-lg {
        max-width: 100%;
    }

    .modal-header {
        padding: 20px 16px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    /* Preview Modal */
    .preview-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .preview-header {
        padding: 16px;
    }

    .preview-header h3 {
        font-size: 16px;
        max-width: calc(100vw - 150px);
    }

    .preview-content {
        padding: 12px;
        max-height: calc(100vh - 80px);
    }

    .preview-image,
    .preview-video {
        max-height: calc(100vh - 100px);
    }

    .preview-pdf {
        width: 100vw;
        height: calc(100vh - 100px);
    }

    /* Upload Progress */
    .upload-progress {
        width: calc(100vw - 32px);
        bottom: 16px;
        right: 16px;
    }

    .upload-progress-header {
        padding: 12px 16px;
    }

    .upload-progress-body {
        padding: 16px;
    }

    /* Toast */
    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }

    /* Admin View */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
    }

    .stat-value {
        font-size: 24px;
    }

    .admin-section {
        padding: 16px;
    }

    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    .users-table {
        min-width: 800px;
        font-size: 13px;
    }

    .users-table th,
    .users-table td {
        padding: 12px;
    }

    .user-avatar-small {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .badge {
        padding: 3px 8px;
        font-size: 11px;
    }

    .btn-icon-small {
        width: 36px;
        height: 36px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Mostrar FAB en móviles */
    .mobile-fab {
        display: flex;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .auth-container {
        padding: 24px 16px;
    }

    .auth-logo h1 {
        font-size: 24px;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .file-card {
        padding: 8px;
    }

    .file-thumbnail {
        height: 100px;
        margin-bottom: 8px;
    }

    .file-name {
        font-size: 12px;
    }

    .breadcrumb-item {
        max-width: 80px;
    }

    .search-box {
        min-width: 150px;
    }

    .admin-view {
        padding: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 12px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
        padding: 20px;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .search-box input {
        width: 200px;
    }
}

/* Modal Large for Share */
.modal-large {
    max-width: 600px;
}

/* Share Tabs */
.share-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.share-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
    white-space: nowrap;
    min-height: 44px;
    font-size: 15px;
}

.share-tab:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.05);
}

.share-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Share Tab Content */
.share-tab-content {
    display: none;
}

.share-tab-content.active {
    display: block;
}

/* Link Preview Section */
.link-preview-section {
    margin-bottom: 20px;
}

.link-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.link-container:has(#shareLink:not([style*="display: none"])) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-color: var(--primary-color);
}

.link-container-direct {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(22, 163, 74, 0.05));
    border-color: #22c55e;
}

.share-link-input {
    flex: 1;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--primary-color);
    min-height: auto;
}

.share-link-input:focus {
    outline: none;
    border: none;
}

.no-link-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    flex: 1;
}

.no-link-placeholder svg {
    opacity: 0.5;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-icon:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Link Config Section */
.link-config-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-option-header label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.config-help {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    padding-left: 30px;
    line-height: 1.4;
}

.config-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.share-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

/* Link Options Grid */
.link-options-grid {
    display: grid;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03));
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    margin-top: 4px;
}

/* Compact Form Elements */
.form-input-compact,
.form-select-compact {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: all 0.2s;
    min-height: auto;
}

.form-input-compact:focus,
.form-select-compact:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input-compact:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Link Actions */
.link-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
}

.btn-compact {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: auto;
}

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

.btn-update:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-revoke {
    background: var(--sidebar-bg);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.btn-revoke:hover:not(:disabled) {
    background: var(--error-color);
    color: white;
    transform: translateY(-1px);
}

.btn-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Form Elements */
.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-color);
    color: var(--text-primary);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-input:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* User Search Results */
.user-search-results {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: none;
    -webkit-overflow-scrolling: touch;
}

.user-search-results.active {
    display: block;
}

.user-result {
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px; /* Better touch target */
}

.user-result:hover,
.user-result:active {
    background: var(--bg-secondary);
}

.user-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-result-info {
    flex: 1;
}

.user-result-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-result-email {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Shared Users Section */
.shared-users-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.shared-users-section h4 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.shared-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shared-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.shared-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.shared-user-info {
    flex: 1;
}

.shared-user-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.shared-user-permission {
    font-size: 12px;
    color: var(--text-secondary);
}

.shared-user-actions {
    display: flex;
    gap: 8px;
}

.btn-remove-user {
    padding: 6px 12px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.2s;
}

.btn-remove-user:hover {
    opacity: 0.9;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

/* Modal de Vista Previa */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.preview-container {
    position: relative;
    z-index: 10001;
    background: var(--bg-color);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 600px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.preview-content {
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: calc(90vh - 80px);
}

.preview-image {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    border-radius: 8px;
}

.preview-video {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    border-radius: 8px;
}

.video-container {
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-error-message {
    max-width: 500px;
}

.video-error-message svg {
    display: block;
}

.preview-pdf {
    width: 80vw;
    height: calc(90vh - 120px);
    border-radius: 8px;
}

.preview-close {
    color: var(--text-secondary);
}

.preview-close:hover {
    color: var(--error-color);
}

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ==========================================
   ESTILOS DE ADMINISTRACIÓN
   ========================================== */

.admin-view {
    padding: 24px;
}

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

.admin-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--sidebar-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.admin-section {
    background: var(--sidebar-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: var(--text-color);
}

.users-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
}

.users-table thead {
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.users-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.users-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.users-table tbody tr:hover {
    background: var(--bg-color);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-name-table {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
}

.user-email-table {
    font-size: 13px;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-purple {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-blue {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-green {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-yellow {
    background: #fff9c4;
    color: #f57f17;
}

.badge-gray {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.storage-cell {
    font-size: 13px;
}

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

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-small {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.btn-icon-small.btn-danger:hover {
    background: #ffebee;
    color: #c62828;
}

.modal-lg {
    max-width: 600px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .users-table-container {
        overflow-x: scroll;
    }
    
    .users-table {
        min-width: 800px;
    }
}

/* ==========================================
   ANALYTICS Y ESTADÍSTICAS
   ========================================== */

.analytics-view {
    padding: 20px;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.analytics-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.analytics-subtitle {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 14px;
}

.period-selector {
    display: flex;
    gap: 8px;
    background: white;
    padding: 4px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.period-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
}

.period-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

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

/* Tarjetas de Resumen */
.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.summary-detail {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Gráficas */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Tablas de Estadísticas */
.stats-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

.stats-table-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.stats-table-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-responsive {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table thead {
    background: var(--bg-secondary);
}

.stats-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.stats-table tbody tr:hover {
    background: var(--bg-secondary);
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-cell svg {
    flex-shrink: 0;
}

.usage-bar {
    display: inline-block;
    width: 100px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 8px;
}

.usage-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.usage-percent {
    font-size: 13px;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.badge-success {
    background: rgba(67, 233, 123, 0.1);
    color: #43e97b;
}

.badge-warning {
    background: rgba(254, 225, 64, 0.1);
    color: #f39c12;
}

.badge-info {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.text-center {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-tables {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .analytics-header {
        flex-direction: column;
    }
    
    .period-selector {
        width: 100%;
        justify-content: stretch;
    }
    
    .period-btn {
        flex: 1;
    }
    
    .analytics-summary {
        grid-template-columns: 1fr;
    }
    
    .stats-table {
        font-size: 13px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 10px 12px;
    }
}
