/* =====================================================================
   GESTAO LIMPEZA — tema
   Camada de personalizacao por cima do Bootstrap 5.3 (alojado localmente
   em assets/vendor/bootstrap). Aqui so esta:
     1. a paleta da marca, aplicada atraves das variaveis do Bootstrap
     2. os componentes que o Bootstrap nao tem (menu inferior, cartao de
        servico, calendario, estrelas)
   Tudo o resto — grelha, formularios, botoes, badges — e Bootstrap puro.

   Paleta: lilas + branco + cinzas frios.
   ===================================================================== */

:root {
    /* -------------------------------------------------- marca */
    --roxo-900: #2E2350;
    --roxo-700: #5B3FB8;
    --roxo-600: #6D4AC4;
    --roxo-500: #8163D8;
    --roxo-300: #B9A6EE;
    --roxo-100: #EDE7FB;
    --roxo-50:  #F7F4FE;

    --nav-altura: 64px;

    /* ------------------------------- variaveis do Bootstrap */
    --bs-primary: #6D4AC4;
    --bs-primary-rgb: 109, 74, 196;
    --bs-primary-text-emphasis: #4A3186;
    --bs-primary-bg-subtle: #EDE7FB;
    --bs-primary-border-subtle: #D6C9F5;

    --bs-body-bg: #F7F6FB;
    --bs-body-color: #33304A;
    --bs-body-font-size: 1rem;
    --bs-heading-color: #211D31;
    --bs-emphasis-color: #211D31;
    --bs-secondary-color: #6E6A85;

    --bs-border-color: #E6E2F0;
    --bs-border-color-translucent: rgba(46, 35, 80, .09);
    --bs-border-radius: .875rem;
    --bs-border-radius-sm: .625rem;
    --bs-border-radius-lg: 1.125rem;

    --bs-link-color: #5B3FB8;
    --bs-link-color-rgb: 91, 63, 184;
    --bs-link-hover-color: #4A3186;

    --bs-success: #1F9D68;
    --bs-success-rgb: 31, 157, 104;
    --bs-warning: #B9761A;
    --bs-warning-rgb: 185, 118, 26;
    --bs-danger: #C93B4E;
    --bs-danger-rgb: 201, 59, 78;

    --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* O sistema tem uma identidade clara (lilas sobre branco) e e usado com
   luz do dia, em movimento. Fixamos o esquema claro para o telemovel nao
   inverter as cores e alterar a leitura dos numeros. */
:root { color-scheme: light; }

body {
    padding-bottom: calc(var(--nav-altura) + env(safe-area-inset-bottom, 0px) + 12px);
    -webkit-font-smoothing: antialiased;
}
body.sem-nav { padding-bottom: 24px; }

@media (min-width: 992px) {
    body { padding-bottom: 32px; }
}

h1, h2, h3, h4 { letter-spacing: -.015em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem;   font-weight: 650; }

.text-suave { color: var(--bs-secondary-color) !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ===================================================================
   BOTOES
   O Bootstrap 5.3 escreve as cores dos botoes em valores fixos, por isso
   a paleta da marca tem de ser reposta aqui, variavel a variavel.
   =================================================================== */

.btn {
    --bs-btn-padding-y: .65rem;
    --bs-btn-padding-x: 1.1rem;
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: .75rem;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    -webkit-tap-highlight-color: transparent;
}

.btn-sm {
    --bs-btn-padding-y: .4rem;
    --bs-btn-padding-x: .75rem;
    --bs-btn-font-size: .875rem;
    --bs-btn-border-radius: .625rem;
    min-height: 38px;
}

.btn-primary {
    --bs-btn-bg: var(--roxo-600);
    --bs-btn-border-color: var(--roxo-600);
    --bs-btn-hover-bg: var(--roxo-700);
    --bs-btn-hover-border-color: var(--roxo-700);
    --bs-btn-active-bg: var(--roxo-900);
    --bs-btn-active-border-color: var(--roxo-900);
    --bs-btn-disabled-bg: var(--roxo-300);
    --bs-btn-disabled-border-color: var(--roxo-300);
}

.btn-outline-primary {
    --bs-btn-color: var(--roxo-700);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: var(--roxo-900);
    --bs-btn-hover-bg: var(--roxo-50);
    --bs-btn-hover-border-color: var(--roxo-300);
    --bs-btn-active-color: var(--roxo-900);
    --bs-btn-active-bg: var(--roxo-100);
    --bs-btn-active-border-color: var(--roxo-300);
}

.btn-suave {
    --bs-btn-color: var(--roxo-700);
    --bs-btn-bg: var(--roxo-100);
    --bs-btn-border-color: var(--roxo-100);
    --bs-btn-hover-color: var(--roxo-900);
    --bs-btn-hover-bg: var(--roxo-300);
    --bs-btn-hover-border-color: var(--roxo-300);
}

.btn-success {
    --bs-btn-bg: #1F9D68;
    --bs-btn-border-color: #1F9D68;
    --bs-btn-hover-bg: #188457;
    --bs-btn-hover-border-color: #188457;
    --bs-btn-active-bg: #146C48;
    --bs-btn-active-border-color: #146C48;
}

.btn-outline-danger {
    --bs-btn-color: var(--bs-danger);
    --bs-btn-border-color: #F5CBD2;
    --bs-btn-bg: #fff;
    --bs-btn-hover-bg: #FCE9EC;
    --bs-btn-hover-color: var(--bs-danger);
    --bs-btn-hover-border-color: #F5CBD2;
}

/* Botao flutuante de accao principal */
.fab {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--nav-altura) + env(safe-area-inset-bottom, 0px) + 14px);
    width: 56px; height: 56px;
    border-radius: 50%;
    padding: 0;
    min-height: 0;
    font-size: 1.5rem;
    box-shadow: 0 6px 24px rgba(46, 35, 80, .22);
    z-index: 1025;
}
@media (min-width: 992px) {
    .fab { bottom: 1.5rem; right: 1.5rem; }
}

