/* Zelo Tarefas — visual no estilo ClickUp, com as cores e a fonte da Zelo.
   Primaria: teal #0C4448  |  Tipografia: Quicksand. Sem amarelo, sem roxo.
   Estrutura (trilha de icones + sidebar + topo + lista agrupada) inspirada no ClickUp. */

/* Fonte Quicksand auto-hospedada (sem depender do Google Fonts) — variavel 400-700.
   Arquivos em /assets/fonts/ (baixados do Google Fonts uma vez). */
@font-face {
    font-family: 'Quicksand';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/quicksand-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Quicksand';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/quicksand-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --teal: #0C4448;
    --teal-claro: #145a5f;
    --teal-escuro: #08322f;
    --teal-leve: #e7f1ef;

    --texto: #1f2d2e;
    --texto-suave: #6a787a;
    --texto-fraco: #98a4a5;

    --borda: #e8eded;
    --borda-forte: #d7dede;
    --fundo: #f7f9f9;
    --branco: #ffffff;
    --hover: #f1f5f5;

    --erro: #b3261e;
    --erro-fundo: #fceeed;
    --ok-fundo: #e7f1ef;

    --azul: #1d5a8a;
    --ambar: #b07d1e;
    --verde: #3a7d5d;
    --mencao: #e0564a;     /* acento de atenção: menções, sino, não lido */

    --raio: 10px;
    --raio-sm: 7px;
    --sombra: 0 1px 3px rgba(12, 68, 72, 0.06), 0 6px 18px rgba(12, 68, 72, 0.05);
    --sombra-sm: 0 1px 2px rgba(12, 68, 72, 0.08);

    --rail-w: 74px;
    --side-w: 256px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--texto);
    background: var(--fundo);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); }
h1 { font-size: 21px; font-weight: 700; margin: 0; color: var(--teal-escuro); }
.muted { color: var(--texto-suave); font-size: 14px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.hint { font-size: 13px; color: var(--texto-suave); margin: 4px 0 14px; }

/* ============================ BOTOES ============================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none; text-align: center; font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; padding: 9px 15px; border-radius: var(--raio-sm);
    border: 1.5px solid var(--borda-forte); background: var(--branco); color: var(--texto);
    transition: background .12s, color .12s, border-color .12s, transform .04s;
    white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn--primary:hover { background: var(--teal-claro); border-color: var(--teal-claro); }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--texto-suave); }
.btn--ghost:hover { background: var(--hover); color: var(--teal); }
.btn--danger { border-color: #e3c6c4; color: #a23b35; background: var(--branco); }
.btn--danger:hover { background: var(--erro-fundo); }

/* Botoes-icone (acoes em linha) */
.iconbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: var(--raio-sm); border: 0; cursor: pointer;
    background: transparent; color: var(--texto-suave); font-size: 15px; text-decoration: none;
    transition: background .12s, color .12s;
}
.iconbtn:hover { background: var(--hover); color: var(--teal); }
.iconbtn--danger:hover { background: var(--erro-fundo); color: var(--erro); }

