/* Mis Cobros — estilos sobre Bootstrap.
   Pensado para una persona que ve poco: la escala sale de UN solo valor (font-size de <html>),
   porque Bootstrap mide casi todo en rem. general.js lo cambia con el botón "Aa" (3 tamaños). */
@font-face{
    font-family: fuenteRandom;
    src: url(./fuentes/Quicksand-Regular.ttf)
}
@font-face{
    font-family: fuenteRandom;
    font-weight: 700;
    src: url(./fuentes/Quicksand-Bold.ttf)
}

html {
    -webkit-text-size-adjust: 100%; /* los navegadores móviles no "corrigen" el tamaño por su cuenta */
    text-size-adjust: 100%;
    font-size: 18px; /* normal; "grande" 21px y "muy grande" 24px los pone general.js */
}

html, body {
    height: 100%;
    margin: 0;
    /* El scroll real está en .container: el menú inferior fijo no depende de la barra del navegador. */
    overflow: hidden;
}

body {
    background-color: #f5f5f5;
    font-family: fuenteRandom;
    color: #212529;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 10rem; /* espacio para el menú inferior y el botón flotante */
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tarjetas */
.card {
    border: none;
    border-radius: 16px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.titulo{ font-weight: bold; }
.cursor{ cursor: pointer; }
.oculto{ display: none; }

.fs-7{ font-size: .8rem; }
.fs-8{ font-size: .7rem; }

/* Menú inferior: ícono grande + texto siempre visible */
.tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    border-top: 1px solid #e5e5e5;
    display: flex;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
    flex: 1;
    text-align: center;
    padding: .55rem 0 .5rem;
    color: #555;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
}
.tab-item.active {
    color: #0d6efd;
    box-shadow: inset 0 3px 0 #0d6efd;
}
.tab-item i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 2px;
}

/* Modales */
.modal-content {
    border-radius: 18px;
    overflow: hidden;
}
.modal-header {
    border-bottom: none;
    padding: 20px 20px 10px;
}
.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}
.modal-body {
    padding: 20px;
    text-align: center;
    font-size: 1.05rem;
}
.modal-footer {
    border-top: none;
    padding: 10px 20px 20px;
    justify-content: center;
    gap: .5rem;
}
.modal-footer .btn { min-width: 6rem; }
.modal-footer .btn.w-25 { width: auto !important; }

/* Formularios y botones: grandes y con aire */
.form-control, .form-select {
    border-radius: 12px;
    padding: .7rem .85rem;
    min-height: 3.3rem;
    font-size: 1.1rem;
}
textarea.form-control { min-height: 0; }
.form-label {
    font-weight: 700;
    color: #444;
    font-size: 1rem;
    margin: 0 0 .25rem;
    padding: 0;
}
.form-text { font-size: .85rem; }
.btn {
    border-radius: 12px;
    font-weight: 700;
    padding: .7rem 1rem;
    font-size: 1.05rem;
}
.btn-lg {
    padding: .95rem 1.2rem;
    font-size: 1.2rem;
    border-radius: 14px;
}
.btn-block { width: 100%; }
.badge { font-weight: 700; }

/* ---------- Pantallas de Mis Cobros ---------- */

.titulo-pantalla {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Botón "Aa" para cambiar el tamaño de la letra */
.btn-letra {
    min-width: 3rem;
    height: 3rem;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #0d6efd;
    color: #0d6efd;
    background: #fff;
    font-weight: 700;
    line-height: 1;
}

/* Tarjeta grande "Te deben" */
.tarjeta-deuda {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #fff;
    border-radius: 20px;
    padding: 1.25rem 1.25rem 1.1rem;
    box-shadow: 0 6px 18px rgba(13,110,253,0.35);
}
.tarjeta-deuda .deuda-etiqueta { font-size: 1.05rem; opacity: .95; }
.tarjeta-deuda .deuda-monto {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.1;
    margin: .15rem 0 .35rem;
    word-break: break-word;
}
.tarjeta-deuda .deuda-detalle { font-size: 1rem; }
.tarjeta-deuda .deuda-cobrado {
    border-top: 1px solid rgba(255,255,255,.35);
    margin-top: .8rem;
    padding-top: .6rem;
    font-size: 1rem;
}

.seccion-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.4rem .25rem .2rem;
}

