/* ============================================
       VARIABLES GLOBALES
    ============================================ */
:root {
    --color-primary: #0f3b2c;
    --color-primary-dark: #1a5c44;
    --color-primary-light: #2d8c6c;
    --color-secondary: #003366;
    --color-accent: #008e6c;
    --color-white: #ffffff;
    --color-black: #111827;
    --color-gray-100: #f8f9fa;
    --color-gray-200: #e8ece9;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2e28;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --font-family-base: 'Segoe UI', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    --shadow-md: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.05);
}

/* ============================================
       RESET GENERAL
    ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-gray-100);
    font-family: var(--font-family-base);
    color: var(--color-gray-700);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    /* Fondo con desenfoque */
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('https://trazabilidad.marena.gob.ni/img/general.jpg');
        background-size: cover;
        background-position: center;
        filter: blur(0.5rem);
        z-index: -1;
        transform: scale(1.05);
    }

/* ============================================
   TOPBAR (línea superior gris)
============================================ */
.topbar {
    background: var(--color-white);
    border-bottom: 0.0625rem solid var(--color-gray-200);
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    color: var(--color-gray-500);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topbar__center a {
    color: var(--color-gray-500);
    text-decoration: none;
    transition: color 0.25s ease;
}

    .topbar__center a:hover {
        color: var(--color-primary);
    }

.topbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .topbar__right a {
        color: var(--color-gray-500);
        font-size: 0.875rem;
        transition: color 0.25s ease;
    }

        .topbar__right a:hover {
            color: var(--color-primary);
        }

/* ============================================
   NAVBAR PRINCIPAL (blanca)
============================================ */
.navbar-main {
    background: var(--color-white);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 0.0625rem solid var(--color-gray-200);
}

.navbar-main__container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Brand / Logo */
.navbar-main__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.navbar-main__logo {
    max-height: 3rem;
    width: auto;
}

.navbar-main__brand-text {
    line-height: 1.2;
}

    .navbar-main__brand-text strong {
        font-size: 1rem;
        color: var(--color-primary);
        display: block;
    }

    .navbar-main__brand-text small {
        font-size: 0.625rem;
        color: var(--color-gray-500);
    }

/* Toggler responsive */
.navbar-main__toggler {
    display: none;
    background: none;
    border: 0.0625rem solid var(--color-gray-300);
    border-radius: 0.25rem;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
}

.navbar-main__toggler-icon {
    display: block;
    width: 1.25rem;
    height: 0.125rem;
    background: var(--color-gray-600);
    position: relative;
}

    .navbar-main__toggler-icon::before,
    .navbar-main__toggler-icon::after {
        content: '';
        position: absolute;
        width: 1.25rem;
        height: 0.125rem;
        background: var(--color-gray-600);
        left: 0;
    }

    .navbar-main__toggler-icon::before {
        top: -0.375rem;
    }

    .navbar-main__toggler-icon::after {
        bottom: -0.375rem;
    }

/* Menú */
.navbar-main__menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-grow: 1;
    justify-content: center;
}

.navbar-main__nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-main__item {
    list-style: none;
}

.navbar-main__link {
    color: var(--color-gray-700);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.25s ease;
}

    .navbar-main__link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 0.125rem;
        background: var(--color-primary);
        transition: width 0.25s ease;
    }

    .navbar-main__link:hover {
        color: var(--color-primary);
    }

        .navbar-main__link:hover::after,
        .navbar-main__link--active::after {
            width: 100%;
        }

.navbar-main__link--active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Botón Ir a Consultas */
.navbar-main__btn {
    background: var(--color-primary);
    color: var(--color-white);
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

    .navbar-main__btn:hover {
        background: var(--color-primary-dark);
        transform: translateY(-0.125rem);
    }

/* Responsive */
@media (max-width: 48rem) {
    .topbar {
        padding: 0.5rem 1rem;
        justify-content: center;
        text-align: center;
    }

    .navbar-main__container {
        padding: 0.75rem 1rem;
    }

    .navbar-main__toggler {
        display: block;
    }

    .navbar-main__menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding-top: 1rem;
    }

    .navbar-main__menu--open {
        display: flex;
    }

    .navbar-main__nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
    }

    .navbar-main__link {
        display: block;
        padding: 0.5rem 0;
    }

        .navbar-main__link::after {
            display: none;
        }

    .navbar-main__btn {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }

    .navbar-main__brand-text small {
        display: none;
    }
}

