/* ===== VARIABLES & RESET ===== */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    
    /* Colores Sidebar */
    --sidebar-bg: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    --sidebar-text: #ecf0f1;
    --sidebar-hover: rgba(255,255,255,0.15);
    --sidebar-active: #3498db;
    
    /* Colores Principal */
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    
    /* Gradientes Cards */
    --gradient-blue: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-purple: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    --gradient-pink: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --gradient-orange: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    
    /* Sombras & Bordes */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --border-radius: 16px;
    
    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
}

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

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-menu { padding: 0 0.75rem; }

.menu-group { margin-bottom: 1.5rem; }

.menu-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.menu-group ul { list-style: none; }
.menu-group li { margin: 0.25rem 0; }

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    font-weight: 500;
}

.menu-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    transform: translateX(4px);
}

.menu-link.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    width: calc(100% - var(--sidebar-width));
    transition: var(--transition);
}

/* ===== TOP BAR ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

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

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

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.breadcrumb .current { color: var(--text-primary); font-weight: 600; }

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

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

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 0.95rem; }
.user-role { font-size: 0.8rem; color: var(--text-secondary); }

.date-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    background: var(--gradient-blue);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    color: #fff;
    margin-bottom: 2.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-content { position: relative; z-index: 2; max-width: 600px; }

.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

.btn-primary {
    background: #fff;
    color: #667eea;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

.hero-decoration {
    position: absolute;
    top: 0; right: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.deco-1 { width: 200px; height: 200px; top: -50px; right: -50px; }
.deco-2 { width: 120px; height: 120px; bottom: -30px; right: 100px; }

/* ===== QUICK ACCESS CARDS ===== */
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.card-gradient-blue .card-icon { background: var(--gradient-blue); }
.card-gradient-purple .card-icon { background: var(--gradient-purple); }
.card-gradient-pink .card-icon { background: var(--gradient-pink); }
.card-gradient-orange .card-icon { background: var(--gradient-orange); }
.card-gradient-green .card-icon { background: var(--gradient-green); }

.card-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.card-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
}

.card:hover .card-link { gap: 0.6rem; }

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.35rem 0.85rem;
    background: var(--bg-primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-badge.highlight {
    background: var(--gradient-green);
    color: #fff;
}

.card-large { grid-column: span 1; }
@media (min-width: 1024px) {
    .card-large { grid-column: span 2; }
}

/* ===== STATS SECTION ===== */
.stats-section { margin-bottom: 2rem; }

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

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 500;
}
.trend-up { color: #10b981; }
.trend-warning { color: #f59e0b; }
.trend-stable { color: var(--text-secondary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-content { margin-left: var(--sidebar-width); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    
    .main-content { margin-left: 0; width: 100%; }
    
    .menu-toggle { display: block; }
    
    .hero-section { padding: 2rem 1.5rem; }
    .hero-section h1 { font-size: 1.5rem; }
    
    .cards-grid { grid-template-columns: 1fr; }
    .card-large { grid-column: span 1; }
    
    .top-bar { flex-wrap: wrap; gap: 1rem; }
}

/* ===== UTILITIES ===== */
.text-muted { color: var(--text-secondary); }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}