* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0077B6;
    --secondary-color: #03045E;
    --accent-color: #00B4D8;
    --dark-bg: #03045E;
    --card-bg: #0077B6;
    --sidebar-bg: #03045E;
    --text-light: #CAF0F8;
    --text-secondary: #90E0EF;
    --border-color: #0077B6;
    --success-color: #00B4D8;
    --warning-color: #fbbf24;
    --danger-color: #ef4444;
    --blue: #0077B6;
    --green: #00B4D8;
    --orange: #fbbf24;
    --purple: #7c3aed;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(0, 180, 216, 0.2);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.menu-item.active {
    background: rgba(0, 180, 216, 0.25);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.menu-item i {
    font-size: 1.2rem;
    width: 25px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(0, 180, 216, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

/* Botón hamburguesa para móvil */
.menu-toggle-admin {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle-admin span {
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle-admin.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.menu-toggle-admin.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle-admin.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

.dashboard-header h1 {
    font-size: 2rem;
    color: #ffffff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--text-secondary);
}

.btn-logout-header {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout-header:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.3);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(0, 119, 182, 0.3);
    color: var(--blue);
}

.stat-icon.green {
    background: rgba(0, 180, 216, 0.3);
    color: var(--green);
}

.stat-icon.orange {
    background: rgba(251, 191, 36, 0.3);
    color: var(--orange);
}

.stat-icon.purple {
    background: rgba(124, 58, 237, 0.3);
    color: var(--purple);
}

.stat-info h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: #ffffff;
}

.stat-info p {
    color: #90E0EF;
    font-size: 0.9rem;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: #ffffff;
}

.recent-sales, .low-stock {
    max-height: 400px;
    overflow-y: auto;
}

.sale-item, .stock-item {
    padding: 15px;
    background: rgba(0, 180, 216, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-color);
}

.sale-item:hover, .stock-item:hover {
    background: rgba(0, 180, 216, 0.2);
}

.sale-item-header, .stock-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.sale-item-header strong {
    color: var(--text-light);
}

.sale-item-date, .stock-item-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #ffffff;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 180, 216, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.btn-filter {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-filter:hover,
.btn-filter.active {
    background: rgba(0, 180, 216, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(0, 180, 216, 0.15);
}

.data-table th {
    padding: 15px;
    text-align: left;
    color: #ffffff;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: #ffffff;
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(0, 180, 216, 0.1);
}

.product-image-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-machos {
    background: rgba(59, 130, 246, 0.2);
    color: var(--blue);
}

.badge-hembras {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

.badge-plantas {
    background: rgba(16, 185, 129, 0.2);
    color: var(--green);
}

.badge-accesorios {
    background: rgba(245, 158, 11, 0.2);
    color: var(--orange);
}

.badge-otros {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple);
}

.badge-admin {
    background: rgba(255, 0, 110, 0.2);
    color: var(--accent-color);
}

.badge-user {
    background: rgba(139, 146, 168, 0.2);
    color: var(--text-secondary);
}

/* Mobile Cards */
.mobile-card {
    display: none;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    transform: translateY(-2px);
}

.btn-icon.edit:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--blue);
    color: var(--blue);
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-icon.view:hover {
    background: rgba(0, 180, 216, 0.3);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #ffffff;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-form {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-footer {
    padding: 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sale-details {
    padding: 25px;
}

.sale-details-item {
    padding: 15px;
    background: rgba(0, 180, 216, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
}

.sale-details-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.sale-details-item p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* Overlay para móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-logo h2,
    .menu-item span,
    .sidebar-footer .btn-logout span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .menu-toggle-admin {
        display: flex;
    }
    
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-logo h2,
    .menu-item span,
    .sidebar-footer .btn-logout span {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
        width: 100%;
    }
    
    .dashboard-header {
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .dashboard-header h1 {
        font-size: 1.3rem;
        flex: 1;
    }
    
    .user-info {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-card {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .btn-filter {
        flex: 1;
        min-width: fit-content;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    /* Ocultar tabla y mostrar cards en móvil */
    .table-container .data-table {
        display: none;
    }
    
    .mobile-card {
        display: block;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .mobile-card-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-card-image {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .mobile-card-title {
        flex: 1;
        min-width: 0;
    }
    
    .mobile-card-title h4 {
        color: var(--text-light);
        font-size: 1rem;
        margin-bottom: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .mobile-card-body {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .mobile-card-field {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .mobile-card-label {
        font-size: 0.75rem;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .mobile-card-value {
        font-size: 0.9rem;
        color: var(--text-light);
        font-weight: 500;
    }
    
    .mobile-card-footer {
        display: flex;
        gap: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
    }
    
    .mobile-card-footer .btn-icon {
        flex: 1;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: row;
        gap: 5px;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .image-preview {
        max-height: 200px;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .dashboard-header h1 {
        font-size: 1.1rem;
    }
    
    .stat-info h3 {
        font-size: 1.3rem;
    }
    
    .stat-info p {
        font-size: 0.8rem;
    }
    
    .chart-card {
        padding: 15px;
    }
    
    .chart-card h3 {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .data-table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    .menu-toggle-admin {
        width: 26px;
        height: 20px;
    }
    
    .menu-toggle-admin span {
        height: 2.5px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
