/* ==============================================================
   Bravva Tarefas — tema v2 (claro). Base: canvas "Bravva Tarefas v2".
   Fundo claro, barra branca, tinta quase preta nos botões principais,
   índigo só para seleção/marca. Cor de alerta só no prazo.
   ============================================================== */
:root {
  --bg: #f7f7f9;
  --card: #ffffff;
  --ink: #16181d;
  --ink-2: #2b2e37;
  --txt: #3d4150;
  --muted: #5d6170;
  --line: #ececf1;
  --line-2: #dfe1e8;
  --hover: #f2f2f6;
  --brand: #4f46e5;
  --accent: #5b5bd6;
  --accent-ink: #3c3cb8;
  --accent-soft: #efeffd;
  --late: #c2261d;
  --late-bg: #fdecea;
  --today: #a35a00;
  --today-bg: #fff4e0;
  --ok: #0f5e51;
  --ok-bg: #eef7f2;
  --red-dot: #e5484d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 0 0 1px var(--line);
  --shadow-up: 0 4px 12px rgba(22, 24, 29, .08), 0 0 0 1px var(--line-2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* senão .btn/.stack (display:flex) ignoram o atributo hidden */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Figtree', system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: #4b4bc8; }
a:hover { color: #2f2fa0; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kbd { font-size: 11px; font-weight: 700; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; color: var(--muted); line-height: 1.4; }
body.trava { overflow: hidden; } /* gaveta/janela abertas */

/* ---- Casca ---------------------------------------------------- */
.app { min-height: 100vh; display: flex; }
.side { flex: 0 0 236px; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.brand-txt { display: flex; flex-direction: column; }
.brand-txt b { font-size: 15px; color: var(--ink); }
.brand-txt span { font-size: 12px; color: var(--muted); }
.btn-novo { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; }
.btn-novo:hover { background: #000; color: #fff; }
.btn-novo .kbd { margin-left: auto; border-color: rgba(255, 255, 255, .35); color: #fff; opacity: .8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--txt); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav .cnt { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav a.on .cnt { color: var(--accent-ink); }
.nav .ponto { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red-dot); color: #fff; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.side-user { margin-top: auto; position: relative; }
.side-user > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.side-user > summary::-webkit-details-marker { display: none; }
.side-user .who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.side-user .who b { font-size: 13.5px; }
.side-user .who span { font-size: 12px; color: var(--muted); }
.side-user .menu { bottom: calc(100% + 6px); top: auto; left: 0; right: 0; }

.main { flex: 1; min-width: 0; padding: 28px 40px 80px; display: flex; flex-direction: column; gap: 18px; }
.miolo { width: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.page-head .t { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.page-head .sub { font-size: 13.5px; color: var(--muted); }
.busca { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); min-width: 240px; color: var(--muted); }
.busca input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; flex: 1; min-width: 0; color: var(--ink); }
.topbar, .bottomnav { display: none; }

/* ---- Menus (⋯ e avatar) --------------------------------------- */
details.pop { position: relative; }
details.pop > summary { list-style: none; cursor: pointer; }
details.pop > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 220px; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(22, 24, 29, .16), 0 0 0 1px var(--line); padding: 6px; display: flex; flex-direction: column; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; width: 100%; }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.menu .perigo { color: var(--late); }
.menu form { margin: 0; }

/* ---- Componentes ---------------------------------------------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card h2, .h2 { font-size: 15px; font-weight: 700; }
.lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.meta { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row-flex { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c9ccd6; background: #fafafb; color: var(--ink); }
.btn-pri { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-pri:hover { background: #000; border-color: #000; color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-ico { width: 44px; padding: 0; }
.btn-link { border: 0; background: none; padding: 0; min-height: 0; color: #4b4bc8; }
.btn-danger { color: var(--late); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.icb { width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; flex: none; }
.icb:hover { background: var(--hover); color: var(--ink); }
form.inline { display: inline; margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: #f2f2f6; color: var(--ink-2); }
.k-prod { background: #f2f2f6; color: #374151; }
.k-rev { background: var(--accent-soft); color: var(--accent-ink); }
.k-apr { background: #fff1e6; color: #8a3a0c; }
.k-pub { background: #e6f3ee; color: var(--ok); }
.c-late { background: var(--late-bg); color: var(--late); }
.c-today { background: var(--today-bg); color: var(--today); }
.c-date { background: #f2f2f6; color: var(--txt); }
.c-ok { background: var(--ok-bg); color: var(--ok); }
.late { color: var(--late); font-weight: 700; }
.today { color: var(--today); font-weight: 700; }
.dot { width: 7px; height: 7px; border-radius: 99px; flex: none; display: inline-block; }
.d-producao { background: #9aa0ad; }
.d-revisao { background: var(--accent); }
.d-aprovacao_cliente { background: #e07b16; }
.d-publicacao { background: #0f766e; }

.av { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; flex: none; }
.av-sm { width: 18px; height: 18px; border-radius: 5px; font-size: 8.5px; }
.av-lg { width: 44px; height: 44px; border-radius: 10px; font-size: 14px; }
.pav { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; background: #dbe0f5; color: #151a2e; }
.pav-sm { width: 22px; height: 22px; font-size: 9px; }
.pav-lg { width: 32px; height: 32px; font-size: 12px; }

/* Formulários */
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fld input, .fld select, .fld textarea, .inp { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); width: 100%; }
.fld textarea, textarea.inp { padding: 11px 12px; min-height: 88px; resize: vertical; line-height: 1.5; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .inp:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; color: var(--ink); font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }

.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-danger { background: var(--late-bg); color: var(--late); }
.flash-info { background: var(--accent-soft); color: var(--accent-ink); }
.empty { border: 1.5px dashed #d6d8e0; border-radius: 12px; padding: 22px 16px; font-size: 13.5px; color: var(--muted); text-align: center; line-height: 1.5; }

/* Aviso rápido (embaixo, some sozinho) com "Desfazer" */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 18px; border-radius: 12px; background: var(--ink); color: #e9eaf0; font-size: 14px; box-shadow: 0 10px 30px rgba(22, 24, 29, .25); }
.toast b { color: #fff; }
.toast .t-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button, .toast a.t-bt { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: #2b2e37; color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; flex: none; }
.toast form { margin: 0; }
.toast.erro { background: var(--late); }
.toast.saindo { opacity: 0; transition: opacity .25s; }

/* ---- Hoje ----------------------------------------------------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px; color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a .c { font-size: 12px; font-weight: 700; background: #eeeff3; color: var(--txt); border-radius: 999px; padding: 1px 8px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs a.on .c { background: var(--ink); color: #fff; }
.grp { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 14px 16px 2px; }
.lista { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 16px; border-radius: 12px; background: #fff; }
.item:hover { box-shadow: var(--shadow); }
.item.fila { background: #fbfbfc; }
.ck { width: 26px; height: 26px; border-radius: 999px; border: 2px solid #c9ccd6; background: #fff; flex: none; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.ck:hover { border-color: var(--ink); color: var(--ink); }
.ck-fila { border-style: dashed; cursor: default; }
.ck-fila:hover { border-color: #c9ccd6; color: transparent; }
.item .corpo { flex: 1; min-width: 0; }
.tt { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.tt:hover { color: var(--ink); text-decoration: underline; }
.sub { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.prazo { font-size: 13px; font-weight: 600; color: var(--txt); white-space: nowrap; }
.prazo.late { color: var(--late); font-weight: 700; }
.prazo.today { color: var(--today); font-weight: 700; }

/* ---- Gaveta (desktop) / folha (celular) ----------------------- */
.fundo { position: fixed; inset: 0; z-index: 50; background: rgba(22, 24, 29, .28); }
.gaveta { position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(600px, 100vw); background: #fff; box-shadow: -20px 0 50px rgba(22, 24, 29, .14); display: flex; flex-direction: column; }
.gaveta .g-top { display: flex; align-items: center; gap: 6px; padding: 12px 14px 12px 24px; border-bottom: 1px solid var(--line); min-height: 60px; }
.gaveta .g-top .onde { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--txt); margin-right: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gaveta .g-corpo { flex: 1; overflow: auto; padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 22px; }
.gaveta .g-pe { display: flex; gap: 10px; align-items: flex-end; padding: 12px 24px 16px; border-top: 1px solid var(--line); }
.gaveta .g-pe textarea { flex: 1; min-height: 44px; max-height: 160px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-size: 14px; resize: none; color: var(--ink); }
.gaveta .g-pe .enviar { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.g-tit { font-size: 24px; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
.g-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--txt); }
.progresso { display: flex; gap: 4px; }
.progresso span { flex: 1; height: 6px; border-radius: 99px; background: #e6e7ee; }
.progresso span.ok { background: var(--ink); }
.progresso span.cur { background: var(--accent); }
.g-acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.g-acoes .btn-pri { flex: 1 1 260px; min-height: 46px; }
.g-acoes .btn { min-height: 46px; }
.link-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; padding: 0 6px 0 12px; border-radius: 99px; background: #f2f2f6; color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.link-pill a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-pill a:hover { text-decoration: underline; }
.link-pill button { width: 26px; height: 26px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.link-pill button:hover { background: #e4e5ec; color: var(--ink); }
.etapas-lista { display: flex; flex-direction: column; gap: 4px; }
.etapa-l { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: 10px; font-size: 13.5px; }
.etapa-l.cur { background: var(--accent-soft); }
.etapa-l .num { width: 22px; height: 22px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none; background: #eceef3; color: var(--muted); }
.etapa-l.ok .num { background: var(--ink); color: #fff; }
.etapa-l.cur .num { background: var(--accent); color: #fff; }
.etapa-l select { min-height: 34px; margin-left: auto; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; max-width: 150px; }
.msg { display: flex; gap: 12px; }
.msg p { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-line; }
.evento { margin: 0 0 0 40px; font-size: 12.5px; color: var(--muted); }
.brief { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); white-space: pre-line; }
.caixa-leve { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: 14px; color: var(--ink-2); }
.carregando { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }

/* Página cheia da tarefa (abrir pelo link/notificação) */
.tarefa-pagina { max-width: 680px; margin: 0 auto; width: 100%; background: #fff; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.tarefa-pagina .gaveta { position: static; width: 100%; height: auto; box-shadow: none; min-height: 70vh; border-radius: 0; }
.tarefa-pagina .gaveta::before { display: none; }

/* ---- Janela (nova tarefa) ------------------------------------- */
.janela { position: fixed; left: 50%; top: 10vh; transform: translateX(-50%); z-index: 51; width: min(620px, calc(100vw - 24px)); max-height: 84vh; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(22, 24, 29, .22); display: flex; flex-direction: column; }
.janela .j-top { display: flex; align-items: center; padding: 16px 16px 4px 24px; }
.janela .j-top h2 { font-size: 15px; font-weight: 700; color: var(--muted); }
.janela .j-corpo { overflow: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 24px 20px; }
.janela .j-pe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px 12px 24px; border-top: 1px solid var(--line); background: #fbfbfc; border-radius: 0 0 16px 16px; }
.titulo-grande { width: 100%; border: 0; outline: 0; padding: 4px 0; font: inherit; font-size: 22px; font-weight: 700; color: var(--ink); background: transparent; }
.titulo-grande::placeholder { color: #a2a6b2; }
.linha-campos { display: flex; flex-wrap: wrap; gap: 12px; }
.linha-campos .fld { flex: 1 1 180px; min-width: 0; }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 99px; background: #f2f2f6; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pill .pav { width: 20px; height: 20px; font-size: 8px; }
.seta { color: #a2a6b2; }

/* ---- Quadro --------------------------------------------------- */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-f { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--txt); cursor: pointer; text-decoration: none; }
.chip-f:hover { border-color: #c9ccd6; color: var(--ink); }
.chip-f.on { background: var(--ink); border-color: var(--ink); color: #fff; }
select.chip-f { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233d4150' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.board-wrap { overflow-x: auto; padding-bottom: 8px; position: relative; }
.board { display: flex; gap: 16px; align-items: flex-start; min-width: max-content; }
.col { flex: none; width: 292px; display: flex; flex-direction: column; gap: 8px; border-radius: 14px; padding: 4px; min-height: 120px; transition: background .12s; }
.col.alvo { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.colh { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; }
.colh h2 { font-size: 14px; font-weight: 700; }
.colh .n { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kc { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); cursor: grab; }
.kc:hover { box-shadow: var(--shadow-up); color: var(--ink); }
.kc.arrastando { opacity: .45; }
.kc.kc-ver { cursor: pointer; }
.kt { font-size: 14px; font-weight: 600; line-height: 1.35; }
.km { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.km .prazo { margin-left: auto; font-size: 12.5px; }
.col-done { flex: none; width: 56px; align-self: stretch; border-radius: 12px; background: var(--ok-bg); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; color: var(--ok); text-decoration: none; }
.col-done span { writing-mode: vertical-rl; font-size: 13px; font-weight: 700; }

/* ---- Calendário ----------------------------------------------- */
.legenda { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--txt); }
.cal-wrap { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px; overflow-x: auto; position: relative; }
.cal { min-width: 840px; }
.cal-sem { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-sem div { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 8px; }
.cal-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.dia { min-height: 128px; background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dia.fora { background: #fafafb; }
.dia.fora .dn { color: #a2a6b2; }
.dia.hoje { box-shadow: inset 0 0 0 2px var(--ink); }
.dn { font-size: 13px; font-weight: 700; color: var(--txt); padding: 2px; display: inline-flex; align-items: center; gap: 6px; }
.dia.hoje .dn b { background: var(--ink); color: #fff; border-radius: 99px; padding: 0 7px; }
.post { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 8px; background: #f5f5f8; text-decoration: none; color: var(--ink); min-width: 0; }
.post:hover { background: #ececf3; color: var(--ink); }
.post .pt { font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post .pm { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.fmt { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: #ececf1; color: var(--txt); flex: none; }
.fmt-reels, .fmt-video { background: #fde8d7; color: #8a3a0c; }
.fmt-carrossel { background: #e3e3fb; color: var(--accent-ink); }
.fmt-estatico, .fmt-grid { background: #e6f3ee; color: var(--ok); }
.fmt-story { background: #fde2ea; color: #9d174d; }
.fmt-capa { background: #e0f0fb; color: #075985; }
.st-late { background: var(--late) !important; }
.st-ok { background: #15803d !important; }
.dia .mais-dia { font-size: 12px; font-weight: 700; color: #4b4bc8; border: 0; background: none; padding: 2px; text-align: left; font-family: inherit; cursor: pointer; min-height: 24px; }
.dia.fechado .extra { display: none; }

/* ---- Tabelas (configuração) ----------------------------------- */
.table-wrap { overflow-x: auto; position: relative; } /* contém os .sr-only da tabela (senão vazam e criam rolagem lateral) */
.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tb th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tb td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tb tr.off td { color: var(--muted); }
.tb select, .tb input[type=text], .tb input[type=number] { min-height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font: inherit; font-size: 13.5px; color: var(--ink); }
.k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fl { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.ty { display: flex; align-items: center; min-height: 40px; padding: 0 12px 0 26px; border-radius: 8px; text-decoration: none; color: var(--txt); font-size: 13.5px; font-weight: 500; gap: 8px; }
.ty:hover { background: var(--hover); color: var(--ink); }
.ty.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.ty small { margin-left: auto; font-size: 12px; opacity: .8; }
.sim { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--bg); min-width: 118px; flex: 1 1 118px; }
.sim b { font-size: 14px; }
.sim span { font-size: 12px; color: var(--muted); }
.cfg-tabs { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Avisos --------------------------------------------------- */
.av-item { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.av-item:hover { background: #fafafb; color: var(--ink); }
.av-item.nova { background: #f7f7fe; }
.av-item .ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: #f2f2f6; color: var(--muted); }
.av-item.nova .ic { background: var(--accent-soft); color: var(--accent-ink); }
.av-item b { font-size: 14px; }
.av-item p { margin: 2px 0 0; font-size: 13.5px; color: var(--txt); line-height: 1.45; }
.sw-push { position: relative; width: 52px; height: 30px; border-radius: 999px; border: 0; background: #c9cdd8; cursor: pointer; flex: none; padding: 0; }
.sw-push::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px; background: #fff; transition: left .15s; }
.sw-push[aria-checked="true"] { background: var(--brand); }
.sw-push[aria-checked="true"]::after { left: 25px; }
.sw-push:disabled { opacity: .5; cursor: not-allowed; }
.passos { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; color: var(--txt); }

/* Faixa "instale o app" / "ative as notificações" */
.ins { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #e6e9f5; border-radius: 14px; padding: 12px 12px 12px 14px; box-shadow: 0 10px 30px rgba(22, 24, 29, .35); }
.ins img, .ins .ins-ic { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.ins .ins-ic { background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.ins .ins-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.4; }
.ins .ins-t strong { color: #fff; font-size: 14px; }
.ins .ins-t svg { width: 15px; height: 15px; vertical-align: -2px; }
.ins .ins-ok { min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ins .ins-x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #9aa2c0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
@media (min-width: 901px) { .ins { right: auto; left: 260px; bottom: 24px; max-width: 420px; } }

/* ---- Login ---------------------------------------------------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }

/* ---- Celular / tablet ---------------------------------------- */
@media (max-width: 900px) {
  .side { display: none; }
  .app { flex-direction: column; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: rgba(247, 247, 249, .92); backdrop-filter: blur(8px); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .sp { margin-left: auto; }
  .topbar .eu { width: 38px; height: 38px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
  .topbar .menu { right: 0; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding: 4px 6px calc(8px + env(safe-area-inset-bottom)); }
  .bottomnav a, .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; color: var(--muted); text-decoration: none; font: inherit; font-size: 11px; font-weight: 600; border: 0; background: none; cursor: pointer; }
  .bottomnav .on { color: var(--ink); }
  .bottomnav .plus { width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
  .bn-ic { position: relative; display: inline-flex; }
  .bn-dot { position: absolute; top: -5px; right: -9px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--red-dot); color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; }
  .main { padding: 8px 16px 104px; gap: 14px; }
  .page-head h1 { font-size: 24px; }
  .page-head .busca, .so-desk { display: none; }
  .tabs { gap: 4px; padding: 4px; background: #ececf1; border-radius: 10px; border: 0; }
  .tabs a { flex: 1; justify-content: center; min-height: 40px; border: 0; border-radius: 8px; margin: 0; font-size: 13.5px; padding: 0 4px; }
  .tabs a.on { background: #fff; box-shadow: 0 1px 2px rgba(22, 24, 29, .1); }
  .tabs a .c, .tabs a.on .c { background: none; color: inherit; padding: 0; }
  .item { padding: 12px 8px 12px 14px; }
  .item .mais-pop { display: none; }
  .gaveta { top: auto; left: 0; width: 100%; height: 88vh; border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(22, 24, 29, .18); }
  .gaveta::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: #d6d8e0; }
  .gaveta .g-top { padding: 18px 12px 10px 18px; }
  .gaveta .g-corpo { padding: 16px 18px; }
  .gaveta .g-pe { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .g-tit { font-size: 21px; }
  .janela { top: auto; bottom: 0; transform: translateX(-50%); width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .janela .j-pe { border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .col { width: 272px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ---- Cronômetro ---------------------------------------------- */
/* Popup central de criar/editar (dialog nativo; _popup.twig + app.js) */
.dlg { padding: 0; border: 0; width: min(560px, calc(100vw - 24px)); max-height: 86vh; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgba(22, 24, 29, .22); }
.dlg::backdrop { background: rgba(22, 24, 29, .38); }
.dlg-caixa { display: flex; flex-direction: column; max-height: 86vh; }
.dlg-top { display: flex; align-items: center; gap: 10px; padding: 18px 16px 4px 24px; }
.dlg-top h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.dlg-top .icb { margin-left: auto; }
.dlg-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
.dlg-corpo { overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 10px 24px 22px; }
.dlg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dlg-pe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px 12px 24px; border-top: 1px solid var(--line); background: #fbfbfc; border-radius: 0 0 16px 16px; }
.dlg-pe form { margin: 0; display: contents; }
.dlg-pe .dir { margin-left: auto; display: flex; gap: 8px; }
.cores { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.cores legend { padding: 0; margin-bottom: 8px; }
.cores label { cursor: pointer; display: inline-flex; }
.cores input:checked + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cores input:focus-visible + span { outline: 2px dashed var(--accent); outline-offset: 2px; }
@media (max-width: 900px) {
  .dlg { margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .dlg-caixa { max-height: 92vh; }
  .dlg-2 { grid-template-columns: 1fr; }
  .dlg-pe { border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* Popup flutuante (canto inferior direito). Some com gaveta/janela abertas. */
.crono-pop { position: fixed; right: 24px; bottom: 24px; z-index: 45; }
body.trava .crono-pop { display: none; }
.crono-cheio { width: 300px; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; background: #fff; border-radius: 16px; box-shadow: 0 16px 40px rgba(22, 24, 29, .16), 0 0 0 1px var(--line); }
.crono-topo { display: flex; align-items: center; gap: 8px; margin: -2px -6px -4px 0; }
.crono-rotulo { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); margin-right: auto; }
.crono-pop[data-estado="pausado"] .crono-rotulo { color: var(--muted); }
.crono-tempo { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.crono-grande { font-size: 30px; line-height: 1.1; color: var(--ink); }
.crono-tarefa { display: flex; flex-direction: column; gap: 1px; min-width: 0; text-decoration: none; color: var(--ink); }
.crono-tarefa b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crono-tarefa span { font-size: 12.5px; color: var(--muted); }
.crono-tarefa:hover b { text-decoration: underline; color: var(--ink); }
.crono-acoes { display: flex; gap: 8px; }
.crono-acoes .btn { flex: 1; }
.crono-pop[data-estado="rodando"] [data-crono-acao="retomar"], .crono-pop[data-estado="pausado"] [data-crono-acao="pausar"] { display: none; }
.crono-mini { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font: inherit; font-size: 14px; cursor: pointer; box-shadow: 0 10px 28px rgba(22, 24, 29, .25); }
.crono-mini .crono-luz { background: #8b8bf0; }
.crono-pop.minimizado .crono-cheio { display: none; }
.crono-pop.minimizado .crono-mini { display: inline-flex; }
.crono-pop[data-estado="pausado"] .crono-mini { background: #3d4150; }
.crono-luz { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); flex: none; }
.crono-pop[data-estado="rodando"] .crono-luz, .crono-chip.rodando .crono-luz { animation: crono-pulsa 1.4s ease-in-out infinite; }
.crono-pop[data-estado="pausado"] .crono-luz, .crono-chip.pausado .crono-luz { background: #a2a6b2; animation: none; }
@keyframes crono-pulsa { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .crono-luz { animation: none !important; } }
/* Aviso rápido não encosta no cronômetro: no computador vai um pouco para a esquerda;
   no celular sobe acima da pílula do cronômetro. */
body:has(.crono-pop:not([hidden]):not(.minimizado)) .toast { left: calc(50% - 170px); }
@media (max-width: 900px) {
  .crono-pop { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .crono-cheio { width: min(300px, calc(100vw - 24px)); }
  body:has(.crono-pop:not([hidden])) .toast { left: 50%; bottom: calc(132px + env(safe-area-inset-bottom)); }
}
/* Gaveta: "Iniciar" quando não roda aqui; relógio + botões quando roda nesta tarefa */
.crono-chip { display: flex; align-items: center; }
.crono-chip .crono-iniciar { min-height: 32px; }
.crono-chip .crono-iniciar .meta { font-size: 12px; font-weight: 600; }
.crono-chip .crono-aqui { display: none; align-items: center; gap: 2px; min-height: 34px; padding: 0 2px 0 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); }
.crono-chip .crono-aqui .crono-tempo { margin-left: 6px; margin-right: 2px; }
.crono-chip .crono-bt { width: 30px; height: 30px; color: inherit; }
.crono-chip.aqui .crono-iniciar { display: none; }
.crono-chip.aqui .crono-aqui { display: inline-flex; }
.crono-chip.pausado .crono-aqui { background: #f2f2f6; color: var(--txt); }
.crono-chip.rodando [data-crono-acao="retomar"], .crono-chip.pausado [data-crono-acao="pausar"] { display: none; }
