/**
 * Plantónico - Dashboard Refined Styles
 * Arquitectura de Sidebar + Bento Grid
 */

:root {
    --sidebar-width: 280px;
    --sidebar-bg: #2B2B2B;
    --sidebar-text: #FDFBF7;
    --sidebar-accent: #C9A66B;
    --header-height: 70px;
    
    /* Sombras Elevadas */
    --shadow-premium: 0 10px 30px -5px rgba(92, 58, 33, 0.08), 0 4px 6px -2px rgba(92, 58, 33, 0.03);
    --shadow-hover: 0 20px 40px -10px rgba(92, 58, 33, 0.15);
}

/* Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Sidebar Collapsed State */
.app-wrapper.sidebar-collapsed .sidebar-refined {
    transform: translateX(-100%);
}

.app-wrapper.sidebar-collapsed .main-layout {
    margin-left: 0;
}

/* Sidebar Styling */
.sidebar-refined {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

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

.nav-group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    margin: 1.5rem 0 0.75rem 1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.sidebar-link i {
    font-size: 1.25rem;
    color: var(--sidebar-accent);
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-link.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-link.active i {
    color: white;
}

/* Main Content Adjustments */
.main-layout {
    flex: 1;
    margin-left: var(--sidebar-width);
    background-color: #FDFBF7; /* Linen Background */
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Top Header */
.top-header-refined {
    height: var(--header-height);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.header-welcome h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Sidebar Toggle Button Styling */
.sidebar-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(92, 58, 33, 0.1);
    background: white;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.sidebar-toggle:hover {
    background-color: var(--color-primary-50);
    color: var(--primary);
    transform: scale(1.05);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(160px, auto);
    gap: 1.5rem;
    padding: 2.5rem;
}

.bento-item {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(92, 58, 33, 0.03);
    text-decoration: none !important;
    color: inherit;
}

.bento-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.bento-item.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
    color: white;
}

.bento-item.accent {
    border-bottom: 4px solid var(--sidebar-accent);
}

.bento-item .stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.bento-item.primary .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.bento-item .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: var(--text-dark);
}

.bento-item.primary .stat-value {
    color: white;
}

/* Module Cards */
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 0 2.5rem 2.5rem 2.5rem;
}

.module-card {
    background: white;
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.02);
    text-decoration: none !important;
}

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

.module-icon-box {
    width: 64px;
    height: 64px;
    background-color: var(--secondary-lighter);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.module-card:hover .module-icon-box {
    background-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.module-card h4 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.module-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.module-action {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--sidebar-accent);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .module-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar-refined { left: -100%; }
    .main-layout { margin-left: 0; }
    .module-grid { grid-template-columns: 1fr; }
    .bento-grid { grid-template-columns: 1fr; }
}