@media (max-width: 36rem) {
    .navbar-main__logo {
        max-height: 2.1875rem;
    }

    .navbar-main__brand-text strong {
        font-size: 0.875rem;
    }
}

/* ============================================
       CONTENEDOR PRINCIPAL
    ============================================ */
.content-wrapper {
    max-width: 75rem;
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: transparent;
}

@media (max-width: 48rem) {
    .content-wrapper {
        padding: var(--spacing-md);
    }
}

/* ============================================
       FOOTER
    ============================================ */
footer {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    padding: var(--spacing-md) 0;
    margin-top: auto;
    width: 100%;
    text-align: center;
}

    footer .container span {
        font-size: var(--font-size-sm);
        opacity: 0.9;
    }

/* ============================================
   MENÚ PRINCIPAL - BENTO GRID
   Estilo idéntico a la primera imagen
============================================ */

/* Contenedor del card principal */
.card {
    max-width: 75rem;
    margin: 2.5rem auto;
    background: var(--color-white);
    border-radius: 1.5rem;
    box-shadow: 0 1.25rem 2.1875rem rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 0.0625rem solid var(--color-gray-200);
}

/* Header del card - gradiente verde */
.card-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 2rem 2.5rem;
    text-align: center;
}

    .card-header h1 {
        color: var(--color-white);
        font-size: 1.75rem;
        font-weight: 700;
        letter-spacing: -0.03125rem;
        margin: 0;
    }

/* Cuerpo del card */
.card-body {
    padding: 2.5rem;
}

/* BENTO GRID - Diferentes tamaños */
.funciones-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Gestión de Usuario - ocupa 2 columnas (fila 1, columnas 1-2) */
.funcion:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1;
}

/* Historial de Solicitudes - ocupa 2 filas (columna 3, filas 1-2) */
.funcion:nth-child(2) {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

/* Revisar Trámites Pendientes - ocupa 1 columna (fila 2, columna 1) */
.funcion:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 2;
}

/* Reportes - ocupa 1 columna (fila 2, columna 2) */
.funcion:nth-child(4) {
    grid-column: 2 / 3;
    grid-row: 2;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

/* Tarjeta individual */
.funcion {
    background: var(--color-white);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 0.0625rem solid var(--color-gray-200);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    /* Barra lateral izquierda al hover */
    .funcion::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 0.25rem;
        height: 100%;
        background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
        transition: width 0.3s ease;
    }

    .funcion:hover::before {
        width: 0.375rem;
    }

    .funcion:hover {
        transform: translateY(-0.25rem);
        box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.1);
        border-color: var(--color-primary-light);
    }

/* Texto dentro de la tarjeta */
.texto {
    flex: 1;
}

    .texto h2 {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--color-gray-800);
        margin: 0 0 0.5rem 0;
    }

/* Línea decorativa verde */
.linea {
    width: 3rem;
    height: 0.1875rem;
    background: var(--color-primary);
    margin: 0.75rem 0 1rem 0;
    border-radius: 0.1875rem;
}

.texto p {
    font-size: 0.875rem;
    color: var(--color-gray-500);
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
}

/* Botón dentro de la tarjeta */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.625rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    width: fit-content;
}

    .btn-primary:hover {
        background: var(--color-primary-dark);
        transform: translateY(-0.125rem);
    }

    .btn-primary i {
        font-size: 1rem;
    }

/* Estilos especiales para Historial de Solicitudes (fondo verde) */
.funcion:nth-child(2) .texto h2,
.funcion:nth-child(2) .texto p {
    color: var(--color-white);
}

.funcion:nth-child(2) .linea {
    background: var(--color-white);
}

.funcion:nth-child(2) .btn-primary {
    background: var(--color-white);
    color: var(--color-primary);
}

.funcion:nth-child(2) .btn-primary:hover {
    background: var(--color-gray-100);
    transform: translateY(-0.125rem);
}

.funcion:nth-child(4) .texto h2,
.funcion:nth-child(4) .texto p {
    color: var(--color-white);
}

.funcion:nth-child(4) .linea {
    background: var(--color-white);
}

/* Efecto hover específico para Historial */
.funcion:nth-child(2):hover {
    box-shadow: 0 1.25rem 2.5rem rgba(1, 71, 55, 0.3);
}

