/* DocuManager - Estilos Principales del Dashboard */

/* Variables CSS */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    line-height: 1.6;
}

/* Layout */
.dashboard-body {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark-color) 0%, #0f172a 100%);
    color: #fff;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-speed) ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    color: var(--primary-color);
}

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

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-left-color: var(--primary-color);
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-radius: 8px;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    height: var(--header-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--dark-color);
    cursor: pointer;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark-color);
}

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

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
    flex: 1;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.welcome-section h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    opacity: 0.9;
    font-size: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.documents {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.stat-icon.users {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

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

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

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
}

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

/* Quick Actions */
.quick-actions,
.recent-documents,
.help-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quick-actions h3,
.recent-documents h3,
.help-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--light-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark-color);
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
}

.action-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.action-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.action-card span {
    font-weight: 500;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

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

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

.data-table th {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--light-color);
}

.file-icon {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-speed) ease;
}

.btn-view {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    margin-right: 0.25rem;
}

.btn-view:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-download {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.btn-download:hover {
    background: var(--success-color);
    color: #fff;
}

/* Help Section */
.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.help-card {
    padding: 1.5rem;
    background: var(--light-color);
    border-radius: 12px;
    text-align: center;
    transition: transform var(--transition-speed) ease;
}

.help-card:hover {
    transform: translateY(-2px);
}

.help-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.help-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.help-card p {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Footer */
.main-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .user-details {
        display: none;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

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

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