/* ============================================
   HOME v5
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #000000;
    --card: #0a0a0a;
    --card-border: rgba(255,255,255,0.06);
    --card-hover: #111111;
    --white: #ffffff;
    --g1: #e4e4e7;
    --g2: #a1a1aa;
    --g3: #71717a;
    --g4: #3f3f46;
    --g5: #27272a;
    --blue: #3B82F6;
    --green: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --purple: #8b5cf6;
    --r: 14px;
    --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.home {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 2vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── TOPBAR ── */
.topbar {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 1.5vh 0;
    flex-shrink: 0;
}
.topbar-logo { height: 32px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-date { font-size: 0.75rem; color: var(--g3); font-weight: 500; }
.topbar-logout {
    width: 32px; height: 32px;
    border: 1px solid var(--card-border);
    background: transparent; color: var(--g3);
    border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: all 0.2s;
}
.topbar-logout:hover {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.2);
    color: var(--red);
}

/* ── GREETING ── */
.greeting {
    display: flex; align-items: center; gap: 14px;
    padding: 1vh 0 1.5vh;
    flex-shrink: 0;
    animation: fadeInUp 0.4s ease;
}
.greeting-avatar {
    width: 48px; height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.greeting-text {
    font-size: 1.3rem; font-weight: 800;
    letter-spacing: -0.03em; line-height: 1.2;
}
.greeting-sub {
    font-size: 0.82rem; color: var(--g3); margin-top: 3px;
}

/* ── BOARDS ── */
.boards {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1vh; margin-bottom: 5vh; flex-shrink: 0;
    animation: fadeInUp 0.4s ease 0.05s forwards; opacity: 0;
}
.board {
    position: relative; border-radius: 18px; overflow: hidden;
    text-decoration: none; color: var(--white);
    height: 17vh; display: flex; flex-direction: column;
    justify-content: space-between; padding: 2vh 22px;
    transition: all 0.25s ease; cursor: pointer;
}
.board:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.board-bg {
    position: absolute; inset: 0; z-index: 0;
    transition: transform 0.4s ease;
}
.board:hover .board-bg { transform: scale(1.05); }
.board-gestao .board-bg {
    background:
        linear-gradient(160deg, rgba(15,50,150,0.92) 0%, rgba(59,130,246,0.6) 60%, rgba(59,130,246,0.3) 100%),
        url('assets/images/gestao-backgroud.png') center/cover;
}
.board-recrutamento .board-bg {
    background:
        linear-gradient(160deg, rgba(2,100,70,0.92) 0%, rgba(16,185,129,0.6) 60%, rgba(16,185,129,0.3) 100%),
        url('assets/images/recrutamento-backgroud.png') center/cover;
}
.board-top {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 14px;
}
.board-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.12);
    border-radius: 12px; display: flex;
    align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
}
.board h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.board p { font-size: 0.72rem; opacity: 0.65; margin-top: 2px; }
.board-bottom {
    position: relative; z-index: 1;
    display: flex; align-items: center;
    justify-content: space-between;
}
.board-stat {
    font-size: 0.72rem; font-weight: 500; opacity: 0.75;
}
.board-stat i { margin-right: 3px; font-size: 10px; }
.board-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.72rem; font-weight: 700;
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 16px; border-radius: 10px;
    transition: all 0.2s;
}
.board:hover .board-link {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.2);
}
.board-link i { font-size: 9px; }

/* ── GRID HEADER ── */
.home-grid-header {
    margin-bottom: 1.5vh;
    flex-shrink: 0;
}
.home-grid-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.03em;
}

/* ── GRID 2 COLUNAS ── */
.home-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1vh;
    flex: 1;
    min-height: 0;
    animation: fadeInUp 0.4s ease 0.1s forwards; opacity: 0;
}

/* ── CARD ── */
.home-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--r);
    display: flex; flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}
.card-header {
    padding: 14px 16px 0;
    display: flex; align-items: center; justify-content: space-between;
}
.card-title {
    font-size: 0.78rem; font-weight: 700;
    display: flex; align-items: center; gap: 7px;
    color: var(--g2);
}
.card-title i { font-size: 12px; color: var(--green); }
.card-badge {
    font-size: 0.62rem; font-weight: 700;
    background: var(--blue);
    color: var(--white);
    padding: 1px 7px; border-radius: 99px;
    margin-left: 2px;
}
.card-loading {
    padding: 20px; text-align: center;
    color: var(--g4); font-size: 13px;
}

