/**
 * ARQUIVE PRO - Estilos Principais
 * Design moderno, responsivo e profissional
 * 
 * @version 1.0.0
 */

/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   Layout
   ======================================== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-layout,
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

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

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

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

.nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Quando tem user-menu no footer (profile page) */
.sidebar-footer:has(.user-menu) {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-footer .theme-toggle {
    flex-shrink: 0;
}

.sidebar-footer .user-menu {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
}

.sidebar-footer .user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-footer .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.sidebar-footer .user-info .user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-footer .user-info .user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.storage-info {
    margin-bottom: 0.75rem;
}

.storage-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.storage-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 64px;
    gap: 1rem;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

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

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Main Header (usado em profile e outras páginas) */
.main-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 64px;
    gap: 1rem;
}

.main-header .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.main-header .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-box {
    position: relative;
    width: 400px;
    max-width: 100%;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 42px;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box > svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--bg-tertiary);
}

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

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ========================================
   Stats Cards
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    width: 100%;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.blue {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ========================================
   File Grid
   ======================================== */
.content-area {
    padding: 1rem;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: var(--radius);
}

.view-toggle button {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.view-toggle button.active {
    background: var(--bg-primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    min-height: 300px;
}

/* Visualização em Lista */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 200px;
    width: 100%;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.file-row:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.file-row.expanded {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.file-row-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--primary);
}

.file-row-icon svg {
    width: 18px;
    height: 18px;
}

.file-row-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.file-row-size {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.file-row-stats {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.file-row-date {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    display: none;
}

.file-row-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.375rem;
    opacity: 0;
    transition: var(--transition);
}

.file-row:hover .file-row-actions {
    opacity: 1;
}

.file-row-actions .file-action-btn {
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile: botões sempre visíveis e maiores */
@media (max-width: 768px) {
    .file-row-actions {
        opacity: 1;
        gap: 0.5rem;
    }
    
    .file-row-actions .file-action-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
    }
    
    .file-row-actions .file-action-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .file-row {
        flex-wrap: wrap;
        padding: 0.75rem;
    }
    
    .file-row-name {
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }
    
    .file-row-size {
        flex: 1;
    }
    
    .file-row-stats {
        display: none;
    }
}

.file-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.file-card.expanded {
    overflow: visible;
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

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

.file-preview {
    height: 140px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.file-preview .file-icon {
    width: 64px;
    height: 64px;
    color: var(--gray-400);
    stroke-width: 1.5;
}

/* Cores específicas por tipo de arquivo */
.file-preview .file-icon.video-icon {
    color: var(--danger);
}

.file-preview .file-icon.image-icon {
    color: var(--success);
}

.file-preview .file-icon.document-icon {
    color: var(--primary);
}

.file-preview .file-icon.archive-icon {
    color: var(--warning);
}

.file-info {
    padding: 1rem;
}

.file-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file-meta .file-size {
    white-space: nowrap;
}

.file-meta .file-stats {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 1;
    transition: var(--transition);
}

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

.file-action-btn {
    padding: 0.375rem;
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-action-btn:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
}

/* Botões de ação maiores no mobile */
@media (max-width: 768px) {
    .file-actions {
        opacity: 1; /* Sempre visível no mobile */
        gap: 0.25rem;
        flex-wrap: nowrap;
    }
    
    .file-action-btn {
        min-width: 36px;
        min-height: 36px;
        width: 36px;
        height: 36px;
        padding: 0.25rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        flex-shrink: 0;
    }
    
    .file-action-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .file-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-meta .file-actions {
        width: 100%;
        justify-content: center;
    }
    
    /* Botões na visualização de lista também */
    .file-row-actions {
        gap: 0.25rem;
        flex-wrap: nowrap;
    }
    
    .file-row-actions .file-action-btn {
        min-width: 36px;
        min-height: 36px;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    /* Aumenta um pouco o card no mobile para caber os botões */
    .file-card {
        min-height: 240px;
    }
    
    .file-info {
        padding: 0.75rem;
    }
}

/* ========================================
   Folder Cards
   ======================================== */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Folder List View */
.folder-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.folder-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}

.folder-row:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.folder-row-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-row-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.folder-row-count {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.folder-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.folder-card:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.folder-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.folder-icon svg {
    width: 28px;
    height: 28px;
}

.folder-info {
    flex: 1;
    min-width: 0;
}

.folder-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   Upload Zone
   ======================================== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    text-align: center;
    background: var(--bg-primary);
    transition: var(--transition);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.upload-zone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    color: var(--primary);
}

.upload-zone-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-zone-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.upload-zone-text span {
    color: var(--primary);
    font-weight: 500;
}

/* Upload Formats Display */
.upload-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.format-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.5rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.format-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.format-badge.image {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.format-badge.video {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.format-badge.audio {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.format-badge.document {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.format-badge.archive {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.3);
}

.upload-limit {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ========================================
   Confirm Modal (Modern)
   ======================================== */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.confirm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    padding: 0;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.confirm-modal-overlay.active .confirm-modal {
    transform: scale(1) translateY(0);
}

.confirm-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 1rem;
}

.confirm-modal-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.confirm-modal-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.confirm-modal-icon.info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.confirm-modal-icon svg {
    width: 32px;
    height: 32px;
}

.confirm-modal-content {
    text-align: center;
    padding: 0 2rem 1.5rem;
}

.confirm-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.confirm-modal-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.confirm-modal-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.confirm-modal-actions .btn-cancel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.confirm-modal-actions .btn-cancel:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.confirm-modal-actions .btn-confirm {
    background: var(--danger);
    color: white;
    border: none;
}

.confirm-modal-actions .btn-confirm:hover {
    background: #dc2626;
}

.confirm-modal-actions .btn-confirm.primary {
    background: var(--primary);
}

.confirm-modal-actions .btn-confirm.primary:hover {
    background: var(--primary-dark);
}

/* Dark mode adjustments */
[data-theme="dark"] .confirm-modal {
    background: var(--bg-primary);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .confirm-modal-actions {
    background: var(--bg-secondary);
}

[data-theme="dark"] .confirm-modal-actions .btn-cancel {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.form-link {
    display: block;
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 0.5rem;
    text-decoration: none;
}

.form-link:hover {
    text-decoration: underline;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.375rem;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
    accent-color: var(--primary);
}

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

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

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

.auth-logo .logo {
    justify-content: center;
}

.auth-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   Alerts
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

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

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

/* ========================================
   Progress Bar
   ======================================== */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

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

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--gray-300);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1; /* Ocupa todas as colunas do grid */
    width: 100%;
}

.file-list .empty-state,
.file-list .loading-state {
    width: 100%;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--gray-300);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ========================================
   Loading State
   ======================================== */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1; /* Ocupa todas as colunas do grid */
    width: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   File Preview Modal
   ======================================== */
.preview-modal .modal {
    max-width: 900px;
    width: 95%;
}

.preview-container {
    background: var(--gray-900);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
}

.preview-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.preview-container video {
    max-width: 100%;
    width: 100%;
    max-height: 70vh;
    display: block;
    background: #000;
}

.preview-container iframe {
    width: 100%;
    height: 70vh;
    border: none;
}

/* Mobile Preview */
@media (max-width: 768px) {
    .preview-modal .modal {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .preview-container {
        min-height: 200px;
        padding: 0.5rem;
    }
    
    .preview-container img {
        max-height: 60vh;
    }
    
    .preview-container video {
        max-height: 50vh;
        width: 100%;
    }
    
    .preview-container iframe {
        height: 60vh;
    }
}

/* ========================================
   Inline Preview (Expansão no próprio card)
   ======================================== */
.file-card.expanded,
.file-row.expanded {
    position: relative;
    z-index: 100;
}

.file-card.expanded {
    grid-column: 1 / -1; /* Expande para ocupar toda a largura em grid */
    max-width: 100%;
}

.inline-preview {
    position: relative;
    width: 100%;
    background: var(--gray-900);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: visible;
    animation: fadeIn 0.3s ease-out;
}

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

.inline-preview-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 200px;
}

.inline-preview-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    cursor: zoom-in;
}

.inline-preview-content video {
    max-width: 100%;
    width: 100%;
    max-height: 70vh;
    background: #000;
    border-radius: var(--radius-sm);
}

/* Suporte a fullscreen do vídeo */
.inline-preview-content video:fullscreen,
.inline-preview-content video:-webkit-full-screen,
.inline-preview-content video:-moz-full-screen,
.inline-preview-content video:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    object-fit: contain;
}

/* Botão fechar isolado (fallback) */
.inline-preview-content > .inline-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.inline-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.inline-close-btn:hover {
    background: rgba(255, 70, 70, 0.9);
    transform: scale(1.1);
}

/* Ajustes para modo lista */
.file-row.expanded {
    flex-wrap: wrap;
}

.file-row.expanded .inline-preview {
    flex-basis: 100%;
    border-radius: 0;
    margin-top: 0.5rem;
}

/* Mobile - Inline Preview */
@media (max-width: 768px) {
    .file-card.expanded {
        position: relative;
        margin-bottom: 1rem;
    }
    
    .inline-preview-content {
        padding: 0.5rem;
        min-height: 150px;
    }
    
    .inline-preview-content img {
        max-height: 50vh;
        border-radius: var(--radius-sm);
    }
    
    .inline-preview-content video {
        max-height: 50vh;
        border-radius: var(--radius-sm);
    }
    
    .inline-close-btn {
        width: 44px;
        height: 44px;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .inline-fullscreen-btn {
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   Fullscreen Overlay (Tela Cheia Custom)
   ======================================== */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.fullscreen-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.fullscreen-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 10;
}

.fullscreen-title {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.fullscreen-close-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fullscreen-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.fullscreen-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 1rem 1rem;
    overflow: auto;
}

.fullscreen-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.fullscreen-media video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    background: #000;
}

/* Dica de rotação */
.rotate-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    color: white;
    font-size: 0.85rem;
    animation: pulse 2s infinite;
    z-index: 10;
}

.rotate-hint svg {
    animation: rotate-icon 1.5s ease-in-out infinite;
}

@keyframes rotate-icon {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

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

/* Controles Inline */
.inline-controls {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.inline-fullscreen-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.inline-fullscreen-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.inline-controls .inline-close-btn {
    position: static;
}

/* Landscape mode - ajustes */
@media (orientation: landscape) {
    .fullscreen-media {
        padding: 50px 2rem 1rem;
    }
    
    .rotate-hint {
        display: none;
    }
}

/* Mobile Fullscreen */
@media (max-width: 768px) {
    .fullscreen-header {
        padding: 0.75rem;
    }
    
    .fullscreen-title {
        font-size: 0.9rem;
        max-width: 60%;
    }
    
    .fullscreen-close-btn {
        width: 44px;
        height: 44px;
    }
    
    .fullscreen-media {
        padding: 50px 0.5rem 0.5rem;
    }
    
    .rotate-hint {
        bottom: 20px;
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

/* ========================================
   Dropdown Menu
   ======================================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
}

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

.dropdown-item svg {
    width: 18px;
    height: 18px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Overlay para fechar sidebar em mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

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

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex !important;
    }
    
    .search-box {
        width: 100%;
        max-width: 300px;
    }
    
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        order: 1;
        width: 100%;
        flex-wrap: nowrap;
    }
    
    .menu-toggle {
        display: flex;
        order: 1;
        flex-shrink: 0;
    }
    
    .search-box {
        order: 2;
        flex: 1;
        min-width: 0;
        width: auto;
        max-width: none;
    }
    
    .search-box input {
        width: 100%;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem 0.5rem 2.25rem;
        height: 38px;
    }
    
    .search-box > svg {
        left: 0.625rem;
        width: 16px;
        height: 16px;
    }
    
    .header-right {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
        padding-top: 0.25rem;
        flex-wrap: wrap;
    }
    
    /* Todos os botões do header-right */
    .header-right > * {
        flex-shrink: 0;
    }
    
    .icon-btn {
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .icon-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .theme-toggle {
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }
    
    .user-info {
        display: none;
    }
    
    /* Esconder texto do botão Upload no mobile */
    .btn-primary span {
        display: none;
    }
    
    .btn-primary {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
    }
    
    .btn-primary svg {
        width: 20px;
        height: 20px;
    }
    
    /* Reduzir padding do user-menu no mobile */
    .user-menu {
        padding: 0.375rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .file-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .folder-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .admin-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .admin-stat-card {
        padding: 0.75rem;
    }
    
    .admin-stat-value {
        font-size: 1.25rem;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table th,
    .admin-table td {
        white-space: nowrap;
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .content-area {
        padding: 0.75rem;
    }
    
    .profile-content {
        padding: 0.75rem;
    }
    
    .profile-section {
        padding: 0.75rem;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .modal {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }
    
    /* Upload zone */
    .upload-zone {
        padding: 1rem;
    }
    
    .upload-zone h3 {
        font-size: 1rem;
    }
    
    .upload-types {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .upload-type {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Files list */
    .file-item {
        padding: 0.75rem;
    }
    
    .file-name {
        font-size: 0.85rem;
    }
    
    .file-size {
        font-size: 0.75rem;
    }
    
    /* Section headers */
    .section-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .section-header h2,
    .section-header h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .file-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .folder-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .auth-card {
        padding: 1.25rem;
        margin: 0.5rem;
    }
    
    .auth-card h1 {
        font-size: 1.5rem;
    }
    
    .modal {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .header h1 {
        font-size: 1.1rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    .form-control,
    .form-input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .dropdown-menu {
        min-width: 180px;
    }
    
    .file-card {
        padding: 0.75rem;
    }
    
    .file-name {
        font-size: 0.8rem;
    }
    
    .file-meta {
        font-size: 0.7rem;
    }
    
    .confirm-modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .confirm-modal h3 {
        font-size: 1.1rem;
    }
    
    .confirm-modal p {
        font-size: 0.875rem;
    }
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Botões de ação coloridos para fácil identificação */
.file-action-btn[title="Download"],
.file-action-btn[title="Baixar"] {
    color: var(--success);
}

.file-action-btn[title="Compartilhar"],
.file-action-btn[title="Share"] {
    color: var(--primary);
}

.file-action-btn[title="Excluir"],
.file-action-btn[title="Delete"] {
    color: var(--danger);
}

.file-action-btn[title="Download"]:hover,
.file-action-btn[title="Baixar"]:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.file-action-btn[title="Compartilhar"]:hover,
.file-action-btn[title="Share"]:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.file-action-btn[title="Excluir"]:hover,
.file-action-btn[title="Delete"]:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Mobile: botões com fundo colorido sutil */
@media (max-width: 768px) {
    .file-action-btn[title="Download"],
    .file-action-btn[title="Baixar"] {
        background: rgba(16, 185, 129, 0.1);
        border-color: rgba(16, 185, 129, 0.3);
    }
    
    .file-action-btn[title="Compartilhar"],
    .file-action-btn[title="Share"] {
        background: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.3);
    }
    
    .file-action-btn[title="Excluir"],
    .file-action-btn[title="Delete"] {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ========================================
   Dark Mode
   ======================================== */
[data-theme="dark"] {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

[data-theme="dark"] .sidebar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .header {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .file-card,
[data-theme="dark"] .folder-card {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .upload-zone {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .modal {
    background: var(--bg-primary);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .auth-card {
    background: var(--bg-primary);
}

[data-theme="dark"] .toast {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .breadcrumb {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .file-card:hover,
[data-theme="dark"] .folder-card:hover,
[data-theme="dark"] .folder-row:hover {
    border-color: var(--primary);
}

[data-theme="dark"] .folder-row {
    background: var(--bg-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .preview-container {
    background: var(--bg-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    padding: 0;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Esconder ícones baseado no tema */
[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* ========================================
   Favoritos
   ======================================== */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    color: #fff;
    transition: var(--transition);
    opacity: 0;
    z-index: 10;
}

.file-card:hover .favorite-btn,
.favorite-btn.active {
    opacity: 1;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    color: var(--warning);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: var(--warning);
    background: rgba(0, 0, 0, 0.6);
}

.favorite-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Favorito em modo lista */
.file-action-btn.favorite-active {
    color: var(--warning);
}

.file-action-btn.favorite-active svg {
    fill: currentColor;
}

/* ========================================
   Tags/Etiquetas
   ======================================== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    cursor: pointer;
    transition: var(--transition);
}

.tag-remove:hover {
    background: var(--danger);
    color: white;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tag-input-wrapper {
    position: relative;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.tag-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.tag-suggestion:hover {
    background: var(--bg-tertiary);
}

/* ========================================
   Seleção Múltipla
   ======================================== */
.file-card.selectable {
    position: relative;
}

.file-checkbox {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
}

.file-card:hover .file-checkbox,
.file-card.selected .file-checkbox {
    opacity: 1;
}

.file-card.selected .file-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.file-card.selected .file-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.file-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Selection Toolbar */
.selection-toolbar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.selection-toolbar.active {
    opacity: 1;
    visibility: visible;
}

.selection-count {
    font-weight: 600;
    color: var(--primary);
}

.selection-actions {
    display: flex;
    gap: 0.5rem;
}

.selection-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.selection-btn.danger:hover {
    background: var(--danger);
}

/* ========================================
   Lixeira
   ======================================== */
.trash-notice {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trash-notice-icon {
    color: var(--danger);
}

.trash-notice-text {
    flex: 1;
}

.trash-notice-text strong {
    display: block;
    margin-bottom: 0.25rem;
}

.file-card.deleted,
.file-row.deleted {
    opacity: 0.7;
    border-color: var(--danger);
}

.file-card.deleted:hover,
.file-row.deleted:hover {
    opacity: 1;
}

/* ========================================
   Galeria de Imagens
   ======================================== */
.gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
}

.gallery-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-nav.prev {
    left: 2rem;
}

.gallery-nav.next {
    right: 2rem;
}

.gallery-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.875rem;
}

.gallery-thumbnails {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    max-width: 80vw;
    overflow-x: auto;
    padding: 0.5rem;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
}

/* ========================================
   QR Code
   ======================================== */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
}

.qr-code {
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.qr-code img {
    display: block;
}

.qr-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    word-break: break-all;
    text-align: center;
}

/* ========================================
   Admin Panel
   ======================================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table tr:hover {
    background: var(--bg-tertiary);
}

/* User Cards (Admin) */
.user-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

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

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

.user-card-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.user-card-stat {
    text-align: center;
}

.user-card-stat .stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.user-card-stat .stat-value {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-card-actions {
    display: flex;
    gap: 0.5rem;
}

.user-card-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.5rem;
}

.user-card-actions .btn-danger {
    flex: 0;
    padding: 0.5rem 0.75rem;
}

/* Melhorias UX Admin: badges, barra de storage, status, botoes */
.user-card-badges {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

.user-card-inactive {
    opacity: 0.6;
}

.user-storage-bar {
    height: 6px;
    background: var(--bg-tertiary, rgba(0,0,0,0.08));
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0 0.75rem;
}

.user-storage-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.user-card-actions .btn-warning {
    flex: 0;
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.user-card-actions .btn-success {
    flex: 0;
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.12);
    color: var(--success, #10b981);
}

.user-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.user-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.user-status.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray-600);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* ========================================
   User Details Modal
   ======================================== */
.user-details {
    padding: 1rem 0;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.user-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.user-header p {
    margin: 0;
    font-size: 0.875rem;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.user-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-info-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-info-item span:not(.label):not(.badge) {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 0.25rem;
}

.btn-group .btn {
    padding: 0.35rem 0.5rem;
}

/* ========================================
   Activity Log
   ======================================== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.upload { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.activity-icon.download { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.activity-icon.delete { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.activity-icon.share { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.activity-icon.view { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ========================================
   Responsividade Extra
   ======================================== */
@media (max-width: 1024px) {
    .selection-toolbar {
        left: 1rem;
        right: 1rem;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .gallery-nav.prev {
        left: 0.5rem;
    }
    
    .gallery-nav.next {
        right: 0.5rem;
    }
    
    .gallery-thumbnails {
        display: none;
    }
    
    .selection-btn span {
        display: none;
    }
    
    .admin-table {
        font-size: 0.875rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .format-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }
    
    .upload-formats {
        gap: 0.35rem;
    }
    
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Carregar Mais (Paginação)
   ======================================== */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    margin-top: 1rem;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 200px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.btn-load-more:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-load-more:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

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

/* ========================================
   Page Header (Páginas Específicas)
   ======================================== */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-lg);
}

.page-header-icon svg {
    width: 32px;
    height: 32px;
}

.page-header-info {
    flex: 1;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
}

/* Responsivo */
@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .page-header-icon {
        width: 48px;
        height: 48px;
    }
    
    .page-header-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
}

/* Fullscreen Stats */
.fullscreen-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.fullscreen-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    opacity: 0.8;
    flex-wrap: wrap;
}

.fullscreen-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.fullscreen-stats .stat-item svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .fullscreen-stats {
        font-size: 0.7rem;
        gap: 0.75rem;
    }
    
    .fullscreen-stats .stat-item svg {
        width: 12px;
        height: 12px;
    }
}


/* ========================================
   Novos Componentes - Melhorias Fase 1
   ======================================== */

/* Botão de ícone */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

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

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Mobile - botões maiores para facilitar toque */
@media (max-width: 768px) {
    .icon-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
}

/* Notificações */
.notifications-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.notifications-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
}

.btn-text:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: var(--bg-tertiary);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state svg {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Badge no menu */
.nav-link .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Dark Mode */
[data-theme="dark"] .icon-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .icon-btn:hover {
    background: var(--gray-800);
    color: var(--text-primary);
}

[data-theme="dark"] .notifications-dropdown {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .notifications-header {
    border-bottom-color: var(--gray-700);
}

[data-theme="dark"] .notification-item {
    border-bottom-color: var(--gray-700);
}

[data-theme="dark"] .notification-item:hover {
    background: var(--gray-700);
}

[data-theme="dark"] .notification-item.unread {
    background: var(--gray-700);
}

/* Mobile - Notificações em tela cheia */
@media (max-width: 768px) {
    .notifications-dropdown {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 60px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}


/* ========================================
   Player de Áudio
   ======================================== */
.audio-player-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    z-index: 1000;
    transition: bottom 0.3s ease;
}

.audio-player-bar.active {
    bottom: 0;
}

.audio-player-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.audio-player-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.audio-player-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.audio-player-btn:last-child {
    background: var(--gray-200);
    color: var(--text-primary);
}

.audio-player-btn:last-child:hover {
    background: var(--gray-300);
}

.audio-player-info {
    flex-shrink: 0;
    min-width: 200px;
}

.audio-player-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.audio-player-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.audio-player-progress {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-player-progress:hover {
    height: 8px;
}

.audio-player-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Dark Mode */
[data-theme="dark"] .audio-player-bar {
    background: var(--gray-800);
    border-top-color: var(--gray-700);
}

[data-theme="dark"] .audio-player-btn:last-child {
    background: var(--gray-700);
    color: var(--text-primary);
}

[data-theme="dark"] .audio-player-btn:last-child:hover {
    background: var(--gray-600);
}

[data-theme="dark"] .audio-player-progress {
    background: var(--gray-700);
}

/* Responsivo */
@media (max-width: 768px) {
    .audio-player-content {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .audio-player-info {
        min-width: 150px;
    }
    
    .audio-player-title {
        max-width: 150px;
    }
}

/* ========================================
   Tags System
   ======================================== */
.file-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    align-items: center;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    transition: var(--transition);
}

.tag-badge:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tag-badge-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.tag-badge-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.add-tag-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px dashed var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.add-tag-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Tag Selector Modal */
.tag-selector-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.tag-selector-modal.active {
    opacity: 1;
    visibility: visible;
}

.tag-selector-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.tag-selector-modal.active .tag-selector-content {
    transform: scale(1);
}

.tag-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tag-selector-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.tag-selector-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

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

.tag-selector-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.tag-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.tag-option-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-option-name {
    flex: 1;
    font-weight: 500;
}

.tag-option-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tag-selector-create {
    width: 100%;
    padding: 0.75rem;
    border: 1px dashed var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.tag-selector-create:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Create Tag Modal */
.create-tag-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.1);
}

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

/* Empty state */
.tags-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.tags-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}


/* ========================================
   Sistema de Notificações
   ======================================== */

.notifications-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-height: 500px;
}

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

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

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-text:hover {
    background: var(--bg-secondary);
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: var(--bg-hover);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.notifications-list .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.notifications-list .empty-state svg {
    color: var(--text-tertiary);
    margin-bottom: 16px;
    opacity: 0.5;
}

.notifications-list .empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .notifications-dropdown {
        width: calc(100vw - 32px);
        right: -100px;
    }
}

/* ============================================
   Dashboard Admin Moderno
   ============================================ */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent, #6366f1);
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    border-color: var(--accent, #6366f1);
}

.dash-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent, #6366f1);
    background: color-mix(in srgb, var(--accent, #6366f1) 14%, transparent);
}

.dash-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary, #fff);
}

.dash-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 0.15rem;
}

.dash-panel {
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
}

.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.dash-panel-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.dash-panel-total {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}

.filetype-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.filetype-row {
    display: grid;
    grid-template-columns: 130px 1fr 90px;
    align-items: center;
    gap: 0.75rem;
}

.filetype-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
}

.filetype-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filetype-track {
    height: 8px;
    background: var(--bg-tertiary, rgba(255,255,255,0.06));
    border-radius: 999px;
    overflow: hidden;
}

.filetype-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.filetype-count {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    color: var(--text-primary, #fff);
}

.filetype-pct {
    font-weight: 400;
    color: var(--text-secondary, #94a3b8);
}

@media (max-width: 640px) {
    .filetype-row { grid-template-columns: 100px 1fr 70px; }
    .dash-card-value { font-size: 1.35rem; }
}
