/* Barra de entorno fija inferior */
.env-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Development: roja */
.env-bar--dev {
    background: #dc3545;
    color: #fff;
    height: 16px;
    line-height: 16px;
    font-size:8px;
}

/* Sandbox: amarilla */
.env-bar--sandbox {
    background: #ffc107;
    color: #000;
    height: 16px;
    line-height: 16px;
    font-size:8px;
}

/* Producción: solo línea inferior 1px */
.env-bar--prod {
    background: transparent;
    height: 1px;
    border-top: 1px solid #0d6efd;
    /* main color */
}

/* Sidebar normal */
aside.sidebar {
    transition: transform 0.3s ease;
}

/* Sidebar oculto */
body.sidebar-hidden aside.sidebar {
    transform: translateX(-100%);
}

/* Ajuste del contenido cuando se oculta */
body.sidebar-hidden .main-content {
    width: 100%;
    /* Anula el margen reservado al sidebar (definido en sidebar.css) */
    margin-left: 0;
}

/* El contenido es flex item; sin esto no se encoge por debajo del ancho
   mínimo de su contenido (textos largos sin espacios) y genera scroll
   horizontal. min-width:0 permite que envuelva y respete el padding. */
.main-content {
    min-width: 0;
    overflow-x: hidden;
}
aside.sidebar {
    transition: transform 0.3s ease;
}

body.sidebar-hidden aside.sidebar {
    transform: translateX(-100%);
}

.sidebar-toggle {
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 20px;
    cursor: pointer;
}

/* ============================================================
   Móvil: tablas dentro de tarjetas (.card-body) envueltas en
   .table-responsive. En pantallas chicas reducimos el texto a
   12px, quitamos la negrita (incluye el .fw-bold del <span> del
   nombre de la moneda, por eso se incluye el descendiente "*")
   y achicamos el padding de las celdas para que no se vean tan
   espaciadas. No afecta el input de monto (font-size: 2rem)
   porque vive fuera de la tabla.
   ============================================================ */
@media (max-width: 767.98px) {
    .card-body .table-responsive table th,
    .card-body .table-responsive table td,
    .card-body .table-responsive table td * {
        font-size: 12px !important;
        font-weight: 400 !important;
    }

    .card-body .table-responsive table > :not(caption) > * > * {
        padding: 0.25rem 0.4rem !important;
    }
}

/* ============================================================
   Móvil: las cards ocupan todo el ancho de la pantalla (borde a
   borde). El espacio lateral no lo genera la .card sino el padding
   de los contenedores y los gutters del grid de Bootstrap, así que
   ponemos todo eso a cero. El padding interno de .card-body se
   mantiene para que el contenido no quede pegado a los bordes.
   ============================================================ */
@media (max-width: 767.98px) {
    .container,
    .container-fluid,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .row {
        --bs-gutter-x: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    [class^="col"],
    [class*=" col"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .card {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ============================================================
   Móvil: el home del usuario (layout dashboard_client) se ve con
   el texto demasiado grande. Reducimos el tamaño base y las
   clases de títulos/utilidades de Bootstrap (h1-h6 / .fs-1-.fs-6)
   SOLO dentro de .dashboard-client .main-content, para no afectar
   los dashboards de admin, super, reportes ni compliance que
   comparten la clase .main-content.
   ============================================================ */
@media (max-width: 767.98px) {
    .dashboard-client .main-content {
        font-size: 0.9rem;
    }

    .dashboard-client .main-content h1,
    .dashboard-client .main-content .h1,
    .dashboard-client .main-content .fs-1 {
        font-size: 1.6rem !important;
    }

    .dashboard-client .main-content h2,
    .dashboard-client .main-content .h2,
    .dashboard-client .main-content .fs-2 {
        font-size: 1.4rem !important;
    }

    .dashboard-client .main-content h3,
    .dashboard-client .main-content .h3,
    .dashboard-client .main-content .fs-3 {
        font-size: 1.2rem !important;
    }

    .dashboard-client .main-content h4,
    .dashboard-client .main-content .h4,
    .dashboard-client .main-content .fs-4 {
        font-size: 1.05rem !important;
    }

    .dashboard-client .main-content h5,
    .dashboard-client .main-content .h5,
    .dashboard-client .main-content .fs-5 {
        font-size: 1rem !important;
    }

    .dashboard-client .main-content h6,
    .dashboard-client .main-content .h6,
    .dashboard-client .main-content .fs-6 {
        font-size: 0.9rem !important;
    }
}