/* =====================================================
   HUBI SOFTWARE — Design System Raio-X UPA
   Versão 1.0
   ===================================================== */

/* ---- Variáveis ---- */
:root {
    --hubi-verde:       #1a7a4a;
    --hubi-verde-claro: #25a062;
    --hubi-verde-escuro:#145c37;
    --hubi-laranja:     #e67e22;
    --hubi-vermelho:    #c0392b;
    --hubi-azul:        #2980b9;
    --hubi-branco:      #ffffff;
    --hubi-cinza-bg:    #f4f6f8;
    --hubi-cinza-borda: #d1d9e0;
    --hubi-texto:       #2c3e50;
    --hubi-texto-claro: #6c757d;
    --hubi-sombra:      0 2px 12px rgba(0,0,0,0.10);
    --hubi-radius:      8px;
    --hubi-radius-lg:   14px;
    --fonte:            'Segoe UI', Arial, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--fonte);
    background: var(--hubi-cinza-bg);
    color: var(--hubi-texto);
    font-size: 15px;
    min-height: 100vh;
}

a { color: var(--hubi-verde); text-decoration: none; }
a:hover { color: var(--hubi-verde-escuro); text-decoration: underline; }

/* ---- Navbar ---- */
.hubi-navbar {
    background: var(--hubi-verde);
    color: var(--hubi-branco);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hubi-navbar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--hubi-branco);
    text-decoration: none;
}

.hubi-navbar .brand span {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.85;
    display: block;
    line-height: 1;
}

.hubi-navbar nav a {
    color: rgba(255,255,255,0.88);
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--hubi-radius);
    transition: background 0.2s;
    text-decoration: none;
}

.hubi-navbar nav a:hover {
    background: rgba(255,255,255,0.15);
    color: var(--hubi-branco);
    text-decoration: none;
}

.hubi-navbar-logo {
    width: 42px;
    height: 42px;
    background: var(--hubi-branco);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--hubi-verde);
    font-weight: 900;
}

/* ---- Layout ---- */
.hubi-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px;
}

/* ---- Cards ---- */
.hubi-card {
    background: var(--hubi-branco);
    border-radius: var(--hubi-radius-lg);
    box-shadow: var(--hubi-sombra);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.hubi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--hubi-cinza-borda);
}

.hubi-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--hubi-verde-escuro);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Page Title ---- */
.hubi-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hubi-verde-escuro);
    margin-bottom: 6px;
}

.hubi-page-sub {
    color: var(--hubi-texto-claro);
    font-size: 0.92rem;
    margin-bottom: 24px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--hubi-radius);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.18s, transform 0.12s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); filter: brightness(0.96); }

.btn-primary   { background: var(--hubi-verde);    color: var(--hubi-branco); }
.btn-success   { background: var(--hubi-verde-claro); color: var(--hubi-branco); }
.btn-warning   { background: var(--hubi-laranja);  color: var(--hubi-branco); }
.btn-danger    { background: var(--hubi-vermelho); color: var(--hubi-branco); }
.btn-info      { background: var(--hubi-azul);     color: var(--hubi-branco); }
.btn-secondary { background: var(--hubi-cinza-borda); color: var(--hubi-texto); }
.btn-sm        { padding: 5px 12px; font-size: 0.82rem; }

/* ---- Forms ---- */
.hubi-form-group {
    margin-bottom: 18px;
}

.hubi-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--hubi-texto);
    font-size: 0.9rem;
}

.hubi-form-group .req { color: var(--hubi-vermelho); margin-left: 2px; }

.hubi-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--hubi-cinza-borda);
    border-radius: var(--hubi-radius);
    font-size: 0.95rem;
    font-family: var(--fonte);
    color: var(--hubi-texto);
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.hubi-form-control:focus {
    border-color: var(--hubi-verde-claro);
    box-shadow: 0 0 0 3px rgba(37,160,98,0.15);
    background: var(--hubi-branco);
}

.hubi-form-control.is-invalid { border-color: var(--hubi-vermelho); }
.invalid-feedback { color: var(--hubi-vermelho); font-size: 0.82rem; margin-top: 4px; }

.hubi-form-row {
    display: grid;
    gap: 16px;
}
.hubi-form-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.hubi-form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hubi-form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Table ---- */
.hubi-table-wrap {
    overflow-x: auto;
    border-radius: var(--hubi-radius);
    border: 1px solid var(--hubi-cinza-borda);
}

