@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap');

/* =====================================================
   DESIGN SYSTEM
===================================================== */
:root {
    --primary: #1e3a8a;        /* azul moderno */
    --primary-dark: #172554;
    --secondary: #10b981;      /* verde */
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0284c7;

    --bg-main: #f4f6fb;
    --bg-card: #ffffff;
    --bg-muted: #f1f5f9;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #ffffff;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --normal-color: #065f46;
    --normal-bg-soft: #ecfdf5;

    --pref-color: #92400e;
    --pref-bg-soft: #fffbeb;

    --transition: all .25s ease;
}

/* --- GERAL --- */
* {
    font-family: 'Poppins', sans-serif;
}

html, body {
    height: 100%;
    background: var(--bg-main);
    color: var(--text-main);
}

#msg_body {
    z-index: 9999;
}

/* --- CONFIGURAÇÕES DE PÁGINA --- */
body .page-config, body .page-noConfig {
    font-size: 0.9vw;
}

body .page-config .alert {
    --bs-alert-bg: unset;
    --bs-alert-border-color: unset;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
    border-radius: 8px;
    border: none;
}

.container-row {
    box-sizing: border-box;
    height: 100vh;
}

.container {
    height: 100vh;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
    background: white;
}

.page-config form {
    display: contents !important;
}

/* --- INPUTS E FORMULÁRIOS MODERNOS --- */
.form-control, .form-select {
    font-size: unset;
    border-radius: 8px; /* Arredondado */
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    background-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(13, 71, 161, 0.15); /* Foco azul suave */
    border-color: #0d47a1;
}

.card-header {
    background-color: #e9ecef !important; /* Cinza mais moderno que gainsboro */
    border-bottom: unset;
    font-weight: 600;
    color: #495057;
}

/* --- UTILITÁRIOS DE LARGURA (Mantidos) --- */
.w20 {width: 20%;} .w25 {width: 25%;} .w35 {width: 35%;}
.w40 {width: 40%;} .w50 {width: 50%;} .w60 {width: 60%;}
.w65 {width: 65%;} .w75 {width: 75%;} .w80 {width: 80%;}
.w100 {width: 100%;}
.w20, .w25, .w35, .w40, .w50, .w60, .w65, .w75, .w80, .w100 {
    display: flow-root;
}

/* --- TELA DE BLOQUEIO / CARD FIX --- */
#card-fix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 93vh;
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%); /* Gradiente Azul */
    color: white;
    font-weight: 600;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- TIPOGRAFIA GRANDE --- */
.senha {
    border: 2px solid rgba(255,255,255,0.3); /* Borda translúcida */
    border-radius: 50px; /* Mais arredondado */
    padding: 0.5rem 2rem;
    background: rgba(255,255,255,0.1); /* Fundo vidro */
    backdrop-filter: blur(5px);
}

.senha, .paciente, .sala, .profix {
    font-size: 10vh;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.paciente { font-size: 12vh; font-weight: 700; }
.profix { font-size: 5vh; opacity: 0.9; }

/* --- GRID PRINCIPAL (Mantido) --- */
#body {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: .3rem;
    padding: .3rem;
    align-items: start;
}

#recentes {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
}

#ads {
    grid-column: span 8;
    background: var(--bg-card);
    z-index: 9997;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
    overflow: hidden;
}

.ads-full {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 92vh;
}

#lista {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
}

#historico {
    grid-column: span 12;
}

.historico-fixo, .lista-fixa {
    position: fixed;
    bottom: calc(7vh + 0.5rem);
    left: .5rem;
    width: calc(100vw - 1rem);
    z-index: 9998;
}

/* --- BOTÕES DE UNIDADE --- */
.select_id {
    transition: all 0.2s ease;
    font-size: 1vw;
    border-radius: 6px; /* Suave */
}

.select_id:hover,
.select_id:focus {
    outline: none;
    transform: translateY(-2px); /* Efeito de levitação */
    color: white;
    background-color: #2e7d32; /* Verde Material Design */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* --- TOPO --- */
#topo {
    /* background: linear-gradient(90deg, #1565c0, #0d47a1); Azul Moderno */
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-light);
    padding: .6rem .8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
}