/* Responsive - En móvil todas las tarjetas se apilan */
@media (max-width: 48rem) {
    .card-header {
        padding: 1.5rem;
    }

        .card-header h1 {
            font-size: 1.5rem;
        }

    .card-body {
        padding: 1.5rem;
    }

    .funciones-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* Resetear los grid spans en móvil */
    .funcion:nth-child(1),
    .funcion:nth-child(2),
    .funcion:nth-child(3),
    .funcion:nth-child(4) {
        grid-column: auto;
        grid-row: auto;
    }

    .texto h2 {
        font-size: 1.125rem;
    }

    .texto p {
        font-size: 0.8125rem;
    }
}

@media (max-width: 36rem) {
    .card-header h1 {
        font-size: 1.25rem;
    }

    .funcion {
        padding: 1rem;
    }

    .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Para tablets (entre 48rem y 64rem) */
@media (min-width: 48rem) and (max-width: 64rem) {
    .funciones-container {
        gap: 1rem;
    }

    .texto h2 {
        font-size: 1.125rem;
    }

    .texto p {
        font-size: 0.8125rem;
    }

    .btn-primary {
        padding: 0.5rem 1rem;
    }
}

/* ============================================
       FUNCIONES GENERALES
    ============================================ */
.funciones-generales {
    text-align: center;
    padding: var(--spacing-2xl);
    background-color: var(--color-white);
    border-radius: var(--border-radius-xl);
    margin: var(--spacing-xl) auto;
    max-width: 75rem;
    box-shadow: var(--shadow-sm);
}

/* ============================================
       BOTONES
    ============================================ */
.btn-custom {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-xl);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    background: var(--color-primary);
    color: var(--color-white);
}

    .btn-custom:hover {
        background: var(--color-primary-dark);
        transform: translateY(-0.125rem);
    }

/* ============================================
       TABLAS
    ============================================ */
.custom-table-container {
    background: var(--color-white);
    border-radius: var(--border-radius-xl);
    overflow-x: auto;
    border: 0.0625rem solid var(--color-gray-200);
    transition: all 0.3s ease;
    max-height: 25rem;
    overflow-y: auto;
}

    .custom-table-container::-webkit-scrollbar {
        width: 0.5rem;
        height: 0.5rem;
    }

    .custom-table-container::-webkit-scrollbar-track {
        background: var(--color-gray-200);
        border-radius: 0.625rem;
    }

    .custom-table-container::-webkit-scrollbar-thumb {
        background: var(--color-primary);
        border-radius: 0.625rem;
    }

.custom-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 50rem;
}

    .custom-table thead {
        background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
        position: sticky;
        top: 0;
    }

        .custom-table thead th {
            padding: var(--spacing-md);
            font-weight: 600;
            font-size: var(--font-size-xs);
            text-transform: uppercase;
            letter-spacing: 0.03125rem;
            color: var(--color-white);
            text-align: center;
        }

    .custom-table tbody tr {
        border-bottom: 0.0625rem solid var(--color-gray-200);
        transition: all 0.2s ease;
    }

        .custom-table tbody tr:hover {
            background-color: rgba(15, 59, 44, 0.05);
        }

    .custom-table tbody td {
        padding: var(--spacing-md);
        color: var(--color-gray-700);
        font-size: var(--font-size-sm);
        vertical-align: middle;
        text-align: center;
    }

/* ============================================
       BADGES
    ============================================ */
.badge-custom {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 2.5rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-align: center;
}

.badge-recibido {
    background: #e8f5e9;
    color: var(--color-primary);
    border: 0.0625rem solid #c8e6d9;
}

.badge-proceso {
    background: #fff3e0;
    color: #d97706;
    border: 0.0625rem solid #fde68a;
}

.badge-anulado {
    background: #fef2f2;
    color: #dc2626;
    border: 0.0625rem solid #fecaca;
}

/* ============================================
       ALERTAS
    ============================================ */
.alert-custom {
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-sm);
    text-align: center;
    background: #f0fdf4;
    color: var(--color-primary);
    border: 0.0625rem solid #bbf7d0;
}

/* ============================================
       RESPONSIVE
    ============================================ */
@media (max-width: 48rem) {
    :root {
        --spacing-xl: 1.25rem;
        --spacing-2xl: 1.5rem;
    }

    .funcion {
        padding: var(--spacing-md);
    }

    .icono i {
        font-size: 1.75rem;
    }

    .texto h2 {
        font-size: var(--font-size-lg);
    }

    .texto p {
        font-size: var(--font-size-xs);
    }

    .custom-table thead th,
    .custom-table tbody td {
        padding: var(--spacing-sm);
        font-size: var(--font-size-xs);
    }

    .badge-custom {
        padding: 0.125rem var(--spacing-sm);
        font-size: 0.625rem;
    }
}