/* ===================================================================
   CARTOES E SUPERFICIES
   =================================================================== */

.card {
    --bs-card-border-color: var(--bs-border-color);
    --bs-card-border-radius: var(--bs-border-radius);
    --bs-card-inner-border-radius: calc(var(--bs-border-radius) - 1px);
    --bs-card-spacer-y: .9rem;
    --bs-card-spacer-x: .95rem;
    box-shadow: 0 2px 10px rgba(46, 35, 80, .05);
}
.card-plano { box-shadow: none; }

.card-marca {
    background: linear-gradient(135deg, var(--roxo-600), var(--roxo-500));
    border: 0;
    color: #fff;
}
.card-marca .rotulo { color: rgba(255, 255, 255, .78); }
.card-marca h1, .card-marca h2, .card-marca h3, .card-marca .numero { color: #fff; }

/* Blocos de numeros do dashboard e do financeiro */
.rotulo {
    display: block;
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: .15rem;
}
.numero {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--bs-heading-color);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.numero-sm { font-size: 1.1rem; }

/* ===================================================================
   CARTAO DE SERVICO (agenda, historico, pendentes)
   =================================================================== */

.servico {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .75rem;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .12s;
}
a.servico:hover { border-color: var(--roxo-300); color: inherit; }
.servico-cancelado { opacity: .55; }
.servico-cancelado .servico-cliente { text-decoration: line-through; }

.servico-hora {
    flex: 0 0 3.4rem;
    text-align: center;
    padding-top: 2px;
}
.servico-hora strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.15;
    color: var(--bs-heading-color);
    font-variant-numeric: tabular-nums;
}
.servico-hora span { font-size: .72rem; color: var(--bs-secondary-color); }

.servico-corpo { flex: 1 1 auto; min-width: 0; }
.servico-cliente {
    display: block;
    font-weight: 650;
    color: var(--bs-heading-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.servico-meta { font-size: .845rem; color: var(--bs-secondary-color); }
.servico-meta span + span::before { content: " · "; }

.servico-lado { flex: 0 0 auto; text-align: right; }
.servico-valor {
    display: block;
    font-weight: 700;
    color: var(--bs-heading-color);
    font-variant-numeric: tabular-nums;
}

/* Badges suaves — usam as variaveis "subtle" do Bootstrap 5.3 */
.badge {
    --bs-badge-font-weight: 650;
    --bs-badge-padding-y: .3em;
    --bs-badge-padding-x: .6em;
    --bs-badge-border-radius: 999px;
    font-size: .7rem;
    letter-spacing: .01em;
}

/* ===================================================================
   FORMULARIOS
   =================================================================== */

.form-control, .form-select {
    min-height: 48px;
    border-radius: .75rem;
    /* 16px evita o zoom automatico do iPhone ao tocar num campo */
    font-size: 1rem;
}
textarea.form-control { min-height: 92px; }

.form-control:focus, .form-select:focus {
    border-color: var(--roxo-500);
    box-shadow: 0 0 0 .2rem var(--roxo-100);
}
.form-label { font-weight: 650; font-size: .875rem; margin-bottom: .35rem; }
.form-text { font-size: .8rem; }

.form-check-input { width: 1.35em; height: 1.35em; margin-top: .1em; }
.form-check-input:checked { background-color: var(--roxo-600); border-color: var(--roxo-600); }
.form-check-input:focus { border-color: var(--roxo-500); box-shadow: 0 0 0 .2rem var(--roxo-100); }
.form-check-label { padding-left: .35rem; }

/* Caixa de opcao com toda a area tocavel */
.check-caixa {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: #fff;
    cursor: pointer;
    margin-bottom: .65rem;
}
.check-caixa .form-check-input { margin: 0; flex: 0 0 auto; }

/* Escolha rapida (duracao, estado) */
.chip {
    padding: .5rem .85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: #fff;
    font-size: .875rem;
    font-weight: 600;
    color: var(--bs-body-color);
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.chip:hover { border-color: var(--roxo-300); }
.chip-activo {
    background: var(--roxo-600);
    border-color: var(--roxo-600);
    color: #fff;
}

/* ===================================================================
   NAVEGACAO
   =================================================================== */

/* Barra superior no telemovel: so o titulo do ecra */
.barra-topo {
    background: rgba(255, 255, 255, .93);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--bs-border-color);
    padding-top: env(safe-area-inset-top, 0px);
}
.barra-topo__titulo {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--bs-heading-color);
    margin: 0;
}

/* Menu inferior (telemovel) */
.nav-inferior {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;
    display: flex;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--bs-border-color);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-inferior__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--nav-altura);
    font-size: .68rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.nav-inferior__item:hover { color: var(--roxo-600); }
.nav-inferior__item.activo { color: var(--roxo-600); }
.nav-inferior__item i { font-size: 1.3rem; line-height: 1; }
.nav-inferior__sinal {
    position: absolute;
    top: 9px;
    margin-left: 22px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--bs-danger);
    border: 2px solid #fff;
}

/* Barra de navegacao no computador */
.navbar-marca {
    font-weight: 700;
    color: var(--roxo-700);
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.navbar .nav-link {
    font-weight: 600;
    color: var(--bs-secondary-color);
    border-radius: .625rem;
    padding: .45rem .8rem;
}
.navbar .nav-link:hover { color: var(--roxo-700); background: var(--roxo-50); }
.navbar .nav-link.active { color: var(--roxo-700); background: var(--roxo-100); }

/* Separadores dia / semana / mes */
.nav-pills {
    --bs-nav-pills-border-radius: .625rem;
    --bs-nav-pills-link-active-bg: #fff;
    --bs-nav-pills-link-active-color: var(--roxo-900);
    background: var(--roxo-100);
    border-radius: .75rem;
    padding: .25rem;
    gap: .25rem;
}
.nav-pills .nav-link {
    font-weight: 650;
    font-size: .9rem;
    color: var(--roxo-700);
    padding: .5rem .4rem;
}
.nav-pills .nav-link.active { box-shadow: 0 2px 8px rgba(46, 35, 80, .08); }

/* Navegacao entre datas */
.seta-data {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0;
}

/* ===================================================================
   CALENDARIO MENSAL
   =================================================================== */

.calendario {
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}
.calendario__cabeca, .calendario__semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.calendario__cabeca div {
    text-align: center;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    background: var(--roxo-50);
    padding: .5rem 0;
}
.calendario__dia {
    min-height: 62px;
    padding: .3rem .2rem;
    border-top: 1px solid var(--bs-border-color);
    border-right: 1px solid var(--bs-border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--bs-body-color);
}
.calendario__dia:nth-child(7n) { border-right: 0; }
.calendario__dia:hover { background: var(--roxo-50); color: var(--bs-body-color); }
.calendario__dia--fora { color: #B9B6C7; background: #FCFCFE; }
.calendario__numero { font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.calendario__dia--hoje .calendario__numero {
    background: var(--roxo-600);
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.calendario__valor { font-size: .65rem; font-weight: 600; color: var(--bs-secondary-color); }
.calendario__pontos { display: flex; gap: 3px; }
.calendario__ponto { width: 5px; height: 5px; border-radius: 50%; background: var(--roxo-500); }
.calendario__ponto--pendente { background: var(--bs-warning); }

@media (min-width: 992px) {
    .calendario__dia { min-height: 92px; }
}

/* ===================================================================
   ESTRELAS
   =================================================================== */

.estrelas { color: #E8A33D; letter-spacing: 2px; }

.escolher-estrelas {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: .35rem;
}
.escolher-estrelas input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.escolher-estrelas label {
    font-size: 2.5rem;
    line-height: 1;
    color: #DDD8EA;
    cursor: pointer;
    transition: color .12s, transform .12s;
    -webkit-tap-highlight-color: transparent;
}
.escolher-estrelas label:hover,
.escolher-estrelas label:hover ~ label,
.escolher-estrelas input:checked ~ label { color: #E8A33D; }
.escolher-estrelas label:active { transform: scale(1.12); }
.escolher-estrelas input:focus-visible + label { outline: 2px solid var(--roxo-500); border-radius: 6px; }

/* ===================================================================
   ESTADO VAZIO E EXCERTOS
   =================================================================== */

.vazio {
    text-align: center;
    padding: 1.9rem 1.1rem;
    color: var(--bs-secondary-color);
    background: #fff;
    border: 1px dashed var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}
.vazio i { font-size: 1.8rem; opacity: .55; display: block; margin-bottom: .4rem; }

.selecionavel {
    background: var(--roxo-50);
    border: 1px solid var(--roxo-100);
    border-radius: .625rem;
    padding: .7rem .75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .82rem;
    color: var(--roxo-900);
    word-break: break-all;
}

.quebra { word-break: break-word; overflow-wrap: anywhere; }

/* Barras de valores (financeiro e relatorios) */
.progress {
    --bs-progress-height: 9px;
    --bs-progress-bg: var(--roxo-100);
    --bs-progress-border-radius: 999px;
    --bs-progress-bar-bg: var(--roxo-600);
}

/* ===================================================================
   PAGINA DE ENTRADA E PAGINAS PUBLICAS
   =================================================================== */

.pagina-auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(160deg, var(--roxo-50), #EFEBFC 55%, #E7E1FA);
}
.caixa-auth { width: 100%; max-width: 400px; }
.logo-marca {
    width: 64px; height: 64px;
    margin: 0 auto .75rem;
    background: var(--roxo-600);
    color: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    box-shadow: 0 6px 24px rgba(46, 35, 80, .18);
}

.hero-publico {
    background: linear-gradient(150deg, var(--roxo-700), var(--roxo-500) 60%, var(--roxo-300));
    color: #fff;
    padding: 2.9rem 1.1rem 2.5rem;
    text-align: center;
}
.hero-publico h1 { color: #fff; font-size: 1.7rem; }
.hero-publico p { color: rgba(255, 255, 255, .92); max-width: 34rem; margin-inline: auto; }
.hero-publico .btn-light { --bs-btn-color: var(--roxo-700); font-weight: 650; }
.hero-publico .btn-outline-light { --bs-btn-border-color: rgba(255,255,255,.6); }

.nota-publica {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: .4rem .9rem;
    font-size: .875rem;
    margin-bottom: .85rem;
}

/* ===================================================================
   IMPRESSAO
   =================================================================== */

@media print {
    body { background: #fff; padding: 0; }
    .nav-inferior, .barra-topo, .navbar, .fab, .sem-impressao { display: none !important; }
    .card, .table { box-shadow: none !important; border-color: #ccc !important; }
    a { color: #000; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