/* ============================ FORMULARIOS ============================ */
label { font-weight: 600; font-size: 14px; }
input[type="email"], input[type="text"], input[type="password"],
input[type="date"], input[type="number"], .select, textarea {
    width: 100%; padding: 11px 13px; font: inherit; color: var(--texto);
    background: var(--branco); border: 1.5px solid var(--borda-forte); border-radius: var(--raio-sm);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, .select:focus, textarea:focus {
    outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12, 68, 72, 0.12);
}
textarea { resize: vertical; }
input[type="color"] { width: 54px; height: 42px; padding: 3px; border: 1.5px solid var(--borda-forte); border-radius: var(--raio-sm); background: #fff; cursor: pointer; }

.form { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.form-grid { display: flex; flex-direction: column; gap: 5px; max-width: 600px; }
.form-grid label { margin-top: 10px; }
.row-2 { display: flex; gap: 14px; flex-wrap: wrap; }
.row-2 > * { flex: 1; min-width: 190px; }
.check { display: flex; align-items: center; gap: 8px; width: 100%; font-weight: 500; font-size: 14px; margin: 8px 0; }
.check input { flex: none; }
.check input { width: auto; }
.select--sm { width: auto; min-width: 150px; padding: 7px 11px; font-size: 13px; }

/* ============================ ALERTAS / TAGS ============================ */
.alert { margin: 0 0 16px; padding: 11px 14px; border-radius: var(--raio-sm); font-size: 14px; }
.alert--ok  { background: var(--ok-fundo);  color: var(--teal-escuro); }
.alert--erro{ background: var(--erro-fundo); color: var(--erro); }
.alert--dev { background: var(--teal-leve); color: var(--teal-escuro); border: 1.5px dashed var(--teal); }
.alert--dev a { font-weight: 700; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag--on { background: var(--ok-fundo); color: var(--teal-escuro); }
.tag--off { background: #efe3e3; color: #9a4a45; }

/* Pills de status */
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
.status--a_fazer { background: #eef2f2; color: #5c6b6c; }
.status--em_progresso { background: #e6f0fa; color: var(--azul); }
.status--aguardando_cliente { background: #f7eed9; color: var(--ambar); }
.status--concluida { background: var(--ok-fundo); color: var(--teal-escuro); }
/* Versao solida (cabecalho de grupo) */
.status--solid { color: #fff; }
.status--solid.status--a_fazer { background: #8c9b9c; }
.status--solid.status--em_progresso { background: var(--azul); }
.status--solid.status--aguardando_cliente { background: var(--ambar); }
.status--solid.status--concluida { background: var(--teal); }

/* Avatar circular com iniciais */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%; background: var(--teal);
    color: #fff; font-weight: 700; font-size: 12px; flex: none; letter-spacing: .3px;
}
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }

/* Pontinho colorido (lista) */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); flex: none; }

/* ============================ LOGIN ============================ */
.container { width: 100%; max-width: 640px; margin: 0 auto; padding: 28px 18px 40px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.card { background: var(--branco); border-radius: var(--raio); box-shadow: var(--sombra); padding: 26px; border: 1px solid var(--borda); }
.card--auth { max-width: 400px; margin: 0 auto; }
.brand { display: flex; flex-direction: column; line-height: 1; margin-bottom: 20px; }
.brand__mark { font-weight: 700; font-size: 30px; letter-spacing: .5px; color: var(--teal); }
.brand__sub { font-weight: 500; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--texto-suave); margin-top: 5px; }
.card--auth .btn { width: 100%; justify-content: center; margin-top: 12px; padding: 12px; }

/* ============================ ESQUELETO (SHELL) ============================ */
body.app-shell { overflow: hidden; }
.app { display: grid; grid-template-columns: var(--rail-w) var(--side-w) 1fr; height: 100vh; }
/* Recolher a sidebar: mantem o item no grid (largura 0) para o workspace nao escorregar de coluna. */
.app.sidebar-off { grid-template-columns: var(--rail-w) 0 1fr; }
.app.sidebar-off .sidebar { min-width: 0; overflow: hidden; border-right: 0; pointer-events: none; }

/* --- Trilha de icones (esquerda) --- */
.rail {
    background: var(--teal-escuro); color: #cfe4e2;
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 6px; gap: 4px;
}
.rail__logo {
    width: 40px; height: 40px; border-radius: 11px; background: #fff; color: var(--teal);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 22px; text-decoration: none; margin-bottom: 10px; flex: none;
}
.rail__nav { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.rail__item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px; border-radius: 10px; text-decoration: none;
    color: #b9d4d2; font-size: 10px; font-weight: 600; transition: background .12s, color .12s;
}
.rail__item svg { width: 22px; height: 22px; }
.rail__item:hover { background: rgba(255,255,255,.10); color: #fff; }
.rail__item.is-active { background: rgba(255,255,255,.16); color: #fff; }
.rail__spacer { flex: 1; }
.rail__user { color: #cfe4e2; }
.rail__user .avatar { width: 30px; height: 30px; border: 1.5px solid rgba(255,255,255,.35); }

/* --- Sidebar (listas) --- */
.sidebar {
    background: var(--branco); border-right: 1px solid var(--borda);
    display: flex; flex-direction: column; overflow-y: auto; padding: 6px 0;
}
.sidebar__head { padding: 12px 16px 8px; }
.sidebar__ws { font-weight: 700; font-size: 15px; color: var(--teal-escuro); }
.sidebar__all {
    display: flex; align-items: center; gap: 9px; margin: 2px 8px; padding: 9px 10px;
    border-radius: var(--raio-sm); text-decoration: none; color: var(--texto); font-weight: 600; font-size: 14px;
}
.sidebar__all:hover { background: var(--hover); }
.sidebar__all.is-active { background: var(--teal-leve); color: var(--teal-escuro); }
.sidebar__all-ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--teal); color: #fff; font-size: 13px; }
.sidebar__section {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 6px; font-size: 11px; font-weight: 700; letter-spacing: .8px;
    text-transform: uppercase; color: var(--texto-fraco);
}
.sidebar__add { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; color: var(--texto-suave); text-decoration: none; font-size: 17px; }
.sidebar__add:hover { background: var(--hover); color: var(--teal); }
.sidebar__lists { display: flex; flex-direction: column; }
.sidebar__link {
    display: flex; align-items: center; gap: 9px; margin: 1px 8px; padding: 8px 10px;
    border-radius: var(--raio-sm); text-decoration: none; color: var(--texto); font-size: 14px; font-weight: 500;
}
.sidebar__link:hover { background: var(--hover); }
.sidebar__link.is-active { background: var(--teal-leve); color: var(--teal-escuro); font-weight: 600; }
.sidebar__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__count { font-size: 12px; color: var(--texto-fraco); font-weight: 600; background: var(--fundo); border-radius: 999px; padding: 1px 8px; }
.sidebar__empty, .sidebar__manage { color: var(--texto-suave); text-decoration: none; font-size: 13px; padding: 9px 18px; }
.sidebar__empty:hover, .sidebar__manage:hover { color: var(--teal); }
.sidebar__manage { margin-top: auto; border-top: 1px solid var(--borda); }

/* --- Area principal --- */
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--fundo); }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 52px; padding: 0 22px; background: var(--branco); border-bottom: 1px solid var(--borda); flex: none;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.crumbs__item { font-weight: 600; color: var(--teal-escuro); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs__item:first-child:not(:last-child) { color: var(--texto-suave); font-weight: 500; }
.crumbs__sep { color: var(--texto-fraco); }
.topbar__left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar__toggle { flex: none; }
.topbar__user { display: flex; align-items: center; gap: 9px; flex: none; }
.topbar__name { font-size: 14px; font-weight: 600; color: var(--texto); }
.topbar__sair { font-size: 13px; font-weight: 600; color: var(--texto-suave); text-decoration: none; padding: 5px 10px; border-radius: var(--raio-sm); }
.topbar__sair:hover { background: var(--hover); color: var(--teal); }

.content { flex: 1; overflow-y: auto; padding: 22px 26px 70px; }

/* Cabecalho de pagina (titulo + acao) */
.page-head, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head__sub { margin: 3px 0 0; font-size: 13px; color: var(--texto-suave); }

/* Barra de visualizacao (aba Lista + filtros) */
.viewbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--borda); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }

/* ============================ LISTA AGRUPADA (TAREFAS) ============================ */
.groups { display: flex; flex-direction: column; gap: 16px; }
.group { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra-sm); overflow: hidden; }
.group__head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; }
.group__head:hover { background: var(--hover); }
.group__caret { color: var(--texto-fraco); font-size: 11px; transition: transform .15s; }
.group.is-collapsed .group__caret { transform: rotate(-90deg); }
.group.is-collapsed .group__rows { display: none; }
.group__count { font-size: 12px; font-weight: 700; color: var(--texto-fraco); background: var(--fundo); border-radius: 999px; padding: 1px 9px; }

.task {
    display: grid;
    grid-template-columns: 28px minmax(160px, 1fr) 170px 150px 130px 70px;
    align-items: center; gap: 10px;
    padding: 9px 14px; border-top: 1px solid var(--borda);
}
.task:hover { background: var(--hover); }
.task__check { display: flex; }
.task__name { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--texto); min-width: 0; }
.task__title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__name:hover .task__title { color: var(--teal); }
.task.is-done .task__title { text-decoration: line-through; color: var(--texto-suave); font-weight: 500; }
.task__lista { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--texto-suave); min-width: 0; }
.task__lista span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__resp { display: flex; align-items: center; gap: 7px; min-width: 0; }
.task__resp-nome { font-size: 13px; color: var(--texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__due { font-size: 13px; color: var(--texto-suave); white-space: nowrap; }
.task__due.is-late { color: var(--erro); font-weight: 700; }
.task__actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
.task:hover .task__actions { opacity: 1; }
.task__actions form { margin: 0; }
.recorrente { color: var(--teal); cursor: default; flex: none; display: inline-flex; align-items: center; }
.recorrente svg { display: block; }

/* Cabecalho clicavel para ordenar (A-Z, datas, status) */
.cellsort { font: inherit; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--texto-suave); background: transparent; border: 0; padding: 0; cursor: pointer; text-align: left; }
.cellsort:hover { color: var(--teal); }
.cellsort.is-sorted { color: var(--teal); }
.sortcaret { display: inline-block; width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; opacity: 0; vertical-align: middle; }
.cellsort.is-sorted[data-dir="asc"] .sortcaret { border-bottom: 5px solid currentColor; border-top: 0; opacity: 1; }
.cellsort.is-sorted[data-dir="desc"] .sortcaret { border-top: 5px solid currentColor; border-bottom: 0; opacity: 1; }

/* Etiqueta (pill) — ex.: "Recorrente · Mensal" no topo do detalhe */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; background: var(--teal-leve); color: var(--teal-escuro); font-size: 12px; font-weight: 600; }
.badge--rec svg { display: block; }