/* Tarjeta de proyecto / recibo */
.fila-grande .codigo {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}
.fila-grande .monto {
    font-size: 1.35rem;
    font-weight: 700;
    white-space: nowrap;
}
.fila-grande .sub { color: #555; font-size: .95rem; }

.recibo-pendiente { border-left: 8px solid #ffc107; }
.recibo-urgente { border-left: 8px solid #dc3545; }
.recibo-pagado { border-left: 8px solid #198754; }

.estado-chip {
    display: inline-block;
    font-size: .9rem;
    font-weight: 700;
    border-radius: 20px;
    padding: .2rem .7rem;
}
.estado-pendiente { background: #fff3cd; color: #7a5600; }
.estado-urgente { background: #f8d7da; color: #842029; }
.estado-pagado { background: #d1e7dd; color: #0f5132; }

/* Filtro Pendientes / Pagados / Todos */
.filtro-estado .btn {
    border-width: 2px;
    padding: .65rem .25rem;
    font-size: 1rem;
}

/* Buscador grande */
.buscador { position: relative; }
.buscador .fa-magnifying-glass {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    pointer-events: none;
}
.buscador input { padding-left: 2.8rem; padding-right: 3rem; }
.buscador .limpiar {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    color: #666;
}

/* Botón flotante "Nuevo recibo" */
.fab-nuevo {
    position: fixed;
    right: 16px;
    bottom: 5.6rem;
    z-index: 1020;
    border-radius: 50px;
    padding: .9rem 1.4rem;
    font-size: 1.15rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

/* Offcanvas más cómodo en celular */
.offcanvas { max-width: 100vw; }
.offcanvas-title { font-size: 1.3rem; }

/* ---------- Perfil ---------- */
.perfil-header{
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}
.perfil-avatar{ cursor: pointer; }
.perfil-foto{
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.perfil-iniciales{
    background: #fff;
    color: #0d6efd;
    font-size: 2rem;
    font-weight: 700;
}
.perfil-camara{
    position: absolute;
    right: 0;
    bottom: 0;
    width: 30px;
    height: 30px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 12px;
}
.perfil-icono{
    width: 2.4rem;
    height: 2.4rem;
    background: #f0f4ff;
    font-size: .9rem;
}
.perfil-etiqueta{
    font-size: .75rem;
    line-height: 1.2;
}
.min-w-0{ min-width: 0; }

/* Registro: recuadros de ícono del mismo ancho para alinear los campos */
#form-register .input-group-text,
#form-recupera .input-group-text,
#form-login-passenger .input-group-text{
    width: 2.75rem;
    justify-content: center;
}

/* Ojito de mostrar/ocultar contraseña */
.input-group .btn-outline-secondary{
    border-color: var(--bs-border-color);
    color: #6c757d;
}

/* Barras de scroll ocultas (se ven mal y estorban); el desplazamiento con el dedo o la rueda sigue igual */
*, html, body {
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* Edge antiguo */
}
*::-webkit-scrollbar {
    display: none;              /* Chrome, Safari, Android, iPhone */
    width: 0;
    height: 0;
}

/* Letra mínima legible: Bootstrap hace .small = 0.875em y .badge = 0.75em, que en las pantallas
   heredadas (Usuarios, Perfil) quedaban muy chicos. Todo en rem/em, así crece con el botón «Letra». */
.small, small { font-size: 0.9rem; }
.badge { font-size: 0.8rem; }
.text-muted { color: #5c636a !important; }

/* Selector de proyecto: botones grandes que se parten en filas (dentro del ancho del panel) */
.lista-proyectos-form {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.lista-proyectos-form .btn-proyecto {
    flex: 1 1 calc(50% - .6rem);
    min-width: 0;
    border-width: 2px;
    font-size: 1.15rem;
    padding: .8rem .5rem;
    overflow-wrap: anywhere;
}

/* Chips de proyecto en Recibos: se parten en varias filas, sin scroll horizontal oculto */
.chips-proyecto {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.chips-proyecto .chip-proy {
    border-width: 2px;
    padding: .45rem 1.1rem;
    font-size: 1.05rem;
}

/* N° de recibo: el dato más importante de la tarjeta, resaltado en una insignia */
.badge-recibo {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border: 2px solid #0d6efd;
    border-radius: 10px;
    padding: .2rem .7rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

/* ---------- PC, laptop y tablet ----------
   La app es una columna de 500 px centrada: el menú inferior y el botón «Nuevo» se alinean con esa columna
   (antes el menú se estiraba a todo el ancho de la pantalla). */
@media (min-width: 501px) {
    .tab-nav {
        left: 50%;
        width: 500px;
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
    }
    .fab-nuevo {
        right: calc(50% - 250px + 16px);
    }
}

/* ---------- iPhone / iPad con muesca o barra inferior ---------- */
@supports (padding: env(safe-area-inset-top)) {
    .container {
        padding-top: env(safe-area-inset-top);
    }
    .tab-nav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}
