/* -------------------------------------------------------- Dashboard: tile grid (Board/Projetos/Financeiro/Equipe) */
.tile-grid-shell { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 900px) { .tile-grid { grid-template-columns: repeat(4, 1fr); } }

.tile-card { position: relative; background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 16px; overflow: hidden; transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.tile-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-border-strong); }
.tile-card-stretch { position: absolute; inset: 0; z-index: 1; }
.tile-card-top { position: relative; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.tile-card-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--color-surface); box-shadow: 0 0 0 1px var(--color-border); }
.tile-card-icon svg { width: 17px; height: 17px; }
.tile-add {
    position: relative; z-index: 3; pointer-events: auto; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: var(--color-surface); color: var(--color-text-muted);
    box-shadow: 0 0 0 1px var(--color-border); transition: background-color .15s ease, color .15s ease;
}
.tile-add svg { width: 13px; height: 13px; }
.tile-add:hover { background: var(--color-text); color: var(--color-surface); text-decoration: none; }

.tile-card-stack { position: relative; z-index: 2; pointer-events: none; height: 26px; margin: 14px 2px 6px; }
.tile-card-stack span { position: absolute; bottom: 0; width: 30px; height: 20px; border-radius: 6px; background: currentColor; opacity: .14; }
.tile-card-stack span:nth-child(1) { left: 0; transform: rotate(-6deg); }
.tile-card-stack span:nth-child(2) { left: 14px; transform: rotate(3deg); opacity: .22; }
.tile-card-stack span:nth-child(3) { left: 28px; transform: rotate(-2deg); opacity: .32; }

.tile-card-body { position: relative; z-index: 2; pointer-events: none; }
.tile-card-title { font-size: 15px; font-weight: 700; color: var(--color-text); }
.tile-card-meta { font-size: 11.5px; font-weight: 600; color: var(--color-text-dim); margin-top: 3px; }

.tile-hue-indigo .tile-card-icon, .tile-hue-indigo .tile-card-stack { color: var(--hue-indigo); }
.tile-hue-teal .tile-card-icon, .tile-hue-teal .tile-card-stack { color: var(--hue-teal); }
.tile-hue-amber .tile-card-icon, .tile-hue-amber .tile-card-stack { color: var(--hue-amber); }
.tile-hue-rose .tile-card-icon, .tile-hue-rose .tile-card-stack { color: var(--hue-rose); }
.tile-hue-coral .tile-card-icon, .tile-hue-coral .tile-card-stack { color: var(--hue-coral); }
.tile-hue-green .tile-card-icon, .tile-hue-green .tile-card-stack { color: var(--hue-green); }

@media (max-width: 640px) { .tile-grid { grid-template-columns: 1fr; } }

/* -------------------------------------------------------- Page head / greeting */
.greeting-eyebrow { font-size: 12px; font-weight: 600; color: var(--color-violet); margin-bottom: 4px; letter-spacing: .01em; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title a { font-size: 12.5px; font-weight: 600; }
.section-sub { font-size: 11.5px; color: var(--color-text-dim); font-weight: 600; }
.proj-section-head { margin-top: 26px; }
.proj-section-head:first-child { margin-top: 0; }
.split { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }

/* Dashboard: barra de topo (identidade + KPIs inline + ação), substitui os 4 stat-cards grandes */
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.kpi-rail { display: flex; align-items: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.kpi-chip { display: flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 12.5px; }
.kpi-chip + .kpi-chip { border-left: 1px solid var(--color-border); }
.kpi-chip b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--color-text); }
.kpi-chip span { color: var(--color-text-dim); font-weight: 600; }
.kpi-chip.is-bad b { color: var(--color-danger); }
@media (max-width: 700px) {
    .kpi-rail { flex-wrap: wrap; border-radius: var(--radius); }
    .kpi-chip + .kpi-chip { border-left: none; }
}

/* Dashboard: "Projetos recentes" como trilho compacto horizontal (reaproveita .project-card) */
.dash-split { margin-top: 6px; }

