/**
 * Portal RH — OS Pará 2000
 * Folha de estilos global — v3.1
 * Mobile-first · Micro-animações · Navbar ícones
 * @author Albert Madureira
 */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
   VARIÁVEIS
   ============================================================ */
:root {
    --navy:       #1e2a4a;
    --navy-mid:   #2a3a5e;
    --wave:       #8a9ab0;
    --bg:         #f2f4f8;
    --white:      #ffffff;
    --border:     #dde3ec;
    --input-bg:   #f7f9fc;
    --text:       #1e2a4a;
    --text-muted: #6a7a8e;
    --green:      #1a6a3a;
    --green-bg:   #e3f0ea;
    --red:        #9e2a2a;
    --red-bg:     #fdf0f0;
    --amber:      #8a5010;
    --amber-bg:   #fdf5e0;
    --accent:     #2d5be3;

    --shadow-sm:  0 1px 4px rgba(30,42,74,.08);
    --shadow-md:  0 4px 16px rgba(30,42,74,.10);
    --shadow-lg:  0 8px 32px rgba(30,42,74,.14);

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;

    --transition: .2s cubic-bezier(.4,0,.2,1);
    --spring:     .35s cubic-bezier(.34,1.56,.64,1);
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
body {
    font-family: 'Open Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================================
   ANIMAÇÕES GLOBAIS
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(30,42,74,.25); }
    70%  { box-shadow: 0 0 0 8px rgba(30,42,74,0); }
    100% { box-shadow: 0 0 0 0 rgba(30,42,74,0); }
}
@keyframes shimmer {
    from { background-position: -200% center; }
    to   { background-position: 200% center; }
}
@keyframes dropDown {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: var(--navy);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
    overflow: visible;
    flex-shrink: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.navbar .wave {
    position: absolute;
    right: 0; top: 0;
    height: 100%;
    pointer-events: none;
    width: 200px;
}

.nav-logo {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--white);
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: opacity var(--transition);
}
.nav-logo:hover { opacity: .85; }

.nav-logo-wrap { display:flex; align-items:center; }
.nav-logo-text-fallback { display:none; }
.nav-logo img { max-height: 32px; max-width: 80px; object-fit: contain; }
.nav-logo small { font-size: 10px; font-weight: 400; color: var(--wave); margin-left: 4px; font-family: 'Open Sans', sans-serif; }

.nav-right { display: flex; align-items: center; gap: 2px; z-index: 1; }
.nav-admin { font-size: 11px; color: #c8d4e4; margin-right: 4px; }

.badge-role  { font-size: 9px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.badge-super { background: var(--red); color: var(--white); }
.badge-rh    { background: var(--green); color: var(--white); }
.badge-ti    { background: var(--amber); color: var(--white); }

.nav-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition), transform var(--transition);
    width: 36px;
    height: 36px;
}
.nav-icon-link span { display: none; }
.nav-icon-link svg { width: 20px; height: 20px; transition: transform var(--spring); flex-shrink: 0; }
.nav-icon-link:hover { color: #fff; background: rgba(255,255,255,.12); transform: translateY(-1px); }
.nav-icon-link:hover svg { transform: scale(1.15); }
.nav-icon-link:active { transform: scale(.95); }

.nav-icon-link[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -28px; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.75);
    color: #fff; font-size: 10px; font-weight: 600;
    padding: 3px 8px; border-radius: 5px;
    white-space: nowrap; pointer-events: none;
    animation: fadeIn .15s ease;
}

.nav-icon-link.nav-sair { color: rgba(255,120,100,.75); }
.nav-icon-link.nav-sair:hover { background: rgba(192,57,43,.2); color: #ff8070; }

.nav-dropdown { position: relative; display: inline-flex; }
.nav-dropdown-menu {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); min-width: 210px;
    overflow: hidden; z-index: 9999;
    border: 1px solid var(--border);
    animation: dropDown .2s ease;
}
.nav-dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; font-size: 13px; font-weight: 500;
    color: var(--navy); text-decoration: none;
    transition: background var(--transition);
    border-bottom: 1px solid #f0f4f8;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: var(--input-bg); }