/* ── ACTIVITY ── */
.activity-list {
    padding: 6px 0; flex: 1;
    display: flex; flex-direction: column;
    justify-content: space-evenly;
}
.activity-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; transition: background 0.15s;
}
.activity-item:hover { background: var(--card-hover); }
.activity-avatar {
    width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
}
.activity-info { flex: 1; min-width: 0; }
.activity-text {
    font-size: 0.75rem; color: var(--g2);
    line-height: 1.3; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.activity-text strong { color: var(--white); font-weight: 600; }
.activity-time { font-size: 0.65rem; color: var(--g4); }
.activity-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-amber { background: var(--amber); }
.dot-blue { background: var(--blue); }
.dot-gray { background: var(--g4); }
.activity-empty {
    padding: 20px 16px; text-align: center;
    font-size: 0.78rem; color: var(--g4);
}

/* ── TAREFAS ── */
.tarefas-list {
    padding: 6px 0; flex: 1;
    display: flex; flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}
.tarefa-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; cursor: pointer;
    transition: background 0.15s;
}
.tarefa-item:hover { background: var(--card-hover); }
.tarefa-check {
    width: 18px; height: 18px; border-radius: 5px;
    border: 2px solid var(--g4); background: transparent;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: transparent; flex-shrink: 0;
    cursor: pointer; transition: all 0.2s;
}
.tarefa-item.done .tarefa-check {
    background: var(--green); border-color: var(--green);
    color: var(--white);
}
.tarefa-text {
    font-size: 0.78rem; color: var(--g2);
    flex: 1; line-height: 1.3;
}
.tarefa-item.done .tarefa-text {
    text-decoration: line-through; color: var(--g4);
}
.tarefas-empty {
    padding: 16px; text-align: center;
    font-size: 0.75rem; color: var(--g4);
}
.tarefas-add {
    display: flex; gap: 6px;
    padding: 8px 12px 12px;
    border-top: 1px solid var(--card-border);
}
.tarefas-input {
    flex: 1; padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 8px; color: var(--white);
    font-family: var(--font); font-size: 0.78rem;
    outline: none; transition: border-color 0.2s;
}
.tarefas-input:focus { border-color: rgba(59,130,246,0.4); }
.tarefas-input::placeholder { color: var(--g4); }
.tarefas-btn {
    width: 34px; height: 34px;
    background: var(--blue); color: var(--white);
    border: none; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: background 0.2s;
}
.tarefas-btn:hover { background: #2563eb; }

/* ── METAS ── */
.metas-list {
    padding: 10px 14px; flex: 1;
    display: flex; flex-direction: column;
    justify-content: space-evenly;
}
.meta-item { margin-bottom: 0; }
.meta-item:last-child { margin-bottom: 0; }
.meta-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 6px;
}
.meta-label {
    font-size: 0.75rem; font-weight: 600; color: var(--g2);
    display: flex; align-items: center; gap: 6px;
}
.meta-label i { font-size: 11px; }
.meta-progress-text {
    font-size: 0.68rem; font-weight: 700; color: var(--g3);
}
.meta-bar {
    height: 6px; background: var(--g5);
    border-radius: 99px; overflow: hidden;
}
.meta-bar-fill {
    height: 100%; border-radius: 99px;
    transition: width 0.8s ease;
}
.meta-bar-fill.fill-green { background: var(--green); }
.meta-bar-fill.fill-blue { background: var(--blue); }
.meta-bar-fill.fill-purple { background: var(--purple); }
.meta-bar-fill.fill-amber { background: var(--amber); }

/* ── STATS ── */
.stats-content {
    padding: 10px 14px; flex: 1;
    display: flex; flex-direction: column;
    justify-content: space-evenly;
}
.stats-chart {
    flex: 1; padding: 8px 14px 10px;
    display: flex; align-items: center;
    min-height: 0;
}
.stats-chart canvas {
    width: 100% !important;
    height: 100% !important;
}
.card-subtitle {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--g3);
}
.stat-row {
    display: flex; justify-content: space-between;
    align-items: center; padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label {
    font-size: 0.75rem; color: var(--g3);
    display: flex; align-items: center; gap: 7px;
}
.stat-label i { font-size: 11px; }
.stat-value {
    font-size: 0.85rem; font-weight: 800; color: var(--white);
}
.stat-pipeline { margin-top: 8px; }
.stat-pipeline-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0;
}
.stat-pipeline-dot {
    width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.stat-pipeline-name { font-size: 0.7rem; color: var(--g3); flex: 1; }
.stat-pipeline-count { font-size: 0.72rem; font-weight: 700; color: var(--g2); }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVO ── */
@media (max-width: 680px) {
    .home {
        padding: 0 14px 24px;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    .boards { grid-template-columns: 1fr; }
    .board { height: 130px; }
    .home-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .home-card { height: auto; min-height: 200px; }
    .greeting-text { font-size: 1.15rem; }
    .greeting-avatar { width: 42px; height: 42px; }
    .topbar-date { display: none; }
}