#u {
    color: white;
    align-items: center;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- CARDS E ESTRUTURA INTERNA (Pai/Filho mantidos) --- */
.pai {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: .5rem;
}
.filho {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#p, #p > .pai, #l, #l > .pai  {
    flex: 1;
}
#p > .pai > .filho {
    transition: flex 0.3s ease, max-width 0.3s ease;
}

/* --- ESTILO DOS CARDS --- */
#p > div > div > .card {
    /* Card Principal - Chamada Atual */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
    border-radius: 16px !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-light);
    border: none !important; /* Remove borda sólida antiga */
}

div > div > .card > .card {
    border: 0 !important;
    background: transparent !important; /* Garante que o fundo do pai prevaleça */
}

#p > div > div > .card > .card {
    color: var(--text-light);
}

/* Tipografia Card Principal */
#p .cidadao { font-size: 1.8vw; font-weight: 700; margin-bottom: 5px; }
#p #local { font-size: 1.8vw; background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 4px; }
#p .profissional { font-size: 1.5vw; opacity: 0.9; }
#p #hora { font-size: 1.5vw; font-weight: 300; }

/* --- LISTAS E HISTÓRICO --- */
#l {
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

#l > div > div {
    border: none;
    padding: 0.5rem;
    background: white;
    margin-bottom: 2px;
    border-radius: 8px; /* Card visual */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
}

#l > div > div > .card {
    border: 0 !important;
    border-radius: unset !important;
}

/* Tipografia Lista */
#l .cidadao { font-size: 1.2vw; font-weight: 600; color: #333; }
#l #local { font-size: 1.4vw; color: #1565c0; font-weight: 700; }
#l .profissional { font-size: 1.2vw; color: #666; }
#l .risco_senha { font-size: 1.2vw; }
#l #hora { font-size: 1.2vw; color: #888; }

#l .cidadao, #l #local, #l .profissional  {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* --- BARRAS DE TÍTULO --- */
#r, #msg_body {
    grid-column: span 12;
    display: flex;
    align-items: center;
    padding: .5rem;
    max-height: 4vh;
    font-size: 1.2vw;
    margin-bottom: .5rem;
    border-radius: 8px; /* Arredondado */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
}
#r {
    color: white;
    background: linear-gradient(90deg, #2e7d32, #43a047); /* Verde vibrante */
}

#a {
    max-height: 4vh;
    color: white;
    background-color: #455a64; /* Blue Grey moderno */
    font-size: 1vw;
    padding: .5rem;
    margin-bottom: .5rem;
    border-radius: 8px;
    font-weight: 600;
}

.cidadao, .profissional {
    width: 60%;
}
.local_tipo_hora {
    position: absolute;
    right: 0;
    width: 40%;
    height: 100%;
    text-align: center;
}

#s {
    max-height: 4vh;
    font-size: 1vw;
    padding: .5rem;
    margin-bottom: .5rem;
}

/* Histórico Cards */
#h {
    font-size: 0.8vw;
    overflow-y: hidden;
}
#h .cidadao { font-size: 1vw; font-weight: 600; }
#h > div > div {
    border: none;
    padding: 0.5rem;
    background: white;
    height: auto;
    border-radius: 8px;
    margin-bottom: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
}
#h > div > div > .card {
    border: 0 !important;
    border-radius: unset !important;
}

/* --- BOTÕES --- */
#change i {
    color: var(--text-light);
    font-size: 1.8vw;
    transition: var(--transition);
}

#change i:hover {
    transform: rotate(180deg) scale(1.1);
}