.hubi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.hubi-table thead {
    background: var(--hubi-verde);
    color: var(--hubi-branco);
}

.hubi-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.hubi-table tbody tr {
    border-bottom: 1px solid #eef0f3;
    transition: background 0.15s;
}

.hubi-table tbody tr:nth-child(even) { background: #f8fafb; }
.hubi-table tbody tr:hover { background: #e8f5ee; }

.hubi-table td {
    padding: 11px 14px;
    vertical-align: middle;
}

.hubi-table td:first-child { font-weight: 700; color: var(--hubi-verde-escuro); }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-green  { background: #d4edda; color: #155724; }
.badge-orange { background: #fde8cc; color: #7a3c00; }
.badge-blue   { background: #cce5ff; color: #004085; }

/* ---- Alerts ---- */
.hubi-alert {
    padding: 13px 18px;
    border-radius: var(--hubi-radius);
    margin-bottom: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hubi-alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.hubi-alert-danger  { background: #f8d7da; color: #721c24; border-left: 4px solid var(--hubi-vermelho); }
.hubi-alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--hubi-azul); }

/* ---- Turno Header (Registro) ---- */
.turno-header {
    background: var(--hubi-verde-escuro);
    color: var(--hubi-branco);
    border-radius: var(--hubi-radius-lg);
    padding: 24px 32px;
    margin-bottom: 24px;
    text-align: center;
}

.turno-header h1 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.turno-header .turno-data {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f9ca24;
    margin: 4px 0;
}

.turno-header .turno-hora {
    font-size: 1rem;
    color: #f9ca24;
}

.turno-header .turno-tec {
    margin-top: 8px;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.88);
}

/* ---- Número sequencial na tabela ---- */
.num-seq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--hubi-verde);
    color: var(--hubi-branco);
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
}

/* ---- Totalizador ---- */
.hubi-total-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--hubi-verde-escuro);
}

/* ---- Footer ---- */
.hubi-footer {
    text-align: center;
    padding: 22px;
    color: var(--hubi-texto-claro);
    font-size: 0.82rem;
    border-top: 1px solid var(--hubi-cinza-borda);
    margin-top: 40px;
}

.hubi-footer strong { color: var(--hubi-verde); }

/* ---- Paginação ---- */
.hubi-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.hubi-pagination a,
.hubi-pagination span {
    padding: 7px 14px;
    border-radius: var(--hubi-radius);
    border: 1.5px solid var(--hubi-cinza-borda);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--hubi-verde);
    background: var(--hubi-branco);
    text-decoration: none;
    transition: background 0.18s;
}

.hubi-pagination a:hover { background: var(--hubi-verde); color: var(--hubi-branco); border-color: var(--hubi-verde); }
.hubi-pagination span.active { background: var(--hubi-verde); color: var(--hubi-branco); border-color: var(--hubi-verde); }

/* ---- Responsivo ---- */
@media (max-width: 700px) {
    .hubi-form-row.cols-2,
    .hubi-form-row.cols-3,
    .hubi-form-row.cols-4 { grid-template-columns: 1fr; }
    .hubi-card { padding: 18px 14px; }
    .hubi-navbar { padding: 0 12px; }
    .turno-header { padding: 16px; }
    .turno-header h1 { font-size: 1.1rem; }
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--hubi-verde-escuro) 0%, var(--hubi-verde) 60%, var(--hubi-verde-claro) 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--hubi-branco);
    border-radius: var(--hubi-radius-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    padding: 40px 36px 32px;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hubi-verde-escuro);
    margin-bottom: 4px;
}

.login-brand p {
    color: var(--hubi-texto-claro);
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--hubi-texto-claro);
}

/* =====================================================
   NAVBAR USER BADGE
   ===================================================== */
.hubi-user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    margin: 0 4px;
}

/* =====================================================
   403 / ERRO
   ===================================================== */
.hubi-403 {
    text-align: center;
    padding: 60px 20px;
}
.hubi-403 .code {
    font-size: 5rem;
    font-weight: 900;
    color: var(--hubi-cinza-borda);
    line-height: 1;
}
.hubi-403 h2 { color: var(--hubi-vermelho); margin: 10px 0 6px; }
.hubi-403 p  { color: var(--hubi-texto-claro); }


/* Pulse animation — indicador de turno aberto */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}
