:root {
    --primary: #2d7a44;
    /* Verde más vibrante como en la imagen */
    --primary-dark: #1e522e;
    --secondary: #8cc63f;
    /* Verde Lima del logo */
    --accent: #dc2626;
    /* Rojo del logo */
    --dark: #1a1a1a;
    --light: #fdfdfd;
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #f4f7f5;
    color: #333333;
    min-height: 100vh;
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: var(--primary);
    /* Restaurado color verde solicitado */
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    /* Texto blanco sobre fondo verde */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    /* Blanco para visibilidad */
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--secondary);
    color: var(--primary);
}

.btn-primary:hover {
    background: #a2d65c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(140, 198, 63, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
    /* Para que el contenido empuje el footer hacia abajo */
}

.card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Footer Section */
.main-footer {
    background: var(--dark);
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h3 {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.nav-link-dropdown {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.dropdown:hover .nav-link-dropdown {
    color: white;
}

.dropdown-content {
    display: none;
    /* OCULTO POR DEFECTO */
    position: absolute;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1000;
    padding: 0.5rem 0;
    top: 100%;
    left: 0;
    border: 1px solid #e2e8f0;
}

.dropdown:hover .dropdown-content {
    display: block;
    /* MOSTRAR SOLO EN HOVER */
}

.dropdown-content a {
    color: #333 !important;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background: #f8fafc;
    color: var(--primary) !important;
    padding-left: 1.5rem;
}

/* Category Accordion Styles */
.categories-dropdown {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 !important;
}

.category-accordion-item {
    border-bottom: 1px solid #f1f5f9;
}

.category-accordion-item:last-child {
    border-bottom: none;
}

.category-parent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-main-link {
    flex: 1;
    padding: 0.75rem 1.25rem;
    color: #333 !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-toggle {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
}

.category-toggle:hover {
    color: var(--primary);
    background: #f8fafc;
}

.category-toggle i {
    transition: transform 0.3s ease;
    pointer-events: none;
}

.category-toggle.active i {
    transform: rotate(180deg);
}

.category-children-list {
    display: none;
    background: #f8fafc;
    padding: 0.25rem 0;
}

.category-children-list.show {
    display: block;
}

.category-child-link {
    display: block;
    padding: 0.6rem 2rem !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: #64748b !important;
}

.category-child-link:hover {
    background: #f1f5f9 !important;
    padding-left: 2.25rem !important;
    color: var(--primary) !important;
}

/* Base Form Elements Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #f8fafc;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(45, 122, 68, 0.1);
}

/* Modern Table Consistency */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

thead th {
    padding: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    border-bottom: 2px solid #f1f5f9;
}

tbody tr {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

tbody tr:hover {
    transform: scale(1.005);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    z-index: 10;
    position: relative;
}

tbody td {
    padding: 1.25rem 1rem;
    border: 1px solid transparent;
}

tbody td:first-child {
    border-radius: 1rem 0 0 1rem;
}

tbody td:last-child {
    border-radius: 0 1rem 1rem 0;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

/* Paginación global */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-item {
    display: inline-block;
}

.page-link, .page-item span, .page-item a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border-radius: 0.5rem !important;
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.page-item.active .page-link, .page-item.active span {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 10px rgba(45, 122, 68, 0.25);
}

.page-item.disabled .page-link, .page-item.disabled span {
    color: #94a3b8 !important;
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
}

.page-link:hover:not(.disabled) {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
}

.pagination svg, nav svg, svg.w-5.h-5, svg.w-6.h-6 {
    width: 1.15rem !important;
    height: 1.15rem !important;
    max-width: 1.15rem !important;
    max-height: 1.15rem !important;
    display: inline-block !important;
}