/* ─── Variables ──────────────────────────────────────────────────── */
:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1a1d23;
    --sidebar-accent: #3b82f6;
    --topbar-height: 56px;
    --text-muted-light: #6b7280;
}

html, body {
    height: 100%;
    margin: 0;
    font-size: 14px;
}

/* ─── App Layout ─────────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #c9d1d9;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 20px 20px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.avatar {
    width: 36px; height: 36px;
    background: var(--sidebar-accent);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}

.user-info {
    overflow: hidden;
    display: flex; flex-direction: column;
}

.user-info small { color: var(--text-muted-light); font-size: 0.7rem; line-height: 1; }
.user-info span { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #8b949e;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: #e6edf3;
}

.sidebar-link.active {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border-left-color: var(--sidebar-accent);
    font-weight: 600;
}

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Topbar ─────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    position: sticky; top: 0; z-index: 99;
}

.sidebar-toggle { color: #6b7280 !important; }
.sidebar-toggle:hover { color: #111 !important; }

/* ─── Stats Cards ────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted-light); margin-top: 3px; }

/* ─── Tables ─────────────────────────────────────────────────────── */
.table th { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7280; }
.table td { vertical-align: middle; font-size: 0.875rem; }

/* ─── Employee Avatar ────────────────────────────────────────────── */
.emp-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── Status Dot ─────────────────────────────────────────────────── */
.status-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.online  { background: #198754; box-shadow: 0 0 0 3px rgba(25,135,84,0.2); }
.status-dot.offline { background: #6c757d; }

/* ─── Login ──────────────────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1d23 0%, #23293a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

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

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.letter-spacing-3 { letter-spacing: 0.3em; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* ─── Recursos Humanos (rh-*.js) ─────────────────────────────────── */
.rh-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.rh-avatar-ini { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; }
.rh-cartao { transition: box-shadow .15s, transform .15s; }
.rh-cartao:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important; transform: translateY(-1px); }
.rh-cartao.rh-inativo { opacity: .72; }
.rh-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.rh-dl dt { font-weight: 400; color: var(--text-muted-light); }
.rh-dl dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0 { min-width: 0; }
.rh-foto-wrap { position: relative; }
.rh-foto-btn { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 1px solid #dee2e6; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }
.rh-tabs .nav-link { font-size: 13px; }
.rh-tab-corpo { border-top-left-radius: 0; border-top-right-radius: 0; }
.rh-kpi { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; height: 100%; }
.rh-kpi-v { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.rh-kpi-n { font-size: 12px; color: var(--text-muted-light); }
.rh-kpi-bom .rh-kpi-v { color: #16a34a; }
.rh-kpi-mau .rh-kpi-v { color: #dc2626; }
.rh-kpi-aviso .rh-kpi-v { color: #d97706; }
.rh-bola { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.rh-cal-scroll { max-height: 640px; overflow-y: auto; scroll-behavior: smooth; padding-right: 4px; }
.rh-cal-mes { margin-bottom: 14px; }
.rh-cal-titulo { position: sticky; top: 0; z-index: 1; background: #fff; font-weight: 600; text-transform: capitalize; padding: 4px 0; font-size: 13px; }
.rh-cal-grelha { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.rh-cal-dsem { font-size: 11px; color: var(--text-muted-light); text-align: center; text-transform: capitalize; }
.rh-cal-dia { min-height: 62px; background: #f8fafc; border-radius: 4px; padding: 2px 3px; font-size: 11px; overflow: hidden; cursor: default; }
.rh-cal-dia[data-dia] { cursor: pointer; }
.rh-cal-dia.vazio { background: transparent; }
.rh-cal-dia.fds { background: #eef2f7; }
.rh-cal-dia.feriado { background: #fdecec; }
.rh-cal-dia.hoje { outline: 2px solid #3b82f6; }
.rh-cal-num { display: block; color: #64748b; font-weight: 600; }
.rh-cal-ev { display: block; color: #fff; border-radius: 3px; padding: 0 3px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.rh-cal-mais { display: block; color: #475569; cursor: pointer; font-weight: 600; }
.rh-cal-legenda { display: flex; flex-wrap: wrap; gap: 12px; }
.rh-cal-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.rh-timeline { position: relative; padding-left: 4px; }
.rh-tl-item { display: flex; gap: 10px; padding: 8px 6px; border-radius: 6px; }
.rh-tl-item:hover { background: #f8fafc; }
.rh-tl-ico { width: 30px; height: 30px; border-radius: 50%; background: #eff6ff; color: #2563eb; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rh-tl-txt { white-space: normal; color: #334155; }
.rh-aud-det { max-width: 420px; word-break: break-word; }
.rh-aud-campo { font-family: ui-monospace, monospace; font-size: 11px; color: #475569; }
.rh-alertas .list-group-item:hover { background: #f8fafc; }
@media (max-width: 576px) { .rh-cal-dia { min-height: 44px; } .rh-cal-ev { font-size: 9px; } }