.project-card {
    display: block; background: var(--color-surface); border: 1px solid var(--color-border); border-left: 2px solid var(--color-border-strong); border-radius: var(--radius-lg);
    padding: 16px 18px; color: inherit; box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #c9d3f5; text-decoration: none; }
.project-card[hidden] { display: none; }
.project-card.dragging { opacity: .4; }
/* Acento à esquerda por status -- mesma linguagem dos toasts/confirmação (cor no rail, nunca fundo lavado) */
.project-card[data-status="em_andamento"] { border-left-color: var(--color-blue); }
.project-card[data-status="pausado"] { border-left-color: var(--color-warning); }
.project-card[data-status="concluido"] { border-left-color: var(--color-success); }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.project-card-header h3 { margin: 0; font-size: 14.5px; text-transform: none; letter-spacing: 0; color: var(--color-text); font-weight: 700; display: flex; align-items: center; gap: 7px; }
.project-card-header h3 .chip-dot { flex-shrink: 0; }
.project-card-owner { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.project-card-owner-none { font-size: 12px; color: var(--color-text-dim); font-weight: 500; }
.project-card-client { display: flex; align-items: center; gap: 5px; margin: 4px 0 0 1px; font-size: 11.5px; color: var(--color-text-dim); }
.project-card-client svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .75; }

/* Linha "Responsável · Cliente" no cabeçalho da página de projeto */
.project-meta-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.project-meta-person, .project-meta-client { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.project-meta-client { font-weight: 500; color: var(--color-text-dim); }
.project-meta-client svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .75; }
.project-card-desc { color: var(--color-text-muted); font-size: 13px; min-height: 36px; margin: 8px 0 0; }
.project-card-progress { margin-top: 13px; }
.project-card-progress .progress-bar { margin: 0 0 6px; }
.project-card-progress-label { font-size: 11px; color: var(--color-text-dim); font-weight: 600; font-variant-numeric: tabular-nums; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.project-card-meta { display: flex; align-items: center; gap: 8px; }
.project-card-revenue { font-size: 11px; font-weight: 700; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.project-card-noassignee { font-size: 11.5px; color: var(--color-text-dim); }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more { background: var(--color-surface-alt); color: var(--color-text-muted); box-shadow: 0 0 0 1px var(--color-border); }

.due-chip { font-size: 11px; font-weight: 600; }
.due-chip.due-warn, .due-warn { color: var(--color-warning); }
.due-chip.due-bad, .due-bad { color: var(--color-danger); }
.due-chip.due-done, .due-done { color: var(--color-success); }
.due-chip.due-muted, .due-muted { color: var(--color-text-dim); }

.text-muted { color: var(--color-text-muted); }
.text-positive { color: var(--color-success); font-weight: 600; font-variant-numeric: tabular-nums; }
.text-negative { color: var(--color-danger); font-weight: 600; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------- Focus list (bloco principal do dashboard) */
.focus-list { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 6px; box-shadow: var(--shadow-sm); }
.focus-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 10px; color: inherit; }
.focus-item:hover { background: var(--color-surface-alt); text-decoration: none; }
.focus-item + .focus-item { border-top: 1px solid var(--color-border); }
.focus-flag { width: 3px; height: 18px; border-radius: 3px; flex-shrink: 0; margin-top: 2px; background: var(--color-border-strong); }
.focus-flag.due-bad, .focus-flag.due-warn, .focus-flag.due-muted { background: currentColor; }
.focus-body { min-width: 0; flex: 1; }
.focus-title { font-size: 12.5px; font-weight: 600; color: var(--color-text); }
.focus-meta { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.focus-assignees { flex-shrink: 0; align-self: center; }

/* ---------------------------------------------------------------- Tabs (Design System de Alta Performance) */
.view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    padding: 5px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    width: fit-content;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
    position: relative;
    max-width: 100%;
    overflow-x: auto;
}

.view-tab {
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text-dim);
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 18px;
    cursor: pointer;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    user-select: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-tab svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-dim);
    transition: color 0.2s ease, transform 0.2s ease;
}

.view-tab:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.view-tab:hover svg {
    color: var(--color-text);
    transform: translateY(-1px);
}

.view-tab:active {
    transform: scale(0.97);
}

.view-tab.is-active {
    color: var(--color-text);
    background: var(--color-surface);
    border-color: var(--color-border);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.view-tab.is-active svg {
    color: var(--color-brand);
}

.view-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-brand) 0%, #8457f0 100%);
    border-radius: 2px;
}

.view-tab-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-surface-alt);
    color: var(--color-text-dim);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.view-tab.is-active .view-tab-count {
    background: linear-gradient(135deg, rgba(31,111,235,0.12) 0%, rgba(132,87,240,0.12) 100%);
    color: var(--color-brand);
    border-color: rgba(31,111,235,0.2);
}

[data-view-pane][hidden] { display: none; }
.proj-pane { display: none; }
.proj-pane.proj-pane-active { display: block !important; }
[data-board-pane].proj-pane { display: none; }
[data-board-pane].proj-pane.proj-pane-active { display: block !important; }
.inline-edit-box.proj-pane { display: none; }
.inline-edit-box.proj-pane.proj-pane-active { display: block !important; }

.btn-icon-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-icon-edit:hover {
    background: var(--color-brand);
    color: #ffffff;
    border-color: var(--color-brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.25);
}

.btn-icon-edit svg {
    width: 14px;
    height: 14px;
}

.inline-edit-box {
    margin-top: 16px;
    padding: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.inline-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

/* Botão Dotted para Adicionar Comentário */
.btn-dotted-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: 2px dashed var(--color-border, #c9d1d9);
    border-radius: 10px;
    background: var(--color-bg-subtle, #f6f8fa);
    color: var(--color-brand, #1f6feb);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.btn-dotted-add:hover {
    border-color: var(--color-brand, #1f6feb);
    background: rgba(31, 111, 235, 0.05);
    transform: translateY(-1px);
}

/* Form de Comentário Inline Toggle */
.comment-form-box {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--color-bg-subtle, #f6f8fa);
    border: 1px solid var(--color-border, #e1e4e8);
    border-radius: 10px;
}

/* Feed de Comentários Aprimorado */
.comment-bubble {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e1e4e8);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    margin-bottom: 12px;
}

.comment-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.comment-bubble-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.comment-bubble-date {
    font-size: 12px;
    color: var(--color-text-muted, #57606a);
}

.comment-bubble-body {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--color-text-main);
}
