/* Ajustes mobile first sobre o Bootstrap 5 */

body {
    background-color: #f4f5f7;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Botões e campos com área de toque confortável no celular */
.btn, .form-control, .form-select {
    min-height: 44px;
}
.btn-sm {
    min-height: 36px;
}

/* Rótulo flutuante (padrão de todos os formulários, como no login):
   a dica de formato (placeholder) aparece quando o campo recebe o foco */
.form-floating > .form-control:focus::placeholder {
    color: var(--bs-secondary-color);
}
.form-floating > textarea.form-control {
    height: 10rem;
}
.form-floating > .form-control-plaintext {
    font-weight: 600;
}

/* Permite truncar texto dentro de itens flex */
.min-w-0 {
    min-width: 0;
}
.list-group-item > .badge,
.list-group-item > form,
.list-group-item > .ficha {
    flex-shrink: 0;
}

/* Cabeçalho das páginas */
.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: 1rem;
}
.page-title h1 {
    font-size: 1.35rem;
    margin: 0;
}

/* Atalhos da página inicial */
.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 110px;
    padding: 1rem .5rem;
    text-align: center;
    text-decoration: none;
    color: var(--bs-body-color);
    background: #fff;
    border-radius: .75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: transform .1s ease;
}
.tile:active {
    transform: scale(.97);
}
.tile i {
    font-size: 2rem;
    color: var(--bs-primary);
}
.tile span {
    font-size: .9rem;
    line-height: 1.2;
}

/* Número de ficha em destaque */
.ficha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: .35rem .5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-radius: .5rem;
    background: var(--bs-secondary-bg);
}
.ficha.p {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
}
.ficha.n {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

/* Contador +/- (passe e desobsessão) */
.stepper {
    max-width: 170px;
    flex-wrap: nowrap;
}
.stepper .btn {
    width: 50px;
    font-size: 1.5rem;
    line-height: 1;
}
.stepper input {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Barra de ações fixa no rodapé (celular) */
.action-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, #f4f5f7 80%, rgba(244, 245, 247, 0));
}

.relogio {
    font-variant-numeric: tabular-nums;
}

.list-group-item.feita {
    background: var(--bs-success-bg-subtle);
}
.list-group-item.desistiu {
    background: var(--bs-danger-bg-subtle);
}

/* Telas maiores */
@media (min-width: 992px) {
    .page-title h1 {
        font-size: 1.75rem;
    }
    .tile {
        min-height: 140px;
    }
    .action-bar {
        position: static;
        background: none;
    }
}

/* Impressão (relatórios): só o conteúdo, sem menu e sem sombras */
@media print {
    body {
        background: #fff;
    }
    .navbar, .alert-dismissible {
        display: none !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    .relatorio-grupo .card-header {
        break-after: avoid;
    }
}
