/* public/css/segagro.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f5f5f5;
}

/* LOGIN STYLES */
.login-container {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: white;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-right {
    flex: 1;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect fill="%23e8f4fd" width="800" height="600"/><circle cx="400" cy="300" r="200" fill="%234a90e2" opacity="0.3"/></svg>') center/cover;
    position: relative;
}

.login-right::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.8), rgba(67, 206, 162, 0.8));
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: -25px;
}
.logo-login{
     display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.logo-icon {
    background: #4cd137;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-right: 4px;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.welcome-text {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-text h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.welcome-text p {
    color: #666;
    font-size: 14px;
}

.login-form {
    width: 100%;
    max-width: 360px;
}

.form-group {
    margin-bottom: 20px;
    margin-right: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4cd137;
}

.password-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.forgot-password {
    text-align: right;
    margin-bottom: 30px;
}

.forgot-password a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.login-btn {
    width: 100%;
    background: #4cd137;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #44bd32;
}

/* DASHBOARD STYLES */
.dashboard {
    display: none;
    min-height: 100vh;
}

.dashboard.active {
    display: flex;
}

.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

/* Estilo general igual a los demás ítems */
/* Submenú */
.submenu {
    display: none;
    flex-direction: column;
    margin: 0;                /* quitamos margen raro */
    padding-left: 40px;       /* sangría para distinguir */
    list-style: none;
}

.nav-item.has-submenu.open + .submenu {
    display: flex;
}

.submenu li {
    margin: 4px 0;
}

.submenu a {
    display: block;           /* ocupar toda la fila */
    padding: 8px 16px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease, background 0.3s ease;
    border-radius: 4px;
}

.submenu a:hover {
    color: #28a745;
    background: #f8f9fa;
}

/* Activo en submenú */
.submenu a.active {
    font-weight: bold;
    color: #28a745;
    background: #e8f5e8;
}

/* Links dentro del submenu */
.submenu a {
    padding: 8px 16px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.submenu a:hover {
    color: #28a745;
}

.submenu a.active {
    font-weight: bold;
    color: #28a745;
}

.submenu {
    display: none;
    flex-direction: column;
    margin-left: 20px; /* sangrado de subitems */
    border-left: 2px solid rgba(0,0,0,0.05);
    padding-left: 10px;
}

.nav-item.has-submenu.open .submenu {
    display: flex;
}

.submenu .nav-item {
    padding: 6px 0;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.submenu .nav-item:hover {
    color: #28a745;
}

.submenu .nav-item.active {
    font-weight: bold;
    color: #28a745;
}

.submenu-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}


.nav-item:hover {
    background: #f8f9fa;
    color: #333;
}

.nav-item.active {
    background: #e8f5e8;
    color: #4cd137;
    border-left-color: #4cd137;
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #4cd137;
    color: white;
    text-align: center;
    border-radius: 12px;
    margin: 20px;
}

.main-content {
    flex: 1;
    background: #f8f9fa;
}

.header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 32px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 40px 10px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    width: 300px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4cd137;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.content {
    padding: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.pink::before { background: #ff6b9d; }
.stat-card.orange::before { background: #ffa726; }
.stat-card.green::before { background: #66bb6a; }
.stat-card.purple::before { background: #ab47bc; }

.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 12px;
}

.stat-change.positive {
    color: #4cd137;
}

.stat-change.negative {
    color: #e74c3c;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    color: #333;
    font-size: 32px;
    margin: 0;
}

.section-header p {
    color: #666;
    font-size: 14px;
    margin: 5px 0 0 0;
}

.export-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.export-btn:hover {
    background: #e9ecef;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.chart-area {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 6px;
}

.legend-color.red { background: #e74c3c; }
.legend-color.green { background: #4cd137; }

/* Módulos */
.modules-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.modules-container h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.module-number {
    background: #f8f9fa;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.module-info {
    flex: 1;
}

.module-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 12px;
    color: #666;
    min-width: 35px;
}

/* Calendario */
.calendar-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h3 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

.calendar-nav {
    background: #f8f9fa;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.calendar-nav:hover {
    background: #e9ecef;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day {
    background: white;
    padding: 8px 4px;
    min-height: 60px;
    font-size: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calendar-day.header {
    background: #f8f9fa;
    font-weight: bold;
    color: #666;
    min-height: 30px;
    justify-content: center;
}

.calendar-day.current {
    background: #4cd137;
    color: white;
    font-weight: bold;
}

.calendar-day.has-event {
    background: #fff3cd;
}

.event {
    background: #4cd137;
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 3px;
    margin-top: 2px;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    color: #333;
    font-size: 18px;
}

.chart-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-right {
        min-height: 200px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 280px;
    }
    
    .dashboard {
        flex-direction: column;
    }
}