/* --- RELÓGIO --- */
.clock {
    align-items: center;
    color: white;
    font-size: 2vw;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.cidadao > .risco_senha {
    align-items: center;
}

/* --- CORES DE RISCO (BOLINHAS) --- */
/* Atualizado para cores Material Design e removida borda grossa */
.risco0, .risco1, .risco2, .risco3, .risco4, .risco5, .risco6, .risco7, .risco8, .risco9 {
    padding: 0.8vw;
    margin-right: 4px;
    border-radius: 50%; /* 100% */
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Sombra para destaque */
}

.risco0, .risco1, .risco9 { background-color: #1976d2; } /* Azul */
.risco6, .risco2 { background-color: #388e3c; } /* Verde */
.risco3 { background-color: #fbc02d; } /* Amarelo Ouro */
.risco4, .risco7 { background-color: #f57c00; } /* Laranja */
.risco5, .risco8 { background-color: #d32f2f; } /* Vermelho */

.senha {
    display: flex;
    justify-content: center;
    align-items: center;
}
.senha > .risco0, .senha > .risco6, .senha > .risco7, .senha > .risco8, .senha > .risco9 {
    width: 10vh;
    height: 10vh;
}

/* Badge de senha (pílula) */
#p .borda_senha, #l .borda_senha {
    display: flex;
    align-items: center;
    padding-left: 4px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 50px;
    padding-right: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
    font-size: 1.5vw;
    color: #333; /* Texto escuro dentro da pílula */
}
#p .borda_senha {
    font-size: 2vw;
    border: none;
    background: rgba(255,255,255,0.9);
}

.video-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px; /* Arredondado no vídeo */
}
video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- MODAL PIN --- */
.modal {
    z-index: 9999;
}
.modal-content {
    font-size: 2vw !important;
    border-radius: 20px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
}
.keyboard-key {
    font-weight: 600;
    margin: 4px;
    height: 7vh;
    border-radius: 12px;
    transition: all 0.1s;
    border: 1px solid #dee2e6;
}
.keyboard-key:hover,
.keyboard-key:focus {
    outline: none;
    color: white;
    background-color: #2e7d32;
    transform: scale(1.02);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
    border-color: #2e7d32;
}
.keyboard-row {
    display: flex;
    justify-content: center;
}

.keyboard-key, .keyboard-delete, .keyboard-empty {
   display: flex;
   justify-content: center;
   align-items: center;
}

.modal-title {
    text-align: center;
    font-weight: 700;
}

#pinInput {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    color: #2e7d32;
    height: 7vh;
    background: #f1f8e9;
    border: 2px solid #c5e1a5;
    border-radius: 12px;
    letter-spacing: 5px;
}

.overflowY {
    overflow-y: auto !important;
}

.alert {
    margin-bottom: 4px !important;
    border-radius: 8px;
}

#infoModal .alert {
    font-size: .85rem !important;
}

/* --- CAROUSEL --- */
.carousel {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-container {
    display: flex;
    white-space: nowrap;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    display: flex;
}

.carousel-slide img {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 7vh;
    background: #FFF;
    background-image: url('assets/img/footer-1920x100.jpg');
    background-position: left;
    background-repeat: no-repeat;
    background-size: 100% auto;
    z-index: 9998;
    /* border-top: 4px solid #1565c0; Linha de acabamento */
}

/* --- TICKET & CONFIGS --- */
.ticket ul {
    display: table-row;
    list-style: none;
}
.ticket li {
    display: table-row;
}
.ticket li::before {
    display: table-cell;
    text-align: right;
    content: "+";
    font-size: 1em;
    font-weight: bold;
    color: #FF404C;
    padding-right: 12px;
}
.ticket ul {
    margin: 0;
    padding: 0;
}
.ticket li:hover {
    background-color: rgba(0,0,0,0.05); /* Suave */
}
.ticket li:before:hover {
    background-color: rgba(0,0,0,0.05);
}
.ticket li:not(:first-of-type)::before {
    padding-top: 12px;
}

.config {
    font-size: .85rem !important;
}

.painel {
    font-weight: 600;
}

/* --- RANGE SLIDER (Moderno) --- */
.range input{
    -webkit-appearance:none;
    height:6px; /* Mais grosso */
    border-radius:5px;
    background-color: #e0e0e0;
    outline:none;
}
.range input::-webkit-slider-thumb{
    -webkit-appearance:none;
    width:24px; /* Maior */
    height:24px;
    border-radius:50%;
    background-color: #1565c0; /* Azul */
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Sombra leve */
}
.range span{
    position:absolute;
    margin-left:14px;
    margin-top: -5px;
    width:50px;
    height:30px;
    background-color: #333;
    color:#fff;
    border-radius:4px;
    text-align:center;
    line-height:30px;
    font-size: 0.8rem;
}
.range span:before{
    content:'';
    position:absolute;
    border-right:9px solid transparent;
    border-left:9px solid transparent;
    border-bottom:12px solid #333;
    left:-10px;
    top:50%;
    transform:translateY(-50%) rotate(-90deg);
}

/* --- CONFIGURAÇÕES GERAIS DA PÁGINA (config.html) --- */

/* Container Principal - Efeito de Cartão */
.config.container {
    background-color: #ffffff;
    border-radius: 20px; /* Bordas bem arredondadas */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* Sombra suave e difusa */
    height: 96vh;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Títulos */
.config h2 {
    font-weight: 700;
    color: #1565c0; /* Azul principal */
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #455a64;
    border-left: 6px solid #1565c0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 10px;
    align-items: center;
    justify-content: flex-start;
}

/* Botão de Voltar */
#left a i {
    color: #90a4ae;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    border-radius: 50%;
}
#left a i:hover {
    background-color: #e3f2fd;
    color: #1565c0;
    transform: scale(1.1);
}

/* --- ABAS DE NAVEGAÇÃO (Tabs) --- */
.nav-tabs {
    border-bottom: none; /* Remove a linha padrão do Bootstrap */
    gap: 10px;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 12px;
    display: inline-flex; /* Mantém agrupado */
    flex-wrap: wrap;
}

.nav-tabs .nav-link {
    border: none !important;
    border-radius: 8px !important;
    color: #546e7a;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 20px;
}

.nav-tabs .nav-link:hover {
    background-color: #e0e0e0;
    color: #263238;
}

/* Aba Ativa - Estilo "Pílula" com Gradiente */
.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: white !important;
    box-shadow: 0 4px 10px rgba(21, 101, 192, 0.3);
    font-weight: 600;
}

