@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-bg: #212529;
    --main-bg: #f4f6f9;
    --widget-bg: #ffffff;
    --text-dark: #333;
    --text-light: #ced4da;
    --text-hover: #ffffff;
    --border-color: #eef2f7;
    --purple: #9b59b6;
    --green: #2ecc71;
    --blue: #3498db;
    --orange: #f39c12;
    --red: #e74c3c;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { background-color: var(--main-bg); color: var(--text-dark); }
.dashboard-container { display: flex; }

/* --- Barra Lateral --- */
.sidebar { width: 260px; background-color: var(--sidebar-bg); color: var(--text-light); height: 100vh; padding: 20px; position: sticky; top: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 0 10px; }
.sidebar-header h1 { font-size: 1.6rem; color: var(--text-hover); }
.sidebar-menu .menu-item { list-style: none; margin: 5px 0; }
.sidebar-menu .menu-item a { color: var(--text-light); text-decoration: none; font-size: 0.95rem; display: flex; align-items: center; padding: 12px 10px; border-radius: 6px; transition: background 0.3s, color 0.3s; }
.sidebar-menu .menu-item > a > i:first-child { margin-right: 15px; width: 20px; text-align: center; }
.sidebar-menu .menu-item a:hover { background-color: #343a40; color: var(--text-hover); }
.sidebar-menu .menu-item.active > a { background-color: #0d6efd; color: var(--text-hover); font-weight: 500; }

/* Submenu */
.submenu { list-style: none; margin-left: 25px; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.menu-item.active .submenu { max-height: 100px; /* Adjust as needed */ }
.submenu a { font-size: 0.9rem !important; padding: 10px 15px !important; }
.submenu .active-sub a { font-weight: 600; color: var(--text-hover); }
.arrow { margin-left: auto; transition: transform 0.3s; }
.menu-item.active > a > .arrow { transform: rotate(180deg); }

/* --- Contenido Principal --- */
.main-content { flex-grow: 1; padding: 25px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.search-bar { display: flex; align-items: center; background: var(--widget-bg); padding: 10px 15px; border-radius: 25px; width: 350px; box-shadow: var(--shadow); }
.search-bar input { border: none; outline: none; margin-left: 10px; background: transparent; width: 100%; font-size: 0.9rem; }
.header-icons { display: flex; align-items: center; gap: 25px; }
.header-icons i { font-size: 1.3rem; cursor: pointer; position: relative; color: #6c757d; }
.notification { position: absolute; top: -5px; right: -8px; background-color: var(--red); color: white; border-radius: 50%; font-size: 0.65rem; font-weight: 600; padding: 2px 5px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* --- Widgets --- */
.widgets-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.widget { background: var(--widget-bg); padding: 20px; border-radius: 12px; box-shadow: var(--shadow); }
.widget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: #6c757d; }
.widget-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-dark); }
.widget.full-width { grid-column: 1 / -1; }
.summary-card { position: relative; }
.summary-card h4 { font-size: 2rem; font-weight: 600; }
.summary-card p { color: #777; font-size: 0.9rem; }
.card-icon { position: absolute; top: 25px; right: 25px; font-size: 1.8rem; color: #e9ecef; }

/* Layout para la sección inferior */
.widgets-grid > .widget:nth-child(6) { grid-column: 1 / 3; }
.widgets-grid > .widget:nth-child(7) { grid-column: 3 / 4; }
.widgets-grid > .column-container { grid-column: 4 / 5; display: flex; flex-direction: column; gap: 25px; }

/* Contenido de widgets específicos */
.chart-container { position: relative; display: flex; justify-content: center; align-items: center; height: 100%; }
.chart-text { position: absolute; text-align: center; line-height: 1.4; }
.chart-text .value { font-size: 2rem; font-weight: 700; color: var(--text-dark); }
.chart-text .label { font-size: 0.9rem; color: #6c757d; }
.traffic-list { list-style: none; }
.traffic-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.traffic-list li:last-child { border-bottom: none; }
.traffic-list .data { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 0.9rem; }
.traffic-list .green { color: var(--green); }
.traffic-list .red { color: var(--red); }
canvas { max-height: 280px; }
#visitsByDeviceChart, #salesGoalsChart { max-height: 200px; }```