:root {
    --azul: #0a6cb3;
    --azul-escuro: #084d80;
    --verde: #19a974;
    --rosa: #d63384;
    --cinza: #f2f4f7;
    --texto: #1c2b36;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--texto);
    background: var(--cinza);
}

/* ====================== TOTEM ====================== */
.totem {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #eaf3fb 0%, #d4e6f7 100%);
}
.topo {
    text-align: center;
    padding: 30px 20px 10px;
}
.topo .logo { max-height: 120px; max-width: 80%; }
.topo h1 { margin: 12px 0 0; font-size: 32px; color: var(--azul-escuro); }

.totem-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.chamada-texto { font-size: 30px; margin-bottom: 30px; color: var(--azul-escuro); }
.botoes-tipo {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}
.btn-tipo {
    width: 320px;
    height: 320px;
    border-radius: 28px;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    transition: transform .1s;
    user-select: none;
}
.btn-tipo:active { transform: scale(.96); }
.btn-normal { background: linear-gradient(160deg, #0a6cb3, #084d80); }
.btn-pref   { background: linear-gradient(160deg, #19a974, #137a54); }
.btn-icone { font-size: 90px; }
.btn-titulo { font-size: 40px; font-weight: bold; margin-top: 10px; }
.btn-sub { font-size: 18px; opacity: .9; margin-top: 6px; }
.rodape { text-align: center; padding: 16px; color: #5a6b78; }

/* ====================== LOGIN ====================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0a6cb3, #084d80);
}
.login-card {
    background: #fff;
    padding: 36px 32px;
    border-radius: 16px;
    width: 340px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0,0,0,.25);
}
.logo-login { max-height: 80px; margin-bottom: 12px; }
.login-card h1 { font-size: 22px; margin: 0 0 20px; color: var(--azul-escuro); }
.login-card input {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 12px;
    border: 1px solid #cdd6e0;
    border-radius: 8px;
    font-size: 16px;
}
.login-card button {
    width: 100%;
    padding: 13px;
    background: var(--azul);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    cursor: pointer;
}
.login-card button:hover { background: var(--azul-escuro); }
.erro { color: #c0392b; margin: 0 0 12px; }
.link-secundario { margin-top: 16px; font-size: 14px; }
.link-secundario a { color: var(--azul); }

/* ====================== PAINEL RECEPÇÃO ====================== */
.painel-body { min-height: 100vh; }
.painel-topo {
    background: var(--azul-escuro);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 20px;
    flex-wrap: wrap;
}
.logo-mini { height: 40px; background:#fff; padding:3px 6px; border-radius:6px; }
.painel-titulo { font-size: 20px; font-weight: bold; flex: 1; }
.form-guiche { display: flex; align-items: center; gap: 8px; }
.form-guiche input { width: 90px; padding: 7px; border-radius: 6px; border: none; }
.form-guiche button, .sair {
    background: var(--azul);
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}
.painel-main {
    display: flex;
    gap: 24px;
    padding: 30px;
    flex-wrap: wrap;
}
.painel-atual {
    flex: 2;
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    min-width: 320px;
}
.painel-atual .rotulo { font-size: 18px; color: #5a6b78; margin: 0; }
.senha-atual { font-size: 110px; font-weight: bold; color: var(--azul-escuro); line-height: 1.1; }
.acoes { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.btn-grande {
    font-size: 22px;
    padding: 18px 28px;
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
}
.btn-chamar { background: var(--verde); }
.btn-rechamar { background: var(--azul); }
.btn-grande:active { transform: scale(.97); }
.aguardando-info { margin-top: 22px; font-size: 18px; color: #5a6b78; }

.painel-fila {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    min-width: 220px;
}
.painel-fila h2 { margin-top: 0; color: var(--azul-escuro); }
.painel-fila ul { list-style: none; padding: 0; margin: 0; }
.painel-fila li {
    font-size: 26px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f5;
    font-weight: 600;
}
.painel-fila li.item-pref { color: var(--verde); }

/* ====================== PAINEL DE CHAMADA ====================== */
.chamada-body {
    min-height: 100vh;
    background: linear-gradient(160deg, #06304f 0%, #0a4f82 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
}
.chamada-topo {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 30px;
    background: rgba(0,0,0,.2);
}
.logo-chamada { height: 56px; background: #fff; padding: 4px 8px; border-radius: 8px; }
.chamada-setor { font-size: 30px; font-weight: bold; flex: 1; }
.chamada-hora { font-size: 30px; font-variant-numeric: tabular-nums; }

.chamada-main {
    flex: 1;
    display: flex;
    gap: 24px;
    padding: 24px 30px 40px;
}
.chamada-destaque {
    flex: 2;
    background: rgba(255,255,255,.08);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,.15);
}
.is-pref .chamada-destaque { border-color: var(--verde); }
.chamada-label { font-size: 34px; letter-spacing: 8px; margin: 0; opacity: .8; }
.chamada-codigo {
    font-size: 210px;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
    text-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.chamada-guiche {
    font-size: clamp(30px, 5vw, 60px);
    font-weight: bold;
    background: var(--verde);
    padding: 8px 40px;
    border-radius: 16px;
    max-width: 92%;
    text-align: center;
    line-height: 1.15;
    overflow-wrap: break-word;
}

.chamada-historico {
    flex: 1;
    background: rgba(0,0,0,.18);
    border-radius: 24px;
    padding: 20px 26px;
    min-width: 260px;
}
.chamada-historico h2 { margin: 6px 0 14px; font-size: 28px; text-align: center; }
.chamada-historico ul { list-style: none; padding: 0; margin: 0; }
.chamada-historico li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.u-cod { font-size: 44px; font-weight: bold; }
.u-gui { font-size: 22px; opacity: .85; }
.destaque-ultima { background: rgba(25,169,116,.25); border-radius: 10px; }

.piscar { animation: piscar 1s ease-in-out 3; }
@keyframes piscar {
    0%, 100% { background: rgba(255,255,255,.08); }
    50% { background: rgba(25,169,116,.45); }
}

.aviso-som {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #ffcc00;
    color: #222;
    text-align: center;
    padding: 16px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    z-index: 50;
}

@media (max-width: 800px) {
    .chamada-codigo { font-size: 120px; }
    .chamada-main { flex-direction: column; }
}
