/**
 * styles.css - Estilos de Centra Carmen
 * 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: #eef0f3;
    min-height: 100vh;
}

/* Área interna — escritorio */
body.app-page--desktop {
    min-width: 1280px;
}

/* Layout principal */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar-main {
    background: linear-gradient(90deg, #991b1b 0%, #dc2626 45%, #b91c1c 100%) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    padding: 0.35rem 0;
}

.app-navbar-inner {
    width: 92%;
    max-width: 1440px;
    margin: 0 auto;
}

.navbar-app .navbar-system-name {
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.navbar-app .navbar-toggler {
    display: none;
}

.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: 92%;
    max-width: 1440px;
    margin: 0 auto;
    flex: 1;
    padding: 5.25rem 0 3.75rem 0;
}

.app-page--desktop .container-main > .card:first-child,
.app-page--desktop .container-main > .row:first-child .card {
    border-radius: 12px;
}

/* Footer */
.footer-main {
    background: linear-gradient(90deg, #111827 0%, #1f2937 100%);
    border-top: 3px solid #dc2626;
    color: white;
    padding: 0.85rem 0;
    margin-top: auto;
}

.footer-content {
    width: 92%;
    max-width: 1440px;
    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 (escritorio): uso interno desde PC */
.login-page--desktop {
    min-width: 1280px;
    min-height: 100vh;
    background: #eef0f3;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(480px, 0.95fr);
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    box-shadow: 0 0 48px rgba(15, 23, 42, 0.08);
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 4rem;
}

.login-panel--brand {
    background: linear-gradient(145deg, #b91c1c 0%, #dc2626 42%, #991b1b 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-panel--brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.15), transparent 50%);
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-brand-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 1.25rem 0 0.75rem;
}

.login-brand-lead {
    font-size: 1.05rem;
    line-height: 1.55;
    opacity: 0.95;
    margin-bottom: 1.75rem;
}

.login-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-size: 0.95rem;
}

.login-brand-features li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
}

.login-panel--form {
    background: #fff;
}

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

.login-form-header {
    margin-bottom: 1.75rem;
}

.login-form-title {
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.35rem;
}

.login-form-subtitle {
    font-size: 0.95rem;
}

.login-alert {
    font-size: 0.9rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.login-input-group .input-group-text {
    background: #f8fafc;
    border-color: #d1d5db;
    color: #6b7280;
}

.login-input-group .form-control {
    border-color: #d1d5db;
}

.login-input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.15);
}

.login-submit {
    font-weight: 600;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border: none;
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.login-submit:hover {
    background: linear-gradient(180deg, #dc2626, #b91c1c);
}

.login-recover {
    margin-top: 1.25rem;
}

.login-recover-link {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-recover-link:hover {
    text-decoration: underline;
    color: #b91c1c;
}

.login-logo {
    width: min(100%, 320px);
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.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: transparent;
    padding: 0;
    border: none;
    display: block;
    line-height: 0;
}

.navbar-logo {
    height: 38px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

/* Cards y componentes */
.card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background: #fff;
}

.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: linear-gradient(180deg, #ef4444, #dc2626);
    border: none;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, #dc2626, #b91c1c);
    color: #fff;
}

.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: 2rem;
    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;
}

/* Guía de inicio (dashboard) */
.guia-inicio-card .card-header {
    background: #fff;
}

.guia-inicio-toggle {
    padding: 1rem 1.25rem;
    background: transparent;
    border: 0;
    color: inherit;
    transition: background 0.2s ease;
}

.guia-inicio-toggle:hover {
    background: #f8fafc;
}

.guia-inicio-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.guia-inicio-chevron {
    transition: transform 0.25s ease;
    color: #6b7280;
}

.guia-inicio-toggle[aria-expanded='true'] .guia-inicio-chevron {
    transform: rotate(180deg);
}

.guia-flujo {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.35rem;
    padding-bottom: 0.25rem;
}

.guia-flujo--corta {
    max-width: 720px;
}

.guia-flecha {
    display: flex;
    align-items: center;
    color: #dc2626;
    font-size: 1.35rem;
    flex-shrink: 0;
    padding: 0 0.15rem;
}

.guia-paso {
    position: relative;
    flex: 1 1 0;
    min-width: 148px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 0.75rem 0.85rem;
    text-align: center;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.guia-paso--operacion {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
}

.guia-paso--analisis {
    border-color: #e5e7eb;
    background: #f9fafb;
}

.guia-paso-num {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.guia-paso-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin: 0.75rem 0 0.35rem;
}

.guia-paso-titulo {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--dark-color);
}

.guia-paso-texto {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.65rem;
    line-height: 1.35;
    min-height: 2.5em;
}

.guia-resumen-flujo {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #374151;
}

.guia-tabs .nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
}

.guia-tabs .nav-link.active {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    color: #fff;
}

.guia-tabs .nav-link:not(.active):hover {
    background: #fef2f2;
    color: #b91c1c;
}

.guia-paso--ancho {
    text-align: left;
    padding: 1.25rem 1.35rem;
}

.guia-paso--ancho .guia-paso-icon {
    text-align: left;
}

.guia-checklist li {
    margin-bottom: 0.35rem;
    color: #374151;
}

.guia-nota {
    background: #f8fafc;
}

.guia-flujo--reportes {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.75rem;
}

.guia-flujo--reportes .guia-paso {
    flex: 0 1 200px;
    min-width: 180px;
}

.guia-flujo--reportes .guia-paso-num {
    background: #6b7280;
    box-shadow: none;
}