.nav-dropdown-menu a svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.nav-dropdown-menu .menu-separator { height: 1px; background: var(--border); margin: 4px 0; }

.nav-dropdown.open { z-index: 10001; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }


.nav-user { display: flex; align-items: center; gap: 8px; z-index: 1; }
.nav-info  { line-height: 1.3; }
.nav-name  { font-size: 12px; color: #c8d4e4; font-weight: 500; text-decoration: none; display: block; }
.nav-name:hover { color: var(--white); }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.content {
    flex: 1; padding: 1.25rem .875rem;
    margin: 0 auto; width: 100%; max-width: 1200px;
    animation: fadeUp .3s ease both;
}
.content-sm  { max-width: 560px; }
.content-md  { max-width: 720px; }
.content-lg  { max-width: 960px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white); border-radius: var(--radius-md);
    border: 1px solid var(--border); margin-bottom: 1rem;
    box-shadow: var(--shadow-sm); transition: box-shadow var(--transition);
    animation: fadeUp .3s ease both;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-head {
    background: var(--navy); padding: 11px 16px;
    display: flex; align-items: center; justify-content: space-between;
    user-select: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.card-head-title { font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700; color: var(--white); }
.card-head-sub   { font-size: 11px; color: rgba(255,255,255,.6); }
.card-body       { padding: 16px; }

/* ============================================================
   MÉTRICAS
   ============================================================ */
.metrics, .stats {
    display: grid; gap: 10px; margin-bottom: 1.25rem;
    grid-template-columns: repeat(3, 1fr);
}
.metric, .stat {
    background: var(--white); border-radius: var(--radius-md);
    border: 1px solid var(--border); padding: 14px 16px;
    text-align: center; box-shadow: var(--shadow-sm);
    transition: transform var(--spring), box-shadow var(--transition);
    animation: scaleIn .35s cubic-bezier(.34,1.56,.64,1) both;
    cursor: default;
}
.metric:nth-child(2) { animation-delay: .06s; }
.metric:nth-child(3) { animation-delay: .12s; }
.metric:hover, .stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.metric-label, .stat-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.metric-val, .stat-val { font-family: 'Nunito', sans-serif; font-size: 26px; font-weight: 800; color: var(--navy); margin-top: 4px; transition: transform var(--spring); }
.metric:hover .metric-val { transform: scale(1.05); }
.metric-val.warn { color: var(--red); }
.metric-sub { font-size: 10px; color: #aabbc8; margin-top: 2px; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.field { margin-bottom: 1.25rem; }
.field-label, .m-label {
    display: block; font-size: 10px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .08em; margin-bottom: 6px;
    transition: color var(--transition);
}
.field:focus-within .field-label,
.field:focus-within .m-label { color: var(--navy); }

.field-input, .m-input, .filtro-input, .ctrl-input {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; font-family: 'Open Sans', sans-serif;
    color: var(--text); background: var(--input-bg);
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}
.field-input:hover, .m-input:hover { border-color: #b0c0d8; }
.field-input:focus, .m-input:focus, .filtro-input:focus, .ctrl-input:focus {
    border-color: var(--navy); background: var(--white);
    box-shadow: 0 0 0 3px rgba(30,42,74,.08);
}
.field-input:disabled, .m-input:disabled { opacity: .55; cursor: not-allowed; }
.field-hint { font-size: 11px; color: #9aaabb; margin-top: 5px; }
.campo-info { padding: 11px 14px; background: #f0f4f8; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn, .btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 20px;
    background: var(--navy); color: var(--white);
    border: none; border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px;
    cursor: pointer; text-align: center; text-decoration: none;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap; position: relative; overflow: hidden;
}
.btn::after, .btn-primary::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
    background-size: 200% 100%; opacity: 0; transition: opacity var(--transition);
}
.btn:hover, .btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(30,42,74,.25); }
.btn:hover::after, .btn-primary:hover::after { opacity: 1; animation: shimmer .6s ease; }
.btn:active, .btn-primary:active { transform: scale(.98); box-shadow: none; }
.btn-block { width: 100%; }

.btn-danger { background: var(--white); color: var(--red); border: 1px solid #f5c0c0; }
.btn-danger:hover { background: var(--red-bg); border-color: #f0a0a0; }
.btn-sm { padding: 5px 12px; font-size: 11px; border-radius: var(--radius-sm); }

.btn-limpar {
    display: inline-flex; align-items: center; padding: 9px 14px;
    background: var(--white); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: border-color var(--transition), color var(--transition);
}
.btn-limpar:hover { border-color: var(--navy); color: var(--navy); }

.btn-reset {
    padding: 11px 16px; background: var(--amber-bg); border: 1px solid #f0c080;
    border-radius: var(--radius-sm); font-family: 'Nunito', sans-serif;
    font-size: 12px; font-weight: 700; color: var(--amber); cursor: pointer;
    white-space: nowrap; transition: background var(--transition), transform var(--transition);
}
.btn-reset:hover { background: #fae8c0; transform: translateY(-1px); }

.btn-salvar {
    flex: 1; padding: 11px 16px; background: var(--navy); border: none;
    border-radius: var(--radius-sm); font-family: 'Nunito', sans-serif;
    font-size: 13px; font-weight: 700; color: var(--white); cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.btn-salvar:hover { background: var(--navy-mid); transform: translateY(-1px); }

.btn-filtrar {
    padding: 9px 16px; background: var(--navy); border: none;
    border-radius: var(--radius-sm); font-family: 'Nunito', sans-serif;
    font-size: 12px; font-weight: 700; color: var(--white); cursor: pointer;
    white-space: nowrap; transition: background var(--transition), transform var(--transition);
}
.btn-filtrar:hover { background: var(--navy-mid); transform: translateY(-1px); }

/* ============================================================
   ALERTAS
   ============================================================ */
.alerta {
    padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
    margin-bottom: 1rem; animation: slideRight .3s ease;
    display: flex; align-items: center; gap: 8px;
}
.alerta.ok    { background: var(--green-bg); color: var(--green); border: 1px solid #b0e0c0; }
.alerta.erro  { background: var(--red-bg);   color: var(--red);   border: 1px solid #f5c0c0; }
.alerta.aviso { background: var(--amber-bg); color: var(--amber); border: 1px solid #f0d080; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 9px; border-radius: 20px; white-space: nowrap;
    transition: transform var(--spring);
}
.badge-ok, .badge-ativo { background: var(--green-bg); color: var(--green); }
.badge-inativo          { background: var(--red-bg);   color: var(--red); }
.badge-pend             { background: var(--amber-bg); color: var(--amber); }
.badge-atual            { background: #2a5e9e; color: var(--white); }

/* ============================================================
   TABELAS
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
    text-align: left; padding: 10px 14px; color: var(--text-muted);
    font-weight: 700; font-size: 9px; text-transform: uppercase;
    letter-spacing: .07em; border-bottom: 1px solid var(--border);
    background: var(--input-bg); white-space: nowrap;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid #f0f4f8; color: var(--text); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--transition); }
.tbl tbody tr:hover td { background: #f7f9ff; }

/* ============================================================
   FILTROS
   ============================================================ */
.filtros {
    background: var(--white); border-radius: var(--radius-md);
    border: 1px solid var(--border); padding: 12px 14px;
    margin-bottom: 1rem; display: flex; gap: 10px;
    flex-wrap: wrap; align-items: flex-end; box-shadow: var(--shadow-sm);
}
.filtro-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.filtro-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.resumo { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.resumo strong { color: var(--navy); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
    width: 34px; height: 34px; font-size: 11px; border-radius: 50%;
    background: var(--navy-mid); border: 2px solid var(--wave);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--white);
    overflow: hidden; flex-shrink: 0;
    transition: transform var(--spring), box-shadow var(--transition);
}
.avatar:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(30,42,74,.2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: 10px; }
.avatar-md { width: 44px; height: 44px; font-size: 14px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }

.avatar-wrap { position: relative; cursor: pointer; }
.avatar-overlay {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity var(--transition);
    font-size: 10px; color: var(--white); font-weight: 600; text-align: center; line-height: 1.2;
}
.avatar-wrap:hover .avatar-overlay { opacity: 1; }
.avatar-input { display: none; }

.colab-cell { display: flex; align-items: center; gap: 10px; }
.colab-nome { font-weight: 600; color: var(--navy); font-size: 13px; }
.colab-mat  { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   MODAIS
   ============================================================ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 1000;
    align-items: center; justify-content: center;
    padding: 1rem; backdrop-filter: blur(2px);
}
.modal-overlay.aberto { display: flex; }
#confirm-modal { z-index: 12000; }
.modal-box { background: var(--white); border-radius: var(--radius-xl); width: 100%; max-width: 480px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: scaleIn .25s cubic-bezier(.34,1.56,.64,1); }
.modal-box-lg { max-width: 860px; height: 92vh; display: flex; flex-direction: column; }
.modal-head { background: var(--navy); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-titulo { font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700; color: var(--white); }
.modal-fechar { background: none; border: none; color: rgba(255,255,255,.5); font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 4px; transition: color var(--transition), background var(--transition); }
.modal-fechar:hover { color: var(--white); background: rgba(255,255,255,.1); }
.modal-body   { padding: 1.5rem; overflow-y: auto; }
.modal-footer { padding: 0 1.5rem 1.5rem; display: flex; gap: 8px; }
.modal-iframe { flex: 1; border: none; width: 100%; }
.modal-msg { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 12px; margin-bottom: 1rem; display: none; animation: slideRight .25s ease; }
.modal-msg.ok   { background: var(--green-bg); color: var(--green); }
.modal-msg.erro { background: var(--red-bg);   color: var(--red); }

/* ============================================================
   PAGINAÇÃO
   ============================================================ */
.paginacao { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 1rem 0; flex-wrap: wrap; }
.pg-btn { padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; text-decoration: none; border: 1.5px solid var(--border); color: var(--text-muted); background: var(--white); transition: all var(--transition); }
.pg-btn:hover  { border-color: var(--navy); color: var(--navy); transform: translateY(-1px); }
.pg-btn.ativo  { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pg-info       { font-size: 11px; color: var(--text-muted); padding: 0 8px; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrap { display: none; margin-top: 10px; }
.progress-bar  { height: 6px; background: #e0e8f0; border-radius: 3px; overflow: hidden; }
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--navy), var(--accent));
    border-radius: 3px; width: 0%; transition: width .4s ease; position: relative;
}
.progress-fill::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4));
    animation: shimmer 1.2s ease infinite;
}
.progress-txt { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: center; }

/* ============================================================
   UPLOAD ZONE
   ============================================================ */
.upload-zone {
    border: 2px dashed #b0c0d8; border-radius: var(--radius-sm);
    padding: 24px; text-align: center; background: var(--input-bg);
    margin-bottom: 14px; cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.upload-zone:hover, .upload-zone.has-file { border-color: var(--navy); background: #eef2fb; transform: scale(1.005); }
.upload-icon  { font-size: 24px; color: #4a6a9a; margin-bottom: 6px; transition: transform var(--spring); }
.upload-zone:hover .upload-icon { transform: translateY(-4px); }
.upload-title { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.upload-hint  { font-size: 11px; color: var(--text-muted); }
.upload-file-input { display: none; }
.upload-filename { font-size: 11px; color: var(--green); margin-top: 6px; font-weight: 600; display: none; }
.upload-filename.visible { display: block; animation: fadeIn .2s ease; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctrl-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   HISTÓRICO (colaborador)
   ============================================================ */
.hist-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f4f8; transition: padding-left var(--transition); animation: slideRight .25s ease both; }
.hist-item:hover { padding-left: 4px; }
.hist-item:last-child { border-bottom: none; }
.hist-mes   { font-size: 13px; color: var(--navy); font-weight: 500; }
.hist-acoes { display: flex; gap: 8px; }
.hist-ver { font-size: 11px; color: var(--text-muted); font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; transition: color var(--transition); }
.hist-ver:hover { color: var(--navy); }
.hist-dl  { font-size: 11px; color: var(--navy); font-weight: 600; text-decoration: none; transition: opacity var(--transition); }
.hist-dl:hover { opacity: .7; }

/* ============================================================
   BOTÕES COLABORADOR
   ============================================================ */
.btns-acao { display: flex; gap: 8px; margin-top: 4px; }
.btn-ver, .btn-dl {
    flex: 1; padding: 11px; border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
    cursor: pointer; text-align: center;
    transition: background var(--transition), transform var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-ver { background: var(--white); border: 1.5px solid var(--navy); color: var(--navy); }
.btn-ver:hover { background: #f0f4f8; transform: translateY(-1px); }
.btn-dl  { background: var(--navy); border: none; color: var(--white); text-decoration: none; }
.btn-dl:hover { background: var(--navy-mid); transform: translateY(-1px); }

/* ============================================================
   DROPDOWN DE AÇÕES
   ============================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle {
    padding: 5px 10px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600;
    cursor: pointer; border: 1.5px solid var(--border); background: var(--white);
    color: var(--text-muted); transition: all var(--transition);
    display: flex; align-items: center; gap: 4px;
}
.dropdown-toggle:hover { border-color: var(--navy); color: var(--navy); }
.dropdown-toggle::after { content: ''; display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid currentColor; margin-left: 2px; transition: transform var(--transition); }
.dropdown.open .dropdown-toggle::after { transform: rotate(180deg); }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 160px; z-index: 9999; animation: dropDown .18s ease; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: block; width: 100%; padding: 9px 14px; font-size: 12px; font-weight: 500; color: var(--text); background: none; border: none; text-align: left; cursor: pointer; text-decoration: none; transition: background var(--transition); white-space: nowrap; }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.item-danger { color: var(--red); }
.dropdown-item.item-danger:hover { background: var(--red-bg); }
.dropdown-item + .dropdown-item { border-top: 1px solid #f0f4f8; }

/* ============================================================
   SENHA COM OLHINHO
   ============================================================ */
.senha-wrap { position: relative; }
.senha-wrap .field-input { padding-right: 45px; }
.olho { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #666666; padding: 4px; display: flex; align-items: center; line-height: 0; transition: color var(--transition), transform var(--transition); }
.olho svg { width: 20px; height: 20px; flex-shrink: 0; display: block; }
.olho:hover { color: #333333; transform: translateY(-50%) scale(1.12); }

/* ============================================================
   SEÇÃO RÓTULO
   ============================================================ */
.section-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; }

/* ============================================================
   ABAS
   ============================================================ */
.abas { display: flex; gap: 4px; margin-bottom: 1rem; background: var(--white); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 4px; }
.aba  { flex: 1; padding: 9px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; transition: all var(--transition); }
.aba.ativa { background: var(--navy); color: var(--white); }
.aba:hover:not(.ativa) { background: var(--bg); color: var(--navy); }

/* ============================================================
   PROFILE CARD
   ============================================================ */
.profile-card { background: var(--navy); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; align-items: center; gap: 16px; margin-bottom: 1.25rem; position: relative; overflow: hidden; animation: fadeUp .35s ease both; }
.profile-info { z-index: 1; }
.profile-nome { font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 800; color: var(--white); }
.profile-sub  { font-size: 11px; color: var(--wave); margin-top: 2px; }
.profile-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pbadge { font-size: 10px; background: rgba(255,255,255,.1); color: #c8d4e4; padding: 2px 8px; border-radius: 20px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: var(--white); padding: 12px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; z-index: 9999; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.erro { background: var(--red); }

/* ============================================================
   FOOTER
   ============================================================ */
.pg-footer { background: var(--white); border-top: 1px solid var(--border); padding: 10px 20px; position: relative; overflow: hidden; flex-shrink: 0; }
.footer-line   { width: 40px; height: 2px; background: var(--navy); border-radius: 1px; margin: 0 auto 5px; }
.footer-txt    { font-size: 10px; color: var(--wave); text-align: center; }
.footer-author { text-align: center; font-size: 10px; color: #c8d0dc; margin-top: 2px; }
.footer-wave   { position: absolute; right: 0; bottom: 0; height: 36px; pointer-events: none; }

/* ============================================================
   PÁGINA 403
   ============================================================ */
.page-403 { display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.box-403  { background: var(--white); border-radius: var(--radius-lg); padding: 48px 40px; text-align: center; max-width: 380px; box-shadow: var(--shadow-md); animation: scaleIn .4s cubic-bezier(.34,1.56,.64,1); }
.box-403 h1 { font-family: 'Nunito', sans-serif; font-size: 22px; color: var(--navy); margin-bottom: 8px; }
.box-403 p  { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.box-403 a  { display: inline-block; padding: 10px 24px; background: var(--navy); color: var(--white); border-radius: var(--radius-sm); font-family: 'Nunito', sans-serif; font-weight: 700; text-decoration: none; font-size: 14px; transition: background var(--transition); }
.box-403 a:hover { background: var(--navy-mid); }

/* ============================================================
   DASHBOARD — saudação
   ============================================================ */
.greet     { font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 800; color: var(--navy); }
.greet-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; margin-bottom: 1.5rem; }

/* ============================================================
   RESPONSIVIDADE — MOBILE FIRST
   ============================================================ */
@media (max-width: 640px) {
    .navbar { height: 52px; padding: 0 12px; }
    .nav-admin { display: none; }
    .badge-role { display: none; }
    .nav-icon-link { width: 34px; height: 34px; padding: 6px; }
    .nav-icon-link svg { width: 18px; height: 18px; }
    .nav-icon-link[title]:hover::after { display: none; }
}
@media (max-width: 640px) {
    .metrics, .stats { grid-template-columns: repeat(2, 1fr); }
    .metric:nth-child(3) { grid-column: 1 / -1; }
    .metric-val, .stat-val { font-size: 22px; }
}
@media (max-width: 400px) {
    .metrics, .stats { grid-template-columns: 1fr; }
    .metric:nth-child(3) { grid-column: auto; }
}
@media (max-width: 640px) {
    .content { padding: .875rem .75rem; }
    .card-body { padding: 12px; }
    .modal-box { border-radius: var(--radius-lg); }
    .modal-body { padding: 1.25rem; }
}
@media (max-width: 640px) {
    .filtros { flex-direction: column; gap: 8px; padding: 10px 12px; }
    .filtro-group { min-width: unset; width: 100%; }
    .controls { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
    .tbl th:nth-child(n+4),
    .tbl td:nth-child(n+4) { display: none; }
    .tbl th, .tbl td { padding: 8px 10px; }
}
@media (max-width: 480px) {
    .tbl th:nth-child(n+3),
    .tbl td:nth-child(n+3) { display: none; }
}
@media (max-width: 520px) {
    .modal-overlay { padding: .5rem; align-items: flex-end; }
    .modal-box { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-box-lg { height: 95vh; }
}
@media (max-width: 480px) {
    .pg-info { display: none; }
    .pg-btn  { padding: 6px 8px; font-size: 11px; }
}
@media (max-width: 480px) { .upload-zone { padding: 16px; } }
@media (max-width: 480px) { .dropdown-menu { right: auto; left: 0; min-width: 140px; } }
@media (max-width: 400px) { .btns-acao { flex-direction: column; } }

/* Importação de PDFs migrada para assets/css/importar_pdfs.css. */

/* ============================================================
   NAVBAR — user mini (classes antes inline)
   ============================================================ */
.nav-user-mini {
    display: flex; align-items: center; gap: 10px;
    margin-right: 6px; max-width: 260px;
}
.nav-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    overflow: hidden; border: 2px solid rgba(255,255,255,.18);
    background: linear-gradient(135deg, #23345d 0%, #314572 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 800;
    font-family: 'Nunito', sans-serif; flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,.16);
}
.nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-admin {
    font-size: 11px; color: #c8d4e4;
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 160px;
    margin-right: 0;
}

/* Painel admin migrado para assets/css/admin_dashboard.css. */

/* ============================================================
   EVOLUÇÃO MENSAL — relatório executivo RH
   ============================================================ */
.summary-chip.linkish {
    text-decoration: none;
    color: var(--navy);
    border: 1px solid rgba(45,91,227,.12);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}
.summary-chip.linkish:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.evo-hero {
    display: grid;
    grid-template-columns: 1.3fr .72fr;
    gap: 14px;
    margin-bottom: 1rem;
}
.evo-hero-main,
.evo-chooser-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
}
.evo-hero-main { padding: 1.35rem 1.4rem; }
.evo-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.05;
    margin: 0 0 8px;
}
.evo-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    max-width: 720px;
}
.evo-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.evo-chooser-card {
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.evo-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 1rem;
}
.evo-stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    padding: 15px 16px;
    transition: transform var(--spring), box-shadow var(--transition);
}
.evo-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.evo-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    font-weight: 700;
}
.evo-stat-value {
    display: block;
    margin-top: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    line-height: 1;
    font-weight: 900;
    color: var(--navy);
}
.evo-stat-sub {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}
.evo-stat-card.success .evo-stat-value { color: #1a6a3a; }
.evo-stat-card.info .evo-stat-value { color: #2d5be3; }
.evo-stat-card.warn .evo-stat-value { color: #8a5010; }
.evo-stat-card.soft .evo-stat-value { color: #5a6784; }
.evo-stat-card.muted .evo-stat-value { color: #8a9ab0; }
.evo-card-shell { overflow: hidden; }
.evo-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.evo-card-title {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--navy);
}
.evo-summary-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.evo-table-wrap { overflow: auto; }
.evo-table th { white-space: nowrap; }
.evo-person-cell { display: flex; flex-direction: column; gap: 4px; }
.evo-person-cell strong { color: var(--navy); font-size: 13px; }
.evo-person-cell span { color: var(--text-muted); font-size: 11px; }
.evo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.evo-badge.ok { background: var(--green-bg); color: var(--green); }
.evo-badge.info { background: #e8efff; color: #2d5be3; }
.evo-badge.warn { background: var(--amber-bg); color: var(--amber); }
.evo-badge.danger { background: var(--red-bg); color: var(--red); }
.evo-badge.muted { background: #eff2f7; color: #5a6784; }
.evo-obs { min-width: 260px; color: var(--text-muted); }
.evo-notes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 1rem;
}
.evo-note-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
    display: grid;
    gap: 8px;
    font-size: 13px;
}
.evo-note-list strong { color: var(--navy); }
.evo-empty {
    padding: 2rem;
    text-align: center;
}
.evo-empty strong {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    color: var(--navy);
    margin-bottom: 6px;
}
.evo-empty span { color: var(--text-muted); font-size: 13px; }

@media (max-width: 920px) {
    .evo-hero,
    .evo-notes-grid { grid-template-columns: 1fr; }
    .evo-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .evo-card-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
    .evo-title { font-size: 1.55rem; }
    .evo-stats-grid { grid-template-columns: 1fr; }
    .evo-hero-main,
    .evo-chooser-card { border-radius: 18px; }
}

/* Importação premium de PDFs migrada para assets/css/importar_pdfs.css. */

/* ============================================================
   PATCH 2026-05-03 — Dashboard/Perfil colaborador restaurados
   Motivo: manter o reset de senha sem quebrar o visual do colaborador.
   @author Albert Madureira
   ============================================================ */

/* ---------- Avatar genérico usado no menu ---------- */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.avatar-sm {
    width: 32px;
    height: 32px;
}
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Dashboard do colaborador ---------- */

/* CSS específico da área do colaborador foi migrado para assets/css/colaborador_area.css. */

/* ============================================================
   PATCH 2026-05-06 — CPF técnico v2 + modal editar colaborador contido
   Motivo: CPF real iniciado por 999 não deve ser confundido com fake.
   O fake técnico novo usa 000 + matrícula preenchida. Ex.: mat. 1036 → 000.000.010-36.
   Também impede o modal de edição de colaborador de “explodir” para fora da tela.
   @author Albert Madureira
   ============================================================ */
.modal-overlay {
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-box.modal-colab {
    width: min(1020px, calc(100vw - 28px));
    max-width: 1020px;
    max-height: calc(100vh - 28px);
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
}

.modal-box.modal-colab .modal-body {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
}

.modal-box.modal-colab .edit-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    align-items: start;
}

.modal-box.modal-colab .edit-main,
.modal-box.modal-colab .edit-side,
.modal-box.modal-colab .edit-card,
.modal-box.modal-colab .preview-profile,
.modal-box.modal-colab .preview-item {
    min-width: 0;
}

.modal-box.modal-colab .edit-hero {
    margin-bottom: 16px;
}

.modal-box.modal-colab .edit-hero-copy,
.modal-box.modal-colab .preview-name,
.modal-box.modal-colab .preview-item-value {
    overflow-wrap: anywhere;
    word-break: normal;
}

.modal-box.modal-colab input,
.modal-box.modal-colab select,
.modal-box.modal-colab textarea,
.modal-box.modal-colab .m-input {
    max-width: 100%;
}

.modal-box.modal-colab .modal-footer {
    flex-shrink: 0;
    padding: 12px 18px 18px;
    background: rgba(255,255,255,.96);
    border-top: 1px solid #edf2f8;
}

@media (max-width: 1040px) {
    .modal-box.modal-colab {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 20px;
    }

    .modal-box.modal-colab .edit-shell {
        grid-template-columns: 1fr;
    }

    .modal-box.modal-colab .edit-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .modal-overlay {
        padding: 8px;
        align-items: flex-start;
    }

    .modal-box.modal-colab {
        width: 100%;
        max-height: calc(100vh - 16px);
        border-radius: 18px;
    }

    .modal-box.modal-colab .modal-body {
        padding: 14px;
    }

    .modal-box.modal-colab .edit-side,
    .modal-box.modal-colab .modal-grid-two {
        grid-template-columns: 1fr;
    }

    .modal-box.modal-colab .edit-hero-content {
        align-items: flex-start;
    }
}

/* Ajustes específicos da área do colaborador migrados para assets/css/colaborador_area.css. */

/* BEGIN PORTAL_THEME_CONFIG */
/* Gerado automaticamente em Configurações > Aparência. Não editar manualmente. */
:root {
    --navy: #1E2A4A;
    --navy-mid: #3E4863;
    --navy-dark: #1A2541;
    --wave: #8A9AB0;
    --accent: #8A9AB0;
}
/* END PORTAL_THEME_CONFIG */

/* BEGIN FOOTER_UNIVERSAL_CONFIGURAVEL */
.pg-footer.pg-footer-corporate {
    background: rgba(255,255,255,.96);
    border-top: 1px solid rgba(221,227,236,.92);
    padding: 16px 20px 18px;
    text-align: center;
    box-shadow: 0 -10px 30px rgba(30,42,74,.04);
    flex-shrink: 0;
}

.pg-footer.pg-footer-corporate .footer-line {
    width: 52px;
    height: 3px;
    background: linear-gradient(90deg, var(--navy, #1e2a4a), var(--wave, #8a9ab0));
    border-radius: 999px;
    margin: 0 auto 8px;
    opacity: .82;
}

.pg-footer.pg-footer-corporate .footer-txt {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 900;
    color: var(--navy, #1e2a4a);
    letter-spacing: .02em;
}

.pg-footer.pg-footer-corporate .footer-author {
    margin: 3px 0 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #6a7a8e);
}

@media (max-width: 640px) {
    .pg-footer.pg-footer-corporate {
        padding: 14px 16px 16px;
    }
}
/* END FOOTER_UNIVERSAL_CONFIGURAVEL */
