/**
 * styles.css - Estilos del Sistema Central
 * Sistema desarrollado por MVisual
 * Estilos principales del sistema
 */

/* Importar fuente Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* Variables CSS */
:root {
    --primary-color: #dc2626;
    --secondary-color: #6b7280;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0284c7;
    --light-color: #f8fafc;
    --dark-color: #1f2937;
    --background-gradient: linear-gradient(to right top, #d1d1d1, #dcdcdc, #e8e8e8, #f3f3f3, #ffffff);
}

/* Reset y configuración general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    background: var(--background-gradient);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Layout principal */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar-main {
    background-color: #fe0000 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-weight: bold;
    line-height: 1;
}

.logo-main {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 0.8rem;
    opacity: 0.9;
    letter-spacing: 2px;
}

.navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    padding: 1rem 1.5rem !important;
    transition: background-color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-dropdown {
    color: white !important;
    font-weight: 500;
}

.user-dropdown:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Contenedor principal */
.container-main {
    width: 94%;
    max-width: none;
    margin: 0 auto;
    flex: 1;
    padding: 5.5rem 0 3.5rem 0; /* espacio para navbar y footer fijos */
}

/* Footer */
.footer-main {
    background-color: black;
    color: white;
    padding: 1rem 0;
    margin-top: auto;
}

.footer-content {
    width: 94%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-date {
    font-size: 0.9rem;
}

.footer-signature {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Login page */
.login-page {
    background: var(--background-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.login-logo {
    height: 80px;
    width: auto;
}

.login-logo-text {
    display: inline-block;
    padding: 20px 30px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: 12px;
    color: white;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.login-logo-text .logo-main {
    font-size: 1.8rem;
    letter-spacing: 2px;
    display: block;
}

.login-logo-text .logo-sub {
    font-size: 1rem;
    opacity: 0.9;
    letter-spacing: 3px;
    display: block;
}

.login-logo-bg {
    background: #fe0000;
    padding: 8px;
    border-radius: 12px;
    display: inline-block;
    border: 2px solid #fff;
}

/* Cards y componentes */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #374151;
}

.card-body {
    padding: 1.5rem;
}

/* Tablas */
.table {
    font-size: 0.9rem;
}

.table th {
    background-color: #f8fafc;
    border-top: none;
    font-weight: 600;
    color: #374151;
    padding: 0.75rem;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Botones */
.btn {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
}

.btn-outline-primary, .btn-outline-primary:focus, .btn-outline-primary:active {
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
    background: #fff !important;
}

.btn-outline-danger, .btn-outline-danger:focus, .btn-outline-danger:active {
    color: var(--danger-color) !important;
    border: 1px solid var(--danger-color) !important;
    background: #fff !important;
}

.btn-outline-success, .btn-outline-success:focus, .btn-outline-success:active {
    color: var(--success-color) !important;
    border: 1px solid var(--success-color) !important;
    background: #fff !important;
}

.btn-outline-primary, .btn-outline-danger, .btn-outline-success {
    color: inherit !important;
}
.btn-outline-primary i, .btn-outline-primary .ti, .btn-outline-primary svg {
    color: var(--primary-color) !important;
    fill: var(--primary-color) !important;
}
.btn-outline-danger i, .btn-outline-danger .ti, .btn-outline-danger svg {
    color: var(--danger-color) !important;
    fill: var(--danger-color) !important;
}
.btn-outline-success i, .btn-outline-success .ti, .btn-outline-success svg {
    color: var(--success-color) !important;
    fill: var(--success-color) !important;
}

.btn-group .btn {
    border-width: 2px !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.btn-group .btn:focus, .btn-group .btn:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    border-color: #333 !important;
}

/* Formularios */
.form-control {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
}

.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* Alertas */
.alert {
    border-radius: 6px;
    border: none;
    padding: 1rem;
}

/* Modales */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    color: #6b7280;
}

/* Stats cards */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--primary-color);
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stats-label {
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* Números y moneda */
.currency {
    text-align: right;
    font-weight: 500;
}

.number {
    text-align: right;
    font-family: 'Roboto Mono', monospace;
}

/* Estados */
.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--danger-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .container-main {
        width: 98%;
        padding: 1rem 0;
    }

    .footer-content {
        width: 98%;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .navbar-nav {
        padding: 1rem 0;
    }

    .table-responsive {
        font-size: 0.8rem;
    }

    .navbar-toggler {
        padding: 0.1875rem 0.375rem; /* 50% del default de Bootstrap (0.375rem 0.75rem) */
        font-size: 0.625rem; /* 50% del default de Bootstrap (1.25rem) */
    }
    .navbar-toggler-icon {
        width: 1rem; /* 50% del default de Bootstrap (2rem) */
        height: 1rem;
        background-size: 1rem 1rem;
    }
}

/* Utilidades */
.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.text-muted {
    color: #6b7280 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Notificaciones */
.notification-item {
    animation: slideInRight 0.3s ease-out;
}

.notification-item.fade:not(.show) {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.navbar-main.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1050;
}

.footer-main.fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    z-index: 1050;
}

/* --- NAVBAR FULL WIDTH EN CELULARES --- */
@media (max-width: 767.98px) {
    html, body {
        margin: 0;
        padding: 0;
        width: 100vw;
        min-height: 100vh;
        background: var(--background-gradient);
    }
    .navbar-main {
        width: 100vw;
        left: 0;
        right: 0;
        top: 0;
        background-color: #fe0000 !important;
        /* Para cubrir el área segura en móviles con notch */
        padding-top: env(safe-area-inset-top);
        border-radius: 0 !important;
    }
    body {
        padding-top: calc(56px + env(safe-area-inset-top)); /* Ajusta según altura navbar */
    }
}

/* Créditos MVisual (componente reutilizable) */
.mvisual-credits {
    text-align: center;
    padding: 10px 14px;
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.mvisual-credits__link {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.35rem 0.85rem;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    background-color: #6c757d;
    border-radius: 6px;
    text-decoration: none;
    overflow: hidden;
    vertical-align: middle;
    transition: box-shadow 0.3s ease;
}

.mvisual-credits__swap {
    display: inline-block;
    position: relative;
    min-width: 5.5em;
    height: 1.25em;
}

.mvisual-credits__label,
.mvisual-credits__hover {
    position: absolute;
    left: 50%;
    top: 50%;
    white-space: nowrap;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.mvisual-credits__label {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.mvisual-credits__hover {
    transform: translate(-50%, -50%) scale(1.25);
    opacity: 0;
}

.mvisual-credits__link:hover {
    box-shadow: 0 6px 18px rgba(108, 117, 125, 0.4);
    color: #fff;
    text-decoration: none;
}

.mvisual-credits__link:hover .mvisual-credits__label {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
}

.mvisual-credits__link:hover .mvisual-credits__hover {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.mvisual-credits-wrapper--login {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mvisual-credits--login {
    margin-top: 28px;
    max-width: 400px;
    width: 100%;
}

.mvisual-credits--footer {
    background: transparent;
    box-shadow: none;
    padding: 6px 0;
    font-size: 14px;
    color: #9ca3af;
}

.mvisual-credits--inline {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 14px;
}