/* --- FORMULÁRIOS E INPUTS --- */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #546e7a;
    margin-bottom: 5px;
}

.form-control, .form-select {
    /* background-color: #f1f3f4; Fundo cinza claro estilo Google */
    /* border: 1px solid transparent; */
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1); /* Glow azul suave */
    outline: none;
}

/* Inputs de Grupo (Addons) */
.input-group-text {
    background-color: #e9ecef;
    border: none;
    border-radius: 8px 0 0 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #455a64;
}
.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* --- BOTÃO SALVAR (Principal) --- */
.btn-save {
    background: linear-gradient(90deg, #2e7d32, #43a047); /* Gradiente Verde */
    border: none;
    padding: 12px 20px;
    border-radius: 30px; /* Redondo */
    font-size: .85rem !important;
    font-weight: 600;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
    background: linear-gradient(90deg, #43a047, #2e7d32);
}

/* --- OUTROS ELEMENTOS --- */

/* Botão Mudar Senha */
.reset-pass {
    width: 100%;
    border-radius: 8px;
    font-weight: 600;
}

/* Modal Info */
.fa-question-circle {
    color: #FFF;
    background: #1565c0;
    cursor: pointer;
    border: 0;
    font-size: 1rem;
    border-radius: 100%;
    transition: color 0.2s;
}
.fa-question-circle:hover {
    transform: scale(1.1);
}

/* Range Slider Personalizado */
input[type=range] {
    -webkit-appearance: none; 
    width: 100%; 
    background: transparent; 
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #1565c0;
    cursor: pointer;
    margin-top: -8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #dfe6e9;
    border-radius: 2px;
}

/* Badge de Tipos de Arquivo */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 6px 10px;
    border-radius: 6px;
}
.text-bg-info {
    background-color: #e3f2fd !important;
    color: #0277bd !important;
}
.text-bg-warning {
    background-color: #fff8e1 !important;
    color: #f57f17 !important;
}

/* Alertas */
.alert-secondary {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #455a64;
    border-radius: 12px;
}

/* Container da Tabela */
.table {
    border-collapse: separate; /* Necessário para o border-radius funcionar */
    border-spacing: 0;
    width: 100%;
    margin-bottom: 1rem;
    background-color: #fff;
    border-radius: 12px; /* Arredondamento nos cantos da tabela */
    overflow: hidden; /* Garante que o conteúdo não vaze das bordas arredondadas */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Sombra leve */
    border: 1px solid #e9ecef; /* Borda externa sutil */
}

/* Cabeçalho (Header) */
.table thead tr {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%); /* Azul do tema */
}
.table thead th {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 15px;
    border: none; /* Remove bordas padrão feias */
}

/* Corpo e Células */
.table tbody td {
    padding: 12px 15px; /* Mais espaçamento interno (respiro) */
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4; /* Linha divisória bem suave */
    color: #455a64;
    font-size: 0.9rem;
}

/* Correção do STRIPED (Zebra) */
/* O Bootstrap usa uma variável --bs-table-accent-bg que é muito escura. Vamos clarear. */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #f8f9fa; /* Cinza quase branco, muito suave */
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg); /* Garante a cor */
    color: #37474f;
}

/* Efeito Hover (Ao passar o mouse) */
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #e3f2fd; /* Azul muito claro ao passar o mouse */
    color: #1565c0; /* Texto fica azul para indicar seleção */
    cursor: default;
}

/* Remove bordas duplas se estiver usando table-bordered */
.table-bordered > :not(caption) > * {
    border-width: 0; 
}
.table-bordered > tbody > tr > td {
    border-right: 1px solid #f1f3f4; /* Apenas divisórias verticais sutis */
}
.table-bordered > tbody > tr > td:last-child {
    border-right: none;
}

/* 1. Webkit (Chrome, Edge, Safari, Opera) */
.container::-webkit-scrollbar {
    width: 8px;  /* Largura vertical */
    height: 8px; /* Altura horizontal */
}

/* Fundo da barra (Trilho) */
.container::-webkit-scrollbar-track {
    background: transparent; /* Fundo transparente para parecer flutuante */
    border-radius: 4px;
    margin: 10px 0; /* Margem superior/inferior para não colar nas bordas */
}

/* O "pegador" da barra (Thumb) */
.container::-webkit-scrollbar-thumb {
    background-color: #cfd8dc; /* Cinza azulado suave (estado normal) */
    border-radius: 10px;       /* Pílula redonda */
    border: 2px solid #fff;    /* Borda branca cria um "respiro" interno */
}

/* Efeito ao passar o mouse ou clicar */
.container::-webkit-scrollbar-thumb:hover {
    background-color: #1565c0; /* Azul do tema para destaque */
    border-width: 1px;         /* Aumenta ligeiramente a área de cor */
}

/* 2. Firefox (Suporte parcial via propriedades padrão) */
.container {
    scrollbar-width: thin;          /* Barra fina */
    scrollbar-color: #cfd8dc #fff;  /* Cor da barra / Cor do fundo */
}


/* =========================
   CONTAINER
   ========================= */
#toten-container {
    grid-column: 1 / -1;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: 14vh 1fr;
    background: linear-gradient(180deg, #f9fafb, #e5e7eb);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.toten-header {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.toten-brand {
    font-size: 4.5vw;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--primary);
}

.toten-main {
    height: 100%;
    width: 100%;
}

.toten-main--inicio {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.toten-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2vh;
    font-size: 4.5vw;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: background .15s ease, transform .1s ease;
}

.toten-btn:active {
    transform: scale(0.97);
}

.toten-btn.normal {
    background: var(--normal-bg-soft);
    color: var(--normal-color);
}

.toten-btn.preferencial {
    background: var(--pref-bg-soft);
    color: var(--pref-color);
}