/* Bolinha de status (clicar abre o seletor, estilo ClickUp) */
.check-circle { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--borda-forte); background: #fff; cursor: pointer; padding: 0; position: relative; flex: none; transition: border-color .12s, background .12s, box-shadow .12s; }
.check-circle:hover { box-shadow: 0 0 0 3px rgba(12, 68, 72, .14); }
/* Miolo colorido: deixa a cor bem visível mesmo na bolinha pequena */
.check-circle::before { content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); background: transparent; transition: background .12s; }
.check-circle[data-status="a_fazer"] { border-color: #9aa6a6; }
.check-circle[data-status="a_fazer"]::before { background: #c2cbcb; }
.check-circle[data-status="em_progresso"] { border-color: var(--azul); }
.check-circle[data-status="em_progresso"]::before { background: var(--azul); }
.check-circle[data-status="aguardando_cliente"] { border-color: var(--ambar); }
.check-circle[data-status="aguardando_cliente"]::before { background: var(--ambar); }
/* Concluída: bolinha preenchida + tique branco */
.check-circle[data-status="concluida"], .check-circle.is-on { background: var(--teal); border-color: var(--teal); }
.check-circle[data-status="concluida"]::before, .check-circle.is-on::before { background: transparent; }
.check-circle.is-on::after, .check-circle[data-status="concluida"]::after {
    content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Seletor de status (popover ao clicar na bolinha) */
.status-pop { position: fixed; z-index: 90; min-width: 184px; background: #fff; border: 1px solid var(--borda); border-radius: 10px; box-shadow: var(--sombra); padding: 5px; }
.status-pop__opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; font: inherit; font-size: 13px; color: var(--texto); background: transparent; border: 0; border-radius: 7px; padding: 7px 9px; cursor: pointer; }
.status-pop__opt:hover { background: var(--hover); }
.status-pop__opt.is-current { font-weight: 700; }
.status-pop__opt.is-current::after { content: "✓"; margin-left: auto; color: var(--teal); font-weight: 700; }
.status-pop__dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.task-add { display: block; padding: 9px 14px; border-top: 1px solid var(--borda); color: var(--texto-fraco); text-decoration: none; font-size: 13px; font-weight: 600; }
.task-add:hover { color: var(--teal); background: var(--hover); }

/* Estado vazio */
.empty { text-align: center; color: var(--texto-suave); padding: 48px 20px; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra-sm); }
.empty__icon { font-size: 34px; margin-bottom: 8px; }

/* ============================ TABELAS (Listas / Equipe) ============================ */
.tbl { width: 100%; border-collapse: collapse; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra-sm); }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--borda); font-size: 14px; vertical-align: middle; }
.tbl th { background: #fafcfc; color: var(--texto-suave); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover, .tbl tr:hover { background: var(--hover); }
.acoes { display: flex; gap: 6px; align-items: center; }
.acoes form { margin: 0; }

/* ============================ RECORRENCIA (formulario) ============================ */
.bloco-rec { border: 1.5px dashed var(--borda-forte); border-radius: var(--raio); padding: 15px; margin-top: 8px; }
.bloco-rec.is-on { border-color: var(--teal); background: #fafdfd; }
.dias-semana { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.dias-semana label { display: flex; align-items: center; gap: 5px; font-weight: 500; font-size: 13px; background: #fff; border: 1.5px solid var(--borda-forte); border-radius: var(--raio-sm); padding: 6px 9px; cursor: pointer; margin: 0; }
.dias-semana input { width: auto; }

/* ============================ LISTA (planilha, agrupada por frequencia) ============================ */
.tasklist {
    --cols: 28px minmax(150px, 1fr) 48px 96px 96px 38px;
    background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio);
    box-shadow: var(--sombra-sm); overflow: hidden;
}
.tasklist--cliente { --cols: 28px minmax(140px, 1fr) 48px 92px 92px 132px 38px; }

.trow { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 8px; padding: 2px 12px; border-top: 1px solid var(--borda); }
.trow--head { border-top: 0; padding: 5px 12px; background: #fafcfc; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--texto-suave); }
.trow:not(.trow--head):hover { background: var(--hover); }
.cell { min-width: 0; display: flex; align-items: center; gap: 6px; }
.cell--check { justify-content: center; }
.cell--acoes { justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .12s; }
.trow:hover .cell--acoes { opacity: 1; }
.cell--cliente { font-size: 13px; color: var(--texto-suave); }
.cell--cliente span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-inline { margin: 0; display: flex; }

.trow__titulo { font-weight: 600; font-size: 13px; color: var(--texto); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow__titulo:hover { color: var(--teal); }
.trow.is-done .trow__titulo { text-decoration: line-through; color: var(--texto-suave); font-weight: 500; }
.subtoggle { border: 0; background: transparent; cursor: pointer; color: var(--texto-fraco); font-size: 12px; padding: 2px 4px; transition: transform .15s; flex: none; }
.taskwrap.subs-open .subtoggle { transform: rotate(90deg); }
.subcount { font-size: 11px; color: var(--texto-fraco); background: var(--fundo); border-radius: 999px; padding: 1px 7px; font-weight: 700; flex: none; }

/* Grupos por frequencia */
.grouphead { display: flex; align-items: center; gap: 10px; padding: 5px 12px; cursor: pointer; border-top: 1px solid var(--borda); user-select: none; }
.grouphead:hover { background: var(--hover); }
.caret { color: var(--texto-fraco); font-size: 11px; transition: transform .15s; }
.group2.is-collapsed .caret { transform: rotate(-90deg); }
.group2.is-collapsed .group2__rows { display: none; }
.freq-pill { color: #fff; font-weight: 700; font-size: 10px; letter-spacing: .4px; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; }
.grouphead__count { font-size: 12px; color: var(--texto-fraco); font-weight: 600; background: var(--fundo); border-radius: 999px; padding: 1px 9px; }

/* Subtarefas */
.trow--sub { display: none; background: #fcfdfd; }
.taskwrap.subs-open .trow--sub { display: grid; }
.trow--sub .cell--nome { padding-left: 22px; }

/* Controles de edicao inline */
.inline { width: 100%; font: inherit; font-size: 13px; color: var(--texto); border: 1.5px solid transparent; background: transparent; border-radius: 6px; padding: 3px 6px; cursor: pointer; transition: border-color .1s, box-shadow .15s; }
.inline:hover { border-color: var(--borda-forte); background: #fff; }
.inline:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 2px rgba(12, 68, 72, .12); }
.inline--data { font-size: 12px; }
.inline--data.is-late { color: var(--erro); font-weight: 700; }
/* Datas inline na lista: anula o "tamanhao" de formulario (padding/borda/fonte grandes). */
.trow .inline--data { padding: 3px 5px; font-size: 12px; border: 1.5px solid transparent; background: transparent; }
.trow .inline--data:hover { border-color: var(--borda-forte); background: #fff; }
.trow .inline--data:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 2px rgba(12, 68, 72, .12); }

/* Chips de data (abrem o calendario de periodo) */
.datechip { width: 100%; text-align: left; font: inherit; font-size: 12px; color: var(--texto); border: 1.5px solid transparent; background: transparent; border-radius: 6px; padding: 3px 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.datechip:hover { border-color: var(--borda-forte); background: #fff; }
.datechip.vazio { color: var(--texto-fraco); }
.datechip.is-late { color: var(--erro); font-weight: 700; }

/* Popover do calendario de periodo */
.calpop { position: fixed; z-index: 80; width: 250px; background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra); padding: 10px; }
.calpop[hidden] { display: none; }
.calpop__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.calpop__title { font-weight: 700; font-size: 13px; color: var(--teal-escuro); text-transform: capitalize; }
.calpop__nav { width: 28px; height: 28px; border: 0; background: transparent; color: var(--texto-suave); font-size: 18px; cursor: pointer; border-radius: 6px; }
.calpop__nav:hover { background: var(--hover); color: var(--teal); }
.calpop__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.calpop__wd { text-align: center; font-size: 10px; font-weight: 700; color: var(--texto-fraco); padding: 2px 0; }
.calpop__day { height: 30px; border: 0; background: transparent; font: inherit; font-size: 12px; color: var(--texto); cursor: pointer; border-radius: 6px; }
.calpop__day:hover { background: var(--hover); }
.calpop__day.is-out { color: var(--texto-fraco); opacity: .5; }
.calpop__day.is-today { box-shadow: inset 0 0 0 1.5px var(--borda-forte); }
.calpop__day.is-between { background: var(--teal-leve); border-radius: 0; }
.calpop__day.is-start, .calpop__day.is-end { background: var(--teal); color: #fff; font-weight: 700; }
.calpop__day.is-start { border-radius: 6px 0 0 6px; }
.calpop__day.is-end { border-radius: 0 6px 6px 0; }
.calpop__day.is-start.is-end { border-radius: 6px; }
.calpop__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.calpop__act { border: 0; background: transparent; color: var(--teal); font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.calpop__act:hover { background: var(--hover); }
.calpop__hint { font-size: 11px; color: var(--texto-fraco); }
/* Seção "Repetir" dentro do calendário */
.calpop__rep { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--borda); display: flex; flex-direction: column; gap: 6px; }
.calpop__replabel { font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.calpop__repsel { width: 100%; font: inherit; font-size: 12px; padding: 5px 7px; border: 1.5px solid var(--borda-forte); border-radius: 6px; background: #fff; }
.calpop__repcustom { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texto-suave); }
.calpop__repcustom[hidden] { display: none; }
.calpop__repcustom input { width: 52px; font: inherit; font-size: 12px; padding: 4px 6px; border: 1.5px solid var(--borda-forte); border-radius: 6px; }
.calpop__repcustom select { font: inherit; font-size: 12px; padding: 4px 6px; border: 1.5px solid var(--borda-forte); border-radius: 6px; background: #fff; }
.calpop__act--prim { background: var(--teal); color: #fff; align-self: flex-start; padding: 5px 11px; }
.calpop__act--prim:hover { background: var(--teal-claro); }
.calpop__repon { font-size: 12px; font-weight: 600; color: var(--teal-escuro); }
.inline.saved { box-shadow: 0 0 0 2px rgba(58, 125, 93, .55); }
.inline.failed { box-shadow: 0 0 0 2px rgba(179, 38, 30, .55); }
.inline--status { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; border-radius: 999px; }
.inline--status.status--a_fazer { background: #eef2f2; color: #5c6b6c; }
.inline--status.status--em_progresso { background: #e6f0fa; color: var(--azul); }
.inline--status.status--aguardando_cliente { background: #f7eed9; color: var(--ambar); }
.inline--status.status--concluida { background: var(--ok-fundo); color: var(--teal-escuro); }
.tasklist .inline--status { font-size: 10px; padding: 2px 7px; letter-spacing: .2px; }

/* Selecao em lote (checkbox por linha + selecionar todas) */
.cell--check { justify-content: center; }
.selbox { display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; cursor: pointer; margin: 0; width: auto; }
.selbox--head, .trow:hover .selbox, .tasklist.has-sel .selbox, .trow.is-sel .selbox { opacity: 1; }
.selcheck, .selall { width: 15px; height: 15px; margin: 0; flex: none; cursor: pointer; accent-color: var(--teal); }
.trow.is-sel { background: var(--teal-leve); }
.trow.is-sel:hover { background: #dceae7; }

/* Responsavel como avatar clicavel (abre o seletor por cima) */
.cell--resp { justify-content: center; }
.resppick { position: relative; display: inline-flex; cursor: pointer; }
.resppick .avatar { transition: transform .08s; }
.resppick:hover .avatar { transform: scale(1.07); }
.avatar--empty { background: #fff; border: 1.5px dashed var(--borda-forte); color: var(--texto-fraco); font-weight: 700; }
.inline--resp { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }

/* Barra de acoes em lote (flutua no rodape ao selecionar) */
.bulkbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60; display: flex; align-items: center; gap: 9px; padding: 8px 12px; background: var(--teal-escuro); color: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(8, 50, 47, .38); max-width: calc(100vw - 24px); flex-wrap: nowrap; white-space: nowrap; }
.bulkbar[hidden] { display: none; }
.bulkbar.is-busy { opacity: .6; pointer-events: none; }
.bulkbar__count { font-size: 13px; font-weight: 600; white-space: nowrap; }
.bulkbar__count b { font-size: 14px; }
.bulkbar__sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .22); }
.bulkbar .select, .bulkbar input[type="date"] { width: auto; min-width: 0; height: 32px; padding: 4px 9px; font-size: 13px; border-color: transparent; }
.bulkbar .btn { height: 32px; padding: 6px 11px; }
.bulk-datewrap { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #cfe4e2; }
.bulk-datewrap input[type="date"] { width: 138px; color: var(--texto); }

/* Icone + preview (popover) da descricao na linha */
.descwrap { position: relative; display: inline-flex; flex: none; }
.descbtn { border: 0; background: transparent; color: var(--texto-fraco); cursor: pointer; padding: 1px 2px; display: inline-flex; align-items: center; border-radius: 5px; }
.descbtn:hover { color: var(--teal); background: var(--hover); }
.descprev { position: fixed; z-index: 70; width: 300px; max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--borda); border-radius: 10px; box-shadow: var(--sombra); padding: 12px 14px; font-size: 13px; line-height: 1.55; color: var(--texto); }
.descprev[hidden] { display: none; }
.descprev > :first-child { margin-top: 0; }
.descprev h4 { font-size: 13px; margin: 9px 0 3px; color: var(--teal-escuro); }
.descprev h5, .descprev h6 { font-size: 12px; margin: 8px 0 3px; color: var(--texto-suave); }
.descprev p { margin: 4px 0; }
.descprev ul, .descprev ol { margin: 4px 0; padding-left: 18px; }
.descprev ul ul, .descprev ol ul, .descprev ul ol { margin: 2px 0 2px 2px; }
.descprev li { margin: 2px 0; }
.descprev strong { color: var(--teal-escuro); }
.descprev code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: #eef2f1; border: 1px solid var(--borda); border-radius: 4px; padding: 0 4px; color: var(--teal-escuro); }

/* Criar tarefa inline */
.trow--add { padding: 5px 12px 7px; border-top: 1px solid var(--borda); }
.addtask-btn { border: 0; background: transparent; color: var(--texto-fraco); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; }
.addtask-btn:hover { color: var(--teal); }
.addtask-input { font: inherit; font-size: 14px; padding: 7px 10px; border: 1.5px solid var(--teal); border-radius: 7px; width: min(440px, 100%); box-shadow: 0 0 0 3px rgba(12, 68, 72, .1); }
.addtask-input.failed { border-color: var(--erro); }

@media (max-width: 820px) {
    .tasklist { overflow-x: auto; }
    .trow, .trow--head, .grouphead, .trow--add { min-width: 600px; }
}

/* ============================ RESUMO DO CLIENTE (recolhivel) ============================ */
.resumo-cli { background: var(--branco); border: 1px solid var(--borda); border-left: 3px solid var(--teal); border-radius: var(--raio-sm); box-shadow: var(--sombra-sm); margin-bottom: 12px; }
.resumo-cli__head { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; list-style: none; font-size: 13px; }
.resumo-cli__head::-webkit-details-marker { display: none; }
.resumo-cli__caret { color: var(--texto-fraco); font-size: 11px; transition: transform .15s; }
.resumo-cli[open] .resumo-cli__caret { transform: rotate(90deg); }
.resumo-cli__titulo { font-weight: 700; color: var(--teal-escuro); }
.resumo-cli__edit { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--texto-suave); text-decoration: none; }
.resumo-cli__edit:hover { color: var(--teal); }
.resumo-cli__corpo { padding: 0 14px 12px 14px; font-size: 13px; line-height: 1.55; color: var(--texto); }
.resumo-cli__corpo > :first-child { margin-top: 0; }
.resumo-cli__corpo h4 { font-size: 13px; margin: 9px 0 3px; color: var(--teal-escuro); }
.resumo-cli__corpo h5 { font-size: 12px; margin: 8px 0 3px; color: var(--teal-escuro); }
.resumo-cli__corpo h6 { font-size: 11px; margin: 8px 0 3px; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .4px; }
.resumo-cli__corpo p { margin: 4px 0; }
.resumo-cli__corpo ul { margin: 4px 0; padding-left: 18px; }
.resumo-cli__corpo li { margin: 2px 0; }
.resumo-cli__corpo strong { color: var(--teal-escuro); }
.resumo-cli--vazio { color: var(--texto-suave); font-size: 13px; padding: 8px 12px; border-left-color: var(--borda-forte); }

/* Carteira (compartilhamento de cliente) */
.carteira-box { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 11px 13px; border: 1.5px solid var(--borda-forte); border-radius: 8px; background: #fbfdfd; }
.carteira-box .check { margin: 0; }

/* Editor visual do resumo (formatação por botões, sem markdown) */
.rt { border: 1.5px solid var(--borda-forte); border-radius: var(--raio-sm); overflow: hidden; background: #fff; }
.rt__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: #fafcfc; border-bottom: 1px solid var(--borda); }
.rt__btn { border: 1px solid transparent; background: transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--texto-suave); padding: 4px 9px; border-radius: 6px; }
.rt__btn:hover { background: var(--hover); color: var(--teal); }
.rt__edit { min-height: 150px; padding: 12px 14px; font-size: 14px; line-height: 1.6; outline: none; color: var(--texto); }
.rt__edit:focus { box-shadow: inset 0 0 0 2px rgba(12, 68, 72, .12); }
.rt__edit:empty::before { content: attr(data-placeholder); color: var(--texto-fraco); }
.rt__edit > :first-child { margin-top: 0; }
.rt__edit h4 { font-size: 15px; margin: 10px 0 4px; color: var(--teal-escuro); }
.rt__edit h5 { font-size: 13px; margin: 8px 0 3px; color: var(--teal-escuro); }
.rt__edit p { margin: 5px 0; }
.rt__edit ul, .rt__edit ol { margin: 6px 0; padding-left: 20px; }
.rt__edit li { margin: 2px 0; }
.rt__edit strong, .rt__edit b { color: var(--teal-escuro); }
.rt__edit code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: #eef2f1; border: 1px solid var(--borda); border-radius: 5px; padding: 1px 5px; color: var(--teal-escuro); }
.rt__btn--code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.rt__foot { display: flex; gap: 8px; padding: 8px 10px; background: #fafcfc; border-top: 1px solid var(--borda); }
.detalhe__rt .rt__edit { min-height: 220px; }

/* ============================ DETALHE DA TAREFA ============================ */
.detalhe { max-width: 1000px; }
.detalhe__titulo { width: 100%; font-size: 23px; font-weight: 700; color: var(--teal-escuro); border: 1.5px solid transparent; border-radius: 8px; padding: 7px 9px; margin: 4px 0 16px; background: transparent; font-family: inherit; }
.detalhe__titulo:hover { border-color: var(--borda); }
.detalhe__titulo:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(12, 68, 72, .12); }
.detalhe__grid { display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 18px; align-items: start; }
.detalhe__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-det { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra-sm); padding: 16px 18px; }
.card-det h3 { margin: 0 0 12px; font-size: 14px; color: var(--teal-escuro); }
.detalhe__desc { width: 100%; border: 1.5px solid var(--borda-forte); border-radius: 8px; padding: 11px 12px; font: inherit; resize: vertical; }
.detalhe__desc:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12, 68, 72, .12); }

/* Descricao formatada (markdown leve) — detalhe da tarefa */
.detalhe__descview { border: 1.5px solid transparent; border-radius: 8px; padding: 11px 12px; cursor: text; transition: background .12s ease, border-color .12s ease; }
.detalhe__descview:hover { background: #f5f7f7; border-color: var(--borda); }
.detalhe__descview.is-empty { color: var(--texto-suave); }
.md-body { font-size: 14px; line-height: 1.62; color: var(--texto); }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body p { margin: 8px 0; }
.md-body strong { color: var(--teal-escuro); }
.md-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: #eef2f1; border: 1px solid var(--borda); border-radius: 5px; padding: 1px 5px; color: var(--teal-escuro); }
.md-body h4 { font-size: 14px; margin: 13px 0 4px; color: var(--teal-escuro); }
.md-body h5, .md-body h6 { font-size: 13px; margin: 11px 0 3px; color: var(--texto-suave); }
.md-body ul, .md-body ol { margin: 6px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body ul ul, .md-body ol ul, .md-body ul ol { margin: 2px 0 2px 4px; }

/* Elementos ricos do markdown (tabelas, citacoes, divisorias, links) — todas as superficies */
.md-body table, .descprev table, .rt__edit table, .resumo-cli__corpo table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12.5px; }
.md-body th, .md-body td, .descprev th, .descprev td, .rt__edit th, .rt__edit td, .resumo-cli__corpo th, .resumo-cli__corpo td { border: 1px solid var(--borda); padding: 5px 8px; text-align: left; vertical-align: top; }
.md-body th, .descprev th, .rt__edit th, .resumo-cli__corpo th { background: #eef4f3; color: var(--teal-escuro); font-weight: 700; }
.md-body tbody tr:nth-child(even) td, .rt__edit tbody tr:nth-child(even) td, .resumo-cli__corpo tbody tr:nth-child(even) td { background: #fafcfc; }
.md-body blockquote, .descprev blockquote, .rt__edit blockquote, .resumo-cli__corpo blockquote { margin: 9px 0; padding: 7px 13px; border-left: 4px solid var(--teal); background: #f3f8f7; border-radius: 0 8px 8px 0; }
.md-body blockquote p, .descprev blockquote p, .rt__edit blockquote p, .resumo-cli__corpo blockquote p { margin: 3px 0; }
.md-body hr, .descprev hr, .rt__edit hr, .resumo-cli__corpo hr { border: 0; border-top: 1px solid var(--borda); margin: 13px 0; }
.md-body a, .descprev a, .rt__edit a, .resumo-cli__corpo a { color: var(--teal); text-decoration: underline; }
.md-body em, .descprev em, .rt__edit em, .resumo-cli__corpo em { font-style: italic; }
.resumo-cli__corpo ol { margin: 4px 0; padding-left: 18px; }
.resumo-cli__corpo code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: #eef2f1; border: 1px solid var(--borda); border-radius: 4px; padding: 0 4px; color: var(--teal-escuro); }

.inline-blur.saved { box-shadow: 0 0 0 2px rgba(58, 125, 93, .55); }
.inline-blur.failed { box-shadow: 0 0 0 2px rgba(179, 38, 30, .55); }

/* Propriedades (lateral) */
.props { display: flex; flex-direction: column; gap: 13px; }
.prop { display: flex; flex-direction: column; gap: 5px; }
.prop > label { font-size: 12px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .4px; }
.prop-ro { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texto-suave); padding: 2px 0; }
.prop .inline { border-color: var(--borda-forte); background: #fff; }
.rec-info { font-size: 13px; color: var(--teal-escuro); background: var(--teal-leve); padding: 11px; border-radius: 8px; line-height: 1.5; }
.rec-info form { margin-top: 9px; }

/* Subtarefas */
.subs { display: flex; flex-direction: column; }
.sub-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto 30px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--borda); }
.sub-item:last-child { border-bottom: 0; }
.sub-item__titulo { font-weight: 600; font-size: 14px; color: var(--texto); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-item__titulo:hover { color: var(--teal); }
.sub-item.is-done .sub-item__titulo { text-decoration: line-through; color: var(--texto-suave); }
.sub-item__resp { font-size: 12px; color: var(--texto-suave); }
.sub-add { display: flex; gap: 8px; margin-top: 12px; }
.sub-add input { flex: 1; padding: 9px 11px; font: inherit; border: 1.5px solid var(--borda-forte); border-radius: 7px; }
.sub-add input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12, 68, 72, .12); }

/* Comentarios */
.coments { display: flex; flex-direction: column; gap: 13px; margin-bottom: 14px; }
.coment { display: flex; gap: 10px; align-items: flex-start; }
.coment__meta { font-size: 13px; margin-bottom: 2px; }
.coment__corpo { font-size: 14px; line-height: 1.5; }
.coment__texto { word-break: break-word; }
.coment-add { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.coment-add__box { position: relative; width: 100%; }
.coment-add textarea { width: 100%; padding: 10px 12px; font: inherit; border: 1.5px solid var(--borda-forte); border-radius: 8px; resize: vertical; }
.coment-add textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12, 68, 72, .12); }

/* Destaque de @mencao dentro do texto do comentario */
.mention { background: var(--teal-leve); color: var(--teal-escuro); font-weight: 600; border-radius: 5px; padding: 0 4px; }

/* Popover de autocomplete de @mencao */
.mention-pop {
    position: absolute; left: 0; top: 100%; margin-top: 4px; z-index: 80;
    min-width: 220px; max-width: 320px; max-height: 230px; overflow-y: auto;
    background: #fff; border: 1px solid var(--borda); border-radius: 10px; box-shadow: var(--sombra); padding: 5px;
}
.mention-pop[hidden] { display: none; }
.mention-item {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
    padding: 7px 9px; border: 0; background: transparent; border-radius: 7px; cursor: pointer;
    font: inherit; font-size: 13.5px; font-weight: 600; color: var(--texto);
}
.mention-item:hover, .mention-item.is-active { background: var(--teal-leve); color: var(--teal-escuro); }
.mention-ini {
    flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}

/* Iconezinho de "voce foi mencionado" na linha da tarefa (#34) */
.mencao-flag {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 20px; height: 18px; border-radius: 5px; color: var(--mencao);
    text-decoration: none; animation: mencaoPulse 2s ease-in-out infinite;
}
.mencao-flag:hover { background: #fdecea; }
@keyframes mencaoPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ============================ SINO + NOTIFICACOES ============================ */
.topbar__right { display: flex; align-items: center; gap: 10px; flex: none; }
.bell { position: relative; }
.bell__btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent;
    color: var(--texto-suave); cursor: pointer; transition: background .12s, color .12s;
}
.bell__btn:hover { background: var(--hover); color: var(--teal); }
.bell__dot {
    position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--mencao); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--branco);
}
.bell__pop {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 90; width: 340px; max-width: 86vw;
    background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra); overflow: hidden;
}
.bell__pop[hidden] { display: none; }
.bell__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--borda); font-size: 14px; }
.bell__readall-f { margin: 0; }
.bell__readall { border: 0; background: transparent; color: var(--teal); cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; padding: 2px 4px; border-radius: 5px; }
.bell__readall:hover { background: var(--hover); }
.bell__list { max-height: 340px; overflow-y: auto; }
.bell__empty { padding: 22px 14px; text-align: center; color: var(--texto-suave); font-size: 13px; }
.bell__item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; text-decoration: none; color: var(--texto); border-bottom: 1px solid var(--borda); }
.bell__item:hover { background: var(--hover); }
.bell__item.is-unread { background: #fbf3f1; }
.bell__item.is-unread:hover { background: #f7eae7; }
.bell__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bell__txt { font-size: 13px; line-height: 1.4; }
.bell__txt em { font-style: normal; color: var(--teal-escuro); font-weight: 600; }
.bell__snippet { font-size: 12px; color: var(--texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell__all { display: block; text-align: center; padding: 10px; font-size: 13px; font-weight: 600; color: var(--teal); text-decoration: none; }
.bell__all:hover { background: var(--hover); }

/* Badge de nao lidas no item "Caixa" da trilha lateral */
.rail__item { position: relative; }
.rail__badge {
    position: absolute; top: 5px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--mencao); color: #fff; border-radius: 999px; font-size: 9px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--teal-escuro);
}

/* ============================ CAIXA DE ENTRADA ============================ */
.inbox { display: flex; flex-direction: column; border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; background: #fff; }
.inbox__item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; text-decoration: none; color: var(--texto); border-bottom: 1px solid var(--borda); position: relative; }
.inbox__item:last-child { border-bottom: 0; }
.inbox__item:hover { background: var(--hover); }
.inbox__item.is-unread { background: #fbf3f1; }
.inbox__item.is-unread:hover { background: #f7eae7; }
.inbox__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.inbox__line { font-size: 14px; }
.inbox__line em { font-style: normal; color: var(--teal-escuro); font-weight: 600; }
.inbox__when { color: var(--texto-fraco); font-size: 12px; margin-left: 6px; }
.inbox__snippet { font-size: 13px; color: var(--texto-suave); }
.inbox__pip { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--mencao); margin-top: 6px; }

/* ============================ TOAST (desfazer etc.) ============================ */
.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px);
    z-index: 200; background: var(--teal-escuro); color: #fff; padding: 11px 18px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; box-shadow: var(--sombra); opacity: 0; transition: opacity .22s, transform .22s; pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ============================ ANEXOS ============================ */
/* Iconezinho de clipe na linha da tarefa (tem anexos) */
.anexo-flag { display: inline-flex; align-items: center; gap: 1px; flex: none; color: var(--texto-fraco); text-decoration: none; border-radius: 5px; padding: 1px 2px; }
.anexo-flag:hover { color: var(--teal); background: var(--hover); }
.anexo-flag__n { font-size: 10px; font-weight: 700; }

/* Lista de anexos no detalhe */
.anexos { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.anexo { display: flex; align-items: center; gap: 8px; }
.anexo__link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--borda); border-radius: 9px; text-decoration: none; color: var(--texto); background: #fff; transition: border-color .12s, background .12s; }
.anexo__link:hover { border-color: var(--teal); background: var(--teal-leve); }
.anexo__ic { flex: none; color: var(--teal); display: inline-flex; }
.anexo__info { display: flex; flex-direction: column; min-width: 0; }
.anexo__nome { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo__meta { font-size: 12px; color: var(--texto-suave); }
.anexo-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anexo-add__input { font-size: 13px; max-width: 100%; }
.anexo-add__input::file-selector-button { font: inherit; font-size: 13px; font-weight: 600; color: var(--teal); background: var(--teal-leve); border: 0; border-radius: 7px; padding: 7px 12px; margin-right: 10px; cursor: pointer; }
.anexo-add__input::file-selector-button:hover { background: #dceae7; }

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

/* ============================ RESPONSIVO ============================ */
@media (max-width: 900px) {
    .app { grid-template-columns: var(--rail-w) 1fr; }
    .sidebar { display: none; }
    .task { grid-template-columns: 28px minmax(120px, 1fr) 120px 110px; }
    .task__resp, .task__due { display: none; }
}
@media (max-width: 560px) {
    .app { grid-template-columns: 1fr; }
    .rail { flex-direction: row; height: 56px; padding: 6px 10px; gap: 6px; }
    .rail__logo { margin-bottom: 0; }
    .rail__nav { flex-direction: row; width: auto; }
    .rail__spacer { display: none; }
    .rail__item span { display: none; }
    .content { padding: 16px 14px 50px; }
    .topbar__name { display: none; }
    .task { grid-template-columns: 28px 1fr auto; }
    .task__lista { display: none; }
}

/* ---- Form "Nova tarefa": botão de data + selo de repetição (usa o calendário Calpop) ---- */
.dater { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.datebtn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--borda); border-radius: 10px; background: #fff; color: var(--texto); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.datebtn:hover { border-color: var(--teal); background: var(--hover); }
.datebtn svg { color: var(--texto-suave); flex-shrink: 0; }
.repbadge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border-radius: 999px; background: var(--teal-leve); color: var(--teal-escuro); font-size: 13px; font-weight: 600; }
.repbadge svg { color: var(--teal); flex-shrink: 0; }
.repbadge__x { border: 0; background: transparent; color: var(--teal-escuro); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 50%; opacity: .6; }
.repbadge__x:hover { opacity: 1; }
.repbadge[hidden] { display: none; }