.toten-icon {
    width: 10vw;
    height: 10vw;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.toten-text {
    font-size: 5vw;
    font-weight: 600;  
}

.toten-main--confirmacao {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.toten-confirm {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.confirm-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4vw;
    font-weight: 700;
    padding: 0 8vw;
}

.confirm-text.normal {
    color: var(--normal-color);
    background: var(--normal-bg-soft);
}

.confirm-text.preferencial {
    color: var(--pref-color);
    background: var(--pref-bg-soft);
}

.confirm-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 35vh;
}

.confirm-btn {
    font-size: 4.5vw;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.confirm-btn.sim {
    background: #e0f2fe;
    color: #1e3a8a;
}

.confirm-btn.sim.normal {
    background: var(--normal-bg-soft);
    color: var(--normal-color);
}

.confirm-btn.sim.preferencial {
    background: var(--normal-bg-soft);
    color: var(--normal-color);
}

.confirm-btn.nao {
    background: #fee2e2;
    color: #7f1d1d;
}

.toten-main--feedback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toten-feedback {
    font-size: 4vw;
    font-weight: 700;
    text-align: center;
}

.feedback-ok {
    color: #065f46;
}

.feedback-erro {
    color: #7f1d1d;
}

.toten-main--inicio {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: hidden;
}

.toten-idle-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    animation: totenFadeIn .25s ease;
}

.toten-idle-overlay__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    padding: 3vh 3vw;
    min-width: 28vw;
    max-width: 80vw;
    border-radius: 2.2vw;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
    text-align: center;
    color: #0f172a;
    user-select: none;
}

.toten-idle-overlay__icon {
    width: 7vw;
    height: 7vw;
    min-width: 56px;
    min-height: 56px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 1.8;
}

.toten-idle-overlay__title {
    font-size: 3.4vw;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toten-idle-overlay__text {
    font-size: 2vw;
    font-weight: 600;
    color: #334155;
}

@keyframes totenFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.toten-btn,
.confirm-btn,
.guiche-item button,
.btn {
    transition:
        transform .14s ease,
        filter .14s ease,
        box-shadow .14s ease,
        opacity .14s ease;
}

.is-pressed {
    transform: scale(0.95) !important;
    filter: brightness(0.92);
    box-shadow: inset 0 0 0 9999px rgba(0,0,0,0.06);
}

.is-waiting-action {
    pointer-events: none;
    opacity: 0.95;
}


/* ====== GUICHÊ ====== */
#guiche-root {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    background: #f4f6f9;
    width: 100%;
    height: 86vh;           /* desktop: altura fixa */
}

/* header não cresce */
.guiche-header {
    flex-shrink: 0;
    text-align: center;
}

/* conteúdo ocupa o resto */
.guiche-content {
    flex: 1;
    min-height: 0; /* ESSENCIAL para flex scroll */
}

.guiche-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.guiche-subtitle {
    font-size: 1rem;
    color: #666;
}

.guiche-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* ESSENCIAL */
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* título NÃO rola */
.guiche-panel-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* ===== LISTA ===== */
.guiche-list {
    flex: 1;
    min-height: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;      /* scroll interno */
    overflow-x: hidden;
}

/* ====== ITENS ====== */
.guiche-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 12px;
    border-bottom: 1px solid #eee;
}

.guiche-item:last-child {
    border-bottom: none;
}

.guiche-info {
    display: flex;
    flex-direction: column;
}

.guiche-senha {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0d6efd;
}

.guiche-nome {
    font-size: .95rem;
    color: #555;
}

.guiche-action {
    min-width: 120px;
    font-weight: 600;
}

.guiche-item.preferencial {
    background: linear-gradient(90deg, #fff4e5, #ffffff);
    border-left: 6px solid #ff9800;
}

.guiche-item.preferencial .guiche-senha {
    color: #e65100;
}

@media (max-width: 991px) {

    #guiche-root {
        height: auto;          /* deixa crescer */
        min-height: 100vh;
    }

    .guiche-content {
        overflow: visible;    /* página pode rolar */
    }

    .guiche-panel {
        flex: none;            /* altura automática */
        max-height: none;
    }

    .guiche-list {
        max-height: 60vh;      /* opcional: evita lista infinita */
        overflow-y: auto;
    }
}