/* DIN FEU, a fonte da FEU Arquitetura (03-Recursos/Fontes_FEU). Letra que faltar na fonte cai na do sistema. */
@font-face { font-family: "DIN FEU"; font-weight: 300; font-style: normal; font-display: swap; src: url("fonts/DINFeu-Light.woff2") format("woff2"); }
@font-face { font-family: "DIN FEU"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/DINFeu-Regular.woff2") format("woff2"); }
@font-face { font-family: "DIN FEU"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/DINFeu-Medium.woff2") format("woff2"); }
@font-face { font-family: "DIN FEU"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/DINFeu-Bold.woff2") format("woff2"); }
@font-face { font-family: "DIN FEU"; font-weight: 900; font-style: normal; font-display: swap; src: url("fonts/DINFeu-Black.woff2") format("woff2"); }

/*
 * CRM da Curva: estilos (base copiada do Tarefas da Curva v1.21; as classes de tarefa que sobraram são inofensivas).
 * Base nas Human Interface Guidelines da Apple: cores semânticas com variante clara e escura,
 * materiais translúcidos só na navegação (barra lateral, topo, menus), conteúdo em superfícies sólidas,
 * fonte do sistema, áreas de toque de 44 pt e nenhum estado indicado só por cor.
 * Marca: laranja Curva (#FF5F34) é a cor de ação; azul Curva (#006DF6) é a cor de link.
 */

/* ================================================================ cores e medidas */

:root {
  --accent: #FF5F34;
  --accent-press: #E64E26;
  --accent-text: #D9481F;            /* laranja legível como texto sobre fundo claro */
  --accent-tint: rgba(255, 95, 52, .12);
  --link: #006DF6;
  --link-tint: rgba(0, 109, 246, .10);
  --green: #28A745;
  --green-tint: rgba(40, 167, 69, .13);
  --red: #E5383B;
  --red-tint: rgba(229, 56, 59, .11);
  --yellow: #F5B301;

  --bg: #F5F5F7;                     /* janela */
  --surface: #FFFFFF;                /* cartões, tabelas, janelas */
  --surface-2: #F2F2F5;              /* agrupado dentro de cartão */
  --surface-3: #FAFAFC;
  --field: #FFFFFF;                  /* fundo de campo de texto */
  --fill: rgba(118, 118, 128, .12);  /* fundo de controle (botão cinza, trilho) */
  --fill-2: rgba(118, 118, 128, .08);
  --hover: rgba(0, 0, 0, .045);
  --press: rgba(0, 0, 0, .08);
  --separator: rgba(60, 60, 67, .13);
  --border: rgba(60, 60, 67, .16);
  --border-strong: rgba(60, 60, 67, .26);

  --text: #1D1D1F;
  --text-2: #48484D;
  --muted: #86868B;
  --placeholder: #A1A1A6;

  --material: rgba(246, 246, 248, .78);      /* barra lateral */
  --material-bar: rgba(255, 255, 255, .78);  /* barra do topo e de abas */
  --material-pop: rgba(255, 255, 255, .86);  /* menus e popovers */
  --blur: saturate(180%) blur(20px);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .04);
  --shadow: 0 2px 6px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .12), 0 30px 80px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .08);
  --ring: 0 0 0 3.5px rgba(255, 95, 52, .28);

  --warn-bg: #FFF6E0; --warn-text: #7A5300; --warn-border: rgba(245, 179, 1, .45);

  --radius-s: 7px;
  --radius: 10px;
  --radius-l: 14px;
  --radius-xl: 18px;
  --sidebar: 260px;
  --topbar: 54px;

  /* nomes antigos (usados pelos módulos): ficam ligados às cores novas */
  --orange: var(--accent);
  --orange-h: var(--accent-press);
  --blue: var(--link);
  --ok: var(--green);
  --err: var(--red);
  --dark: #1D1D1F;

  color-scheme: light;
}

/* Escuro: segue o sistema, a não ser que a pessoa tenha escolhido Clara nas Preferências. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #FF6A42; --accent-press: #FF7F5C; --accent-text: #FF8A66; --accent-tint: rgba(255, 106, 66, .18);
    --link: #3D8EFF; --link-tint: rgba(61, 142, 255, .16);
    --green: #30D158; --green-tint: rgba(48, 209, 88, .18);
    --red: #FF5257; --red-tint: rgba(255, 82, 87, .16);
    --yellow: #FFD60A;
    --bg: #111113; --surface: #1C1C1E; --surface-2: #242427; --surface-3: #202023; --field: #2C2C2E;
    --fill: rgba(118, 118, 128, .26); --fill-2: rgba(118, 118, 128, .16);
    --hover: rgba(255, 255, 255, .06); --press: rgba(255, 255, 255, .1);
    --separator: rgba(255, 255, 255, .09); --border: rgba(255, 255, 255, .12); --border-strong: rgba(255, 255, 255, .2);
    --text: #F5F5F7; --text-2: #C7C7CC; --muted: #8E8E93; --placeholder: #6C6C70;
    --material: rgba(30, 30, 32, .74); --material-bar: rgba(28, 28, 30, .74); --material-pop: rgba(44, 44, 46, .88);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 .5px rgba(255, 255, 255, .06);
    --shadow: 0 2px 8px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5), 0 40px 90px rgba(0, 0, 0, .45), 0 0 0 .5px rgba(255, 255, 255, .12);
    --ring: 0 0 0 3.5px rgba(255, 106, 66, .38);
    --warn-bg: #3A2E10; --warn-text: #FFD98A; --warn-border: rgba(255, 214, 10, .3);
    --dark: #2C2C2E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #FF6A42; --accent-press: #FF7F5C; --accent-text: #FF8A66; --accent-tint: rgba(255, 106, 66, .18);
  --link: #3D8EFF; --link-tint: rgba(61, 142, 255, .16);
  --green: #30D158; --green-tint: rgba(48, 209, 88, .18);
  --red: #FF5257; --red-tint: rgba(255, 82, 87, .16);
  --yellow: #FFD60A;
  --bg: #111113; --surface: #1C1C1E; --surface-2: #242427; --surface-3: #202023; --field: #2C2C2E;
  --fill: rgba(118, 118, 128, .26); --fill-2: rgba(118, 118, 128, .16);
  --hover: rgba(255, 255, 255, .06); --press: rgba(255, 255, 255, .1);
  --separator: rgba(255, 255, 255, .09); --border: rgba(255, 255, 255, .12); --border-strong: rgba(255, 255, 255, .2);
  --text: #F5F5F7; --text-2: #C7C7CC; --muted: #8E8E93; --placeholder: #6C6C70;
  --material: rgba(30, 30, 32, .74); --material-bar: rgba(28, 28, 30, .74); --material-pop: rgba(44, 44, 46, .88);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 .5px rgba(255, 255, 255, .06);
  --shadow: 0 2px 8px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5), 0 40px 90px rgba(0, 0, 0, .45), 0 0 0 .5px rgba(255, 255, 255, .12);
  --ring: 0 0 0 3.5px rgba(255, 106, 66, .38);
  --warn-bg: #3A2E10; --warn-text: #FFD98A; --warn-border: rgba(255, 214, 10, .3);
  --dark: #2C2C2E;
  color-scheme: dark;
}

/* Aumentar contraste (ajuste do sistema): separadores e textos secundários mais fortes. */
@media (prefers-contrast: more) {
  :root { --separator: rgba(60, 60, 67, .3); --border: rgba(60, 60, 67, .4); --text-2: #2C2C30; --muted: #5E5E63; }
}
/* Reduzir transparência: materiais viram sólidos. */
@media (prefers-reduced-transparency: reduce) {
  :root { --material: var(--surface-2); --material-bar: var(--surface); --material-pop: var(--surface); --blur: none; }
}

/* Logo: versão clara e escura */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline-block; }
}

/* ================================================================ base */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  font-family: "DIN FEU", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.43; letter-spacing: -.006em; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv11", "ss01";
}
body.noscroll { overflow: hidden; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -.022em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 650; letter-spacing: -.012em; }
h3 { font-size: 14px; margin: 0; font-weight: 650; letter-spacing: -.008em; color: var(--text); }
kbd { font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; }
:focus-visible { outline: none; box-shadow: var(--ring); }
.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.pad { padding: 12px; }
.pad-x { padding: 6px 12px 10px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-center { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-gap.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.ok-text { color: var(--green); }
.err-text { color: var(--red); }
.ghost-text { color: var(--placeholder); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); gap: 12px; }
.boot-logo { border-radius: 14px; box-shadow: var(--shadow); animation: boot-pulse 1.4s ease-in-out infinite; }
@keyframes boot-pulse { 50% { opacity: .55; } }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 15px; }

/* ================================================================ botões e campos */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: var(--radius-s); border: 0;
  background: var(--fill); color: var(--text); font: inherit; font-weight: 590; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background .12s, box-shadow .12s, transform .06s;
}
.btn:hover { background: color-mix(in srgb, var(--fill) 100%, var(--press)); }
.btn:active { transform: scale(.98); }
.btn .icon { opacity: .9; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(255, 95, 52, .25); }
.btn.primary:hover { background: var(--accent-press); }
.btn.success { background: var(--green); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; height: 44px; font-size: 15px; border-radius: var(--radius); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.active { background: var(--accent-tint); color: var(--accent-text); }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-s); border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; flex: none; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: var(--press); }
.icon-btn.on { color: var(--accent); }
.icon-btn.star-btn.on { color: var(--yellow); }
.icon-btn.star-btn.on svg { fill: var(--yellow); }
.fav-task.closed .nav-label { color: var(--muted); }
.icon-btn.tiny { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn.primary-icon { background: var(--accent); color: #fff; border-radius: 50%; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 6px 4px; border-radius: 6px; }
.link-btn:hover { background: var(--link-tint); }
.link-btn.small { font-size: 13px; }

.input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--field); color: var(--text); font: inherit; font-size: 14px; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--placeholder); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .tv-title:focus, .add-input:focus, .top-search:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input.compact { height: 30px; width: auto; max-width: 220px; font-size: 13px; }
.input.big { height: 46px; font-size: 16px; border: 0; background: transparent; }
.input.date { width: auto; min-width: 150px; }
select.input {
  padding-right: 28px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.color { width: 32px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 7px; background: none; cursor: pointer; flex: none; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 590; }
.field > small { line-height: 1.4; }
.form { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; white-space: nowrap; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Controle segmentado (trilho cinza, botão escolhido em relevo) */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--fill); flex: none; }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 510; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.seg button:hover:not(.on) { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }
.seg.seg-lg button { height: 34px; padding: 0 16px; font-size: 14px; }

/* ================================================================ moldura: barra lateral e topo */

.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40; display: flex; flex-direction: column; overflow-y: auto;
  background: var(--material); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-right: 1px solid var(--separator); color: var(--text); padding-bottom: env(safe-area-inset-bottom);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; text-decoration: none !important; color: var(--text); }
.brand img { height: 26px; width: auto; }
.brand-app { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--border); line-height: 18px; }
.nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 5px 10px; border-radius: var(--radius-s); color: var(--text);
  text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; transition: background .1s;
}
.nav-item .icon { color: var(--muted); }
.nav-item span { overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-tint); color: var(--accent-text); font-weight: 600; }
.nav-item.active .icon { color: var(--accent); }
.nav-section { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 4px; font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.nav-section .icon-btn { color: var(--muted); width: 24px; height: 24px; }
.spaces { padding: 0 10px 12px; flex: 1; }
.space { margin-bottom: 2px; }
.space-head {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 5px 10px; border: 0; background: none; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius-s); text-align: left; user-select: none;
}
.space-head:hover { background: var(--hover); }
.space-head > .icon:last-child { color: var(--muted); transition: transform .18s; }
.space-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none !important; }
.space-name:hover { text-decoration: none !important; }
.space-name.active, .folder-name.active { color: var(--accent-text); }
.space-dot { width: 10px; height: 10px; border-radius: 3.5px; flex: none; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.space.collapsed .space-lists { display: none; }
.space.collapsed .space-head > .icon:last-child { transform: rotate(-90deg); }
.space-lists { padding-left: 12px; }
.space-lists .nav-item { min-height: 30px; padding: 4px 10px; font-size: 13.5px; }
.favs { padding: 0 10px; }
.fav-item { min-height: 30px; padding: 4px 10px; font-size: 13.5px; }
.fav-item > .icon { color: var(--yellow) !important; }
.fav-item.fill > .icon { fill: var(--yellow); }
.fav-task:not(.custom-icon) > .icon { color: var(--muted) !important; }
.fav-item.dragging { opacity: .45; }
.fav-item.fav-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.fav-item.fav-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.icon-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 4px 0 8px; }
.icon-choice { display: grid; place-items: center; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; }
.icon-choice:hover { background: var(--hover); color: var(--text); }
.icon-choice.on { background: var(--accent-tint); color: var(--accent-text, var(--accent)); }
.pad-s { padding: 4px 8px 6px; }
.fav-item .nav-label { flex: 1; min-width: 0; }
.fav-where { flex: none; max-width: 84px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.folder-head { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 8px; border-radius: var(--radius-s); color: var(--text); font-size: 13.5px; cursor: pointer; user-select: none; }
.folder-head:hover { background: var(--hover); }
.folder-head .icon { color: var(--muted); }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none !important; }
.folder-head:hover .space-more { opacity: 1; }
.folder-lists { padding-left: 14px; }
.folder-empty { padding: 4px 10px; font-size: 12px; color: var(--muted); }
.space-more { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px 4px; border-radius: 6px; display: inline-grid; place-items: center; opacity: 0; flex: none; transition: opacity .12s; }
.space-head:hover .space-more, .nav-item:hover .space-more, .space-more:focus-visible { opacity: 1; }
.space-more:hover { background: var(--press); color: var(--text); }
.add-list { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 4px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; border-radius: var(--radius-s); text-align: left; }
.add-list:hover { background: var(--hover); color: var(--text); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rename-input { font: inherit; font-size: inherit; font-weight: inherit; color: var(--text); background: var(--field); border: 1px solid var(--accent); box-shadow: var(--ring); border-radius: 6px; padding: 1px 6px; min-width: 0; width: 100%; outline: none; }
.top-title .rename-input { font-size: 19px; font-weight: 700; max-width: 360px; }
.sidebar-foot { padding: 8px 10px; border-top: 1px solid var(--separator); }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 550; cursor: pointer; border-radius: var(--radius); }
.me-btn:hover { background: var(--hover); }
.me-btn > .icon { color: var(--muted); }
.me-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 20px;
  background: var(--material-bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--separator);
}
.top-title { display: flex; align-items: center; gap: 4px; min-width: 150px; flex: 1 1 auto; overflow: hidden; }
.top-title > * { flex: none; }
.top-title > .crumbs, .top-title > h1 { flex: 0 1 auto; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.top-search-wrap { position: relative; display: flex; align-items: center; color: var(--muted); }
.top-search-wrap > .icon { position: absolute; left: 10px; pointer-events: none; }
.top-search-wrap > kbd { position: absolute; right: 8px; pointer-events: none; }
.top-search { width: 230px; height: 32px; border: 0; border-radius: var(--radius-s); padding: 0 30px 0 32px; background: var(--fill); color: var(--text); font: inherit; }
.top-search::placeholder { color: var(--muted); }
.top-search:focus + kbd { display: none; }
.content { flex: 1; padding: 20px 24px 32px; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.crumbs h1 { min-width: 70px; flex: 0 1 auto; }
.crumb-space { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 100 auto; min-width: 0; }
.crumb-space.muted { color: var(--muted); font-weight: 500; }
.crumb-sep { color: var(--placeholder); font-weight: 400; }
.scrim { display: none; }
.only-mobile, .only-xs { display: none !important; }
.ro-badge { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--fill); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; flex: none; font-variant-numeric: tabular-nums; }
.bell-btn { position: relative; }
.badge.top { position: absolute; top: 1px; right: -1px; transform: scale(.85); box-shadow: 0 0 0 2px var(--material-bar); }
.color.big { width: 80px; height: 48px; }

/* ================================================================ peças */

.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 650; flex: none; letter-spacing: -.02em; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.avatar.more { background: var(--fill); color: var(--text-2); font-size: 10px; }
.avatar.bot { width: 28px; height: 28px; background: var(--link); }
.avatars { display: inline-flex; flex: none; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }
/* Foto de perfil no lugar das iniciais */
.avatar { position: relative; overflow: hidden; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.has-photo { color: transparent; }
.avatar.symbol { background: var(--fill); color: var(--text-2); }
.avatar.add { background: none; color: var(--placeholder); box-shadow: inset 0 0 0 1.5px currentColor; border: 0; }
/* Seletor de pessoas (o mesmo em todo o app) */
.people-pick { border: 0; background: none; font: inherit; color: var(--text-2); cursor: pointer; padding: 3px 5px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; min-height: 30px; flex-wrap: wrap; text-align: left; max-width: 100%; }
.people-pick:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.people-pick:hover:not(:disabled) .avatar.add { color: var(--accent); }
.people-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.people-pick .person { margin-right: 4px; color: var(--text); }
.people-pick .people-empty { display: inline-flex; align-items: center; gap: 6px; color: var(--placeholder); }
.people-pick.boxed { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; min-height: 36px; background: var(--surface); }
.people-inline { max-height: 220px; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
.photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Status: cápsula tingida com a cor do status; o nome corta com reticências se a coluna for estreita. */
.pill {
  --c: #8E8E93;
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 12px; border: 0;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 68%, var(--text));
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: default; max-width: 100%; min-width: 0;
}
.pill-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
button.pill { cursor: pointer; transition: background .12s; }
button.pill:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.tag {
  --c: #8E8E93;
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--text));
}
.tag-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; opacity: .7; }
.tag-x:hover { opacity: 1; }
.fchip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; margin-right: 4px; white-space: nowrap; }
.fval { font-size: 12px; color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fval b { font-weight: 600; color: var(--muted); }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.late { color: var(--red); font-weight: 600; }
.due.today { color: var(--accent-text); font-weight: 600; }
.meta-count { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mention { color: var(--link); font-weight: 600; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: var(--radius); margin: 0 0 12px; font-size: 13.5px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.banner.info { background: var(--link-tint); color: var(--text); border: 1px solid color-mix(in srgb, var(--link) 22%, transparent); }
.banner.ok { background: var(--green-tint); color: var(--text); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); }
.banner .icon { display: inline; vertical-align: -3px; }
/* Celular: texto do aviso em cima, botão embaixo (antes o texto ficava espremido ao lado do botão). */
@media (max-width: 640px) { .banner { flex-wrap: wrap; } .banner > span { flex: 1 1 100%; } }
.flip svg { transform: rotate(180deg); }
.danger-text { color: var(--red) !important; }
.formula-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.fchips { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.labels-btn { flex-wrap: wrap; gap: 4px; }
.on-repeat { color: var(--link); font-weight: 600; }
.open-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.meta-count.open-c { color: var(--accent-text); font-weight: 600; }
/* Número da numeração automática */
.an-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--fill); color: var(--text); font: 650 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }

/* switch liga/desliga (como no iPhone) */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: default; }
.switch-ui { position: absolute; inset: 0; border-radius: 11px; background: var(--fill); transition: background .2s; }
.switch-ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .05); transition: transform .2s cubic-bezier(.3, .7, .4, 1); }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:disabled + .switch-ui { opacity: .5; }
.switch input:focus-visible + .switch-ui { box-shadow: var(--ring); }

/* ================================================================ quadro e cartões */

.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; min-height: calc(100vh - var(--topbar) - 140px); scroll-snap-type: x proximity; }
.col { flex: 0 0 292px; background: var(--fill-2); border-radius: var(--radius-l); display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar) - 140px); scroll-snap-align: start; }
.col-head { --c: #8E8E93; display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-weight: 650; font-size: 13.5px; }
.col-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-count { color: var(--muted); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.col-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 10px; overflow-y: auto; min-height: 60px; }
.col-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 14px 6px; border: 1px dashed var(--border); border-radius: var(--radius); }
.col-add { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; border-radius: var(--radius); }
.col-add:hover { background: var(--surface); color: var(--text); }
.col-closed .card { opacity: .82; }
.my-board .col-late .col-head { color: var(--red); }
.my-board .col-today .col-head { color: var(--accent-text); }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 7px; transition: box-shadow .15s, transform .15s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.card:hover { box-shadow: var(--shadow); }
.card:focus-visible { box-shadow: var(--ring); }
.card.closed .card-title { color: var(--muted); }
.card-title { font-weight: 560; word-break: break-word; line-height: 1.35; }
.card-path { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-parent { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tags, .card-fields { display: flex; flex-wrap: wrap; gap: 4px; }
.card-fields { flex-direction: column; gap: 2px; }
.card-fields .fchip { align-self: flex-start; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.card-input { min-height: 60px; }
.drag-ghost { position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none; box-shadow: var(--shadow-lg); opacity: .96; transform: rotate(1deg); }
.drag-source { opacity: .35; }
.drag-placeholder { border: 2px dashed color-mix(in srgb, var(--link) 45%, transparent); border-radius: var(--radius); background: var(--link-tint); flex: none; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.quick-add { display: flex; align-items: center; gap: 8px; background: var(--surface); box-shadow: var(--shadow-sm); border-radius: var(--radius); padding: 6px 6px 6px 12px; margin-bottom: 16px; color: var(--muted); }
.quick-add .input { border: 0; height: 34px; background: transparent; box-shadow: none; }

/* ================================================================ lista */

.views-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: -4px 0 14px; }
.vtab { display: inline-flex; align-items: center; height: 30px; padding: 0 4px; border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 510; cursor: pointer; border-radius: 8px; }
button.vtab { padding: 0 12px; }
.vtab.on { color: var(--text); font-weight: 650; background: var(--surface); box-shadow: var(--shadow-sm); }
.vtab-name { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0 8px; height: 30px; }
.vtab-more { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 5px; display: inline-grid; place-items: center; }
.vtab:hover:not(.on) { color: var(--text); background: var(--hover); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filters .input[type=search] { width: 230px; }
.filters .check { font-size: 13px; color: var(--text-2); }
.field-filters { display: flex; flex-direction: column; gap: 6px; margin: -6px 0 14px; }
.field-filters:empty { display: none; }
.ffilter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-desc { color: var(--text-2); margin: -4px 0 14px; white-space: pre-wrap; max-width: 820px; }
.ltable-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-sm); }
.ltable { min-width: max-content; }
.lrow { display: grid; grid-template-columns: var(--cols); align-items: center; border-bottom: 1px solid var(--separator); min-height: 40px; }
.lrow:hover:not(.lhead):not(.ladd):not(.lmore) { background: var(--hover); }
.lhead { font-size: 12px; color: var(--muted); font-weight: 600; min-height: 36px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.lhead > div { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lhcell { position: relative; display: flex; align-items: center; align-self: stretch; min-width: 0; }
.lhlabel { overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.lhbtn { border: 0; background: none; font: inherit; color: inherit; padding: 4px 6px; margin-left: -6px; border-radius: 6px; cursor: pointer; max-width: 100%; }
.lhbtn .icon { opacity: 0; transition: opacity .12s; }
.lhcell:hover .lhbtn .icon, .lhbtn:focus-visible .icon { opacity: .8; }
.lhbtn:hover { background: var(--hover); color: var(--text); }
.lhadd { justify-content: center; }
.col-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 1; }
.col-resize::after { content: ''; position: absolute; top: 9px; bottom: 9px; right: 3px; width: 2px; border-radius: 1px; background: transparent; }
.lhcell:hover .col-resize::after { background: var(--border); }
.col-resize:hover::after, body.col-resizing .col-resize::after { background: var(--accent) !important; }
body.col-resizing { cursor: col-resize; user-select: none; }
/* Nenhuma célula passa da largura da coluna: o que sobra corta com reticências. */
.lcell { padding: 4px 8px; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.lcell > .cell-btn { max-width: 100%; overflow: hidden; }
.ltitle { gap: 6px; flex-wrap: nowrap; overflow: visible; }
/* Nome, contadores e tags num bloco só ao lado da setinha: o nome quebra dentro do bloco e toda linha começa no mesmo ponto
   (antes, nome comprido pulava para baixo da setinha e ficava desalinhado dos curtos). */
.ltitle-main { flex: 1 1 0; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.ltitle-main > .tlink { min-width: 0; }
.tlink { color: var(--text); font-weight: 450; word-break: break-word; cursor: pointer; }
.tlink:hover { color: var(--link); text-decoration: none; }
.lrow.closed .tlink { color: var(--muted); }
.lfield { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 32px; }
.lgroup-wrap { position: relative; }
.lgroup { border-bottom: 1px solid var(--separator); background: var(--surface-3); position: sticky; left: 0; }
.lgroup-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 0; background: none; font: inherit; cursor: pointer; color: var(--muted); border-radius: 8px; }
.lgroup-head:hover { color: var(--text); }
.lgroup.has-sel { display: flex; align-items: center; }
.lgroup-sel { flex: none; width: 28px; display: grid; place-items: center; }
.lgroup-sel input { opacity: 0; margin: 0; }
.lgroup:hover .lgroup-sel input, .ltable.selecting .lgroup-sel input, .lgroup-sel input:focus, .lgroup-sel input:checked, .lgroup-sel input:indeterminate { opacity: 1; }
.lgroup.has-sel .lgroup-head { padding-left: 4px; }
.lgroup-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lrow.ltop { cursor: default; }
.ladd { min-height: 38px; }
.lmore { min-height: 44px; }
.add-input { width: 100%; height: 30px; border: 0; background: none; color: var(--text); font: inherit; padding: 0 6px; border-radius: 6px; }
.add-input::placeholder { color: var(--placeholder); }
.caret { border: 0; background: none; padding: 2px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; border-radius: 5px; }
.caret:hover { background: var(--hover); color: var(--text); }
.caret-space { width: 18px; flex: none; }
/* Bolinha de concluir (como no app Lembretes). Tarefa concluída fica cinza, sem risco: continua fácil de ler. */
.chk { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: transparent; color: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; flex: none; transition: background .15s, border-color .15s, color .15s; }
.chk:hover { border-color: var(--green); color: var(--green); }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; }
.chk:disabled { cursor: default; opacity: .6; }
.cell-btn { border: 0; background: none; font: inherit; color: var(--text-2); cursor: pointer; padding: 4px 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-btn:hover { background: var(--hover); color: var(--text); }
.cell-btn.late { color: var(--red); font-weight: 600; }
.cell-btn.wide { flex-wrap: wrap; white-space: normal; text-align: left; }
.row-mobile-meta { display: none; }
.lsel { justify-content: center; }
.lsel input { opacity: 0; }
.lrow:hover .lsel input, .ltable.selecting .lsel input, .lsel input:focus, .lhead .lsel input { opacity: 1; }
.lrow.selected { background: var(--accent-tint) !important; }
/* janela de colunas */
.pop-title { font-weight: 650; padding: 12px 14px 6px; }
.cols-pick-items { max-height: 380px; overflow-y: auto; padding: 0 6px 6px; }
.cols-pick-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.cols-pick-item:hover { background: var(--hover); }
.cols-pick-item > .icon { color: var(--muted); }
.cols-pick > .pick-item.create { margin: 0 6px; width: calc(100% - 12px); }

/* barra de edição em lote */
.bulk-bar {
  position: fixed; bottom: 22px; left: 0; right: 0; margin: 0 auto; width: fit-content; transform: translateY(170%); z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  max-width: calc(100vw - 32px); padding: 6px 8px; background: rgba(29, 29, 31, .92); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); transition: transform .25s cubic-bezier(.3, .7, .4, 1); pointer-events: none;
}
.bulk-bar:not(.on) { opacity: 0; visibility: hidden; transition: transform .25s, opacity .2s, visibility 0s .25s; }
.bulk-bar.on { transform: none; pointer-events: auto; }
.bulk-bar > b { padding: 0 10px 0 6px; white-space: nowrap; font-weight: 650; }
.bulk-bar .btn.ghost { color: #F5F5F7; background: transparent; }
.bulk-bar .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.bulk-bar .icon-btn { color: #D1D1D6; }
.bulk-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ================================================================ janelas, menus e avisos */

.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 16px; overflow-y: auto;
  background: rgba(0, 0, 0, .3); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in .16s ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  display: flex; flex-direction: column; max-height: 86vh; animation: pop-in .2s cubic-bezier(.3, .7, .4, 1);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal.small { max-width: 420px; }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 14px 6px 22px; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 8px 22px 18px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; flex-wrap: wrap; }
.modal-actions .btn { min-width: 92px; height: 34px; }
.json { background: var(--surface-2); padding: 12px; border-radius: var(--radius); overflow: auto; font-size: 12px; max-height: 60vh; }

.popover {
  position: fixed; z-index: 200; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-lg);
  background: var(--material-pop); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: pop-in .14s ease;
}
.popover.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100% !important; border-radius: 16px 16px 0 0; max-height: 72vh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 199; }
.menu { padding: 5px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 10px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; border-radius: 7px; text-align: left; }
.menu-item > .icon:first-child { color: var(--text-2); }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item:hover .icon { color: #fff !important; }
.menu-item.danger, .menu-item.danger .icon { color: var(--red); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-sep { height: 1px; background: var(--separator); margin: 5px 8px; }
.menu-head { padding: 6px 10px 2px; font-size: 12px; font-weight: 650; color: var(--muted); }
.pick { display: flex; flex-direction: column; }
.pick > .input { border: 0; border-bottom: 1px solid var(--separator); border-radius: 0; height: 42px; background: transparent; box-shadow: none; padding: 0 14px; }
.pick-items { max-height: 320px; overflow-y: auto; padding: 5px; }
.pick-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; border-radius: 7px; text-align: left; }
.pick-item:hover { background: var(--hover); }
.pick-item.on { font-weight: 600; }
.pick-item.on .icon { color: var(--accent); }
.pick-item.create { color: var(--link); justify-content: flex-start; }

#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; padding-bottom: env(safe-area-inset-bottom); }
.toast {
  background: rgba(29, 29, 31, .92); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; padding: 10px 18px; border-radius: 22px;
  box-shadow: var(--shadow-lg); max-width: 90vw; font-weight: 520; transition: opacity .3s, transform .3s; animation: pop-in .2s ease;
}
.toast.error { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }
.lightbox-modal { max-width: min(1400px, 96vw); background: transparent; box-shadow: none; }
.lightbox-modal .modal-body { padding: 0; display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: var(--radius); box-shadow: var(--shadow-lg); display: block; background: #fff; }

/* ================================================================ tarefa aberta */

.task-modal { max-width: 1160px; height: 88vh; max-height: 88vh; overflow: hidden; }
.task-modal .modal-body { padding: 0; height: 100%; overflow: hidden; display: flex; }
.task-view { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.task-view.dropping { box-shadow: inset 0 0 0 3px var(--accent); }
.tv-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 22px; border-bottom: 1px solid var(--separator); }
.tv-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.tv-crumbs a { color: var(--text-2); }
.tv-head-actions { display: flex; gap: 2px; }
.task-id { border: 0; background: var(--fill); color: var(--text-2); border-radius: 6px; padding: 2px 7px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; cursor: pointer; }
.task-id:hover { background: var(--link-tint); color: var(--link); }
.tv-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 390px; min-height: 0; }
.tv-main { overflow-y: auto; padding: 22px 30px 48px; }
.tv-side { border-left: 1px solid var(--separator); display: flex; flex-direction: column; min-height: 0; background: var(--surface-3); }
.tv-title { width: 100%; border: 0; background: none; font: inherit; font-size: 24px; font-weight: 700; letter-spacing: -.022em; color: var(--text); resize: none; padding: 4px 8px; margin: 0 -8px 14px; border-radius: var(--radius-s); overflow: hidden; line-height: 1.25; }
.tv-title:hover { background: var(--hover); }
.props { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; margin-bottom: 8px; }
.prop { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; min-height: 38px; gap: 8px; }
.prop-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.prop-value { min-width: 0; }
.prop-status { grid-column: 1 / -1; min-height: 50px; }
.pill.big { height: 34px; padding: 0 16px 0 12px; border-radius: 17px; gap: 8px; font-size: 15px; }
.pill.big .dot { width: 10px; height: 10px; }
.prop-status .st-step { height: 34px; }
.chk.tv-done { margin-left: 10px; }
.prop-value .input:not(.date):not(.compact) { height: 32px; }
.prop-value .input.date, .prop-value select.input.compact { border-color: transparent; background-color: var(--fill-2); }
.prop-value .input.date:hover, .prop-value select.input.compact:hover { background-color: var(--fill); }
.person { display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; }
.tags-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mini-add { width: 24px; height: 22px; border: 1px dashed var(--border-strong); border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.mini-add:hover { border-style: solid; color: var(--text); }
.tv-section { margin-top: 26px; }
.tv-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; min-height: 30px; }
.tv-section-head h3 { display: inline-flex; align-items: baseline; gap: 8px; font-size: 15px; }
.sec-count { font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.desc { white-space: normal; word-break: break-word; padding: 8px 10px; margin: 0 -10px; border-radius: var(--radius-s); cursor: text; display: block; width: calc(100% + 20px); text-align: left; font: inherit; line-height: 1.55; color: var(--text); border: 0; background: none; }
.desc:hover { background: var(--hover); }
.empty-desc { color: var(--placeholder); }
.desc-edit { min-height: 160px; margin-bottom: 8px; }

/* Campos personalizados: bloco próprio, como uma lista agrupada do iPhone */
.fields-card { background: var(--surface-3); border: 1px solid var(--separator); border-radius: var(--radius-l); padding: 4px 14px; }
.fgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
.frow { display: flex; align-items: center; gap: 10px; min-height: 42px; border-bottom: 1px solid var(--separator); min-width: 0; }
.frow-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 0; flex: 0 0 38%; max-width: 200px; }
.frow-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow-label .icon { flex: none; opacity: .85; }
.frow-value { min-width: 0; flex: 1; }
.frow-value .input { height: 32px; border-color: transparent; background-color: transparent; }
.frow-value .input:hover { background-color: var(--fill-2); }
.frow-value .input:focus { background-color: var(--field); border-color: var(--accent); }
.frow-value textarea.input { height: auto; }
.frow.is-empty .frow-value .input::placeholder { color: var(--placeholder); }
.fgroup { border-top: 1px solid var(--separator); }
.fgroup:first-child { border-top: 0; }
.fgroup > summary { display: flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; list-style: none; user-select: none; font-weight: 650; }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary > .icon { color: var(--muted); transition: transform .18s; }
.fgroup[open] > summary > .icon { transform: rotate(90deg); }
.fgroup-name { flex: 1; }
.fgroup-count { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.fgrid .frow:nth-last-child(-n+2) { border-bottom: 0; }
.fgroup > .fgrid { padding-bottom: 4px; }
.fields-none { padding: 14px 0; }
.fields-new { margin: 4px 0 6px -4px; }
.fields-toggle .icon { opacity: .9; }
/* editor da numeração automática */
.an-card { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 16px 18px; border-radius: var(--radius-l); background: linear-gradient(135deg, var(--accent-tint), var(--link-tint)); }
.an-card-text { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; }
.an-big { font: 750 40px/1.05 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; color: var(--text); }
.an-card-form { display: grid; grid-template-columns: 120px 120px; gap: 10px; }
.an-rules { display: flex; flex-direction: column; border: 1px solid var(--separator); border-radius: var(--radius-l); overflow: hidden; background: var(--surface); }
.an-rule { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-top: 1px solid var(--separator); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.an-rule:first-child { border-top: 0; }
.an-rule:hover { background: var(--hover); }
.an-rule-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--fill); color: var(--text-2); flex: none; }
.an-rule.on .an-rule-icon { background: var(--accent); color: #fff; }
.an-rule-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.an-radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; }
.an-rule.on .an-radio { border: 6px solid var(--accent); }
.an-statuses { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 14px 58px; }
.an-status { --c: #8E8E93; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.an-status:hover { border-color: var(--border-strong); color: var(--text); }
.an-status.on { background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); color: var(--text); font-weight: 600; }

.subtasks { display: flex; flex-direction: column; gap: 1px; }
.progress { height: 4px; background: var(--fill); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 2px; transition: width .3s; }
.progress.big { height: 8px; border-radius: 4px; margin: 8px 0 14px; }
.sub { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 6px; border-radius: var(--radius-s); flex-wrap: wrap; }
.sub:hover { background: var(--hover); }
.sub-main { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px; align-self: stretch; cursor: pointer; border-radius: 6px; }
.sub-title { color: var(--text); cursor: text; -webkit-user-select: text; user-select: text; word-break: break-word; }
.sub-main:hover .sub-title { color: var(--link); }
.sub-main .rename-input { flex: 1; }
.sub .sub-open { color: var(--muted); }
.sub.dragging { opacity: .45; }
.sub.sub-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.sub.sub-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.sub .sub-open:hover { color: var(--accent); }
.sub-hidden-note { margin-top: 4px; }
@media (pointer: coarse) { .sub-title { cursor: pointer; } }
.sub.closed .sub-title { color: var(--muted); }
.subtasks .input { margin-top: 6px; }
/* Grupos de subtarefas: cada grupo com cabeçalho próprio, separado dos outros. */
.subgroup { margin-top: 12px; border: 1px solid var(--separator); border-radius: var(--radius); padding: 4px 6px 8px; background: var(--surface-2, transparent); }
.subgroup.collapsed { padding-bottom: 4px; }
.subgroup-head { display: flex; align-items: center; gap: 6px; }
.subgroup-toggle { display: grid; place-items: center; flex: none; width: 26px; height: 30px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; border-radius: var(--radius-s); }
.subgroup-toggle:hover { background: var(--hover); color: var(--text); }
.subgroup-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; cursor: pointer; padding: 4px 2px; border-radius: 5px; }
.subgroup-name:hover { background: var(--hover); }
.subgroup-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; border: 0; background: none; font-family: inherit; padding: 0 2px; cursor: pointer; }
.subgroup-head .rename-input, .sub-head-title .rename-input { font-weight: 600; min-width: 160px; }
/* Grupo padrão: o nome é o título da seção; clique duplo renomeia */
.sub-head-title { gap: 6px; min-width: 0; }
.sub-head-title h3 { cursor: text; padding: 2px 4px; margin-left: -4px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-head-title h3:hover { background: var(--hover); }
.sub-status { display: inline-flex; align-items: center; flex: none; }
.sub:hover .st-step:not(:disabled) { opacity: 1; }
.sub-status-dots { display: inline-flex; gap: 3px; align-items: center; padding: 0 2px; }
.sub-status-dots .dot { width: 7px; height: 7px; }
.sub-flag { color: var(--muted); display: inline-flex; }
.sub-hidden-note { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: var(--radius-s); }
.sub-hidden-note:hover { color: var(--text); background: var(--hover); }
/* Escolha com explicação (ex.: status do grupo: seguir a lista ou próprios) */
.radio-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--separator); border-radius: var(--radius); cursor: pointer; }
.radio-card.on { border-color: var(--accent); background: var(--accent-tint); }
.radio-card input { margin-top: 3px; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top-gap { margin-top: 10px; }
span.block { display: block; }
.subgroup.drop-on, .subgroup-loose.drop-on { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.sub.dragging { opacity: .45; }
.sub .sub-move { opacity: 0; }
.sub:hover .sub-move, .sub .sub-move:focus-visible { opacity: 1; }
@media (pointer: coarse) { .sub .sub-move { opacity: 1; } }
/* Lista: nome do grupo como divisória entre as subtarefas abertas. */
.lrow.lsubgroup { min-height: 28px; }
.lsubgroup .lcell { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: .01em; }
.rels .sub { border: 1px solid var(--separator); margin-bottom: 4px; }
.rel-results { max-height: 320px; overflow-y: auto; }
.rel-pick { display: flex; align-items: center; gap: 8px; text-align: left; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--separator); border-radius: var(--radius); padding: 6px; min-width: 0; background: var(--surface); }
.file-thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--fill-2); display: grid; place-items: center; flex: none; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-ext { font-size: 11px; font-weight: 700; color: var(--muted); }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 520; }
.drop-hint { padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }

/* comentários e histórico */
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--separator); }
.tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 10px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); font-weight: 650; border-bottom-color: var(--accent); }
.tabs.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 12px 14px 4px; padding: 2px; border-radius: 9px; background: var(--fill); }
.tabs.seg-tabs button { justify-content: center; height: 30px; padding: 0 10px; margin: 0; border: 0; border-radius: 7px; font-size: 13px; }
.tabs.seg-tabs button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .tabs.seg-tabs button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs.seg-tabs button.on { background: #636366; } }
.tab-count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tv-feed { flex: 1; overflow-y: auto; padding: 12px 16px; min-height: 0; }
.feed-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 36px 14px; }
.feed-empty p { margin: 0; max-width: 300px; font-size: 13px; line-height: 1.5; }
.comment { display: flex; gap: 10px; margin-bottom: 16px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; }
.comment-head b { font-weight: 650; }
.comment-head .icon-btn { margin-left: auto; }
.comment-body { word-break: break-word; margin-top: 3px; line-height: 1.5; }
.comment-chk { margin-top: 4px; width: 18px; height: 18px; }
.comment.resolved .comment-body { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.comment.resolved .avatar, .comment.resolved .cimg { opacity: .5; }
.only-open { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.act { font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--separator); color: var(--text-2); }
.act b { font-weight: 650; color: var(--text); }
/* imagens no comentário */
.cimgs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.cimg { padding: 0; border: 1px solid var(--separator); border-radius: var(--radius); overflow: hidden; background: var(--fill-2); cursor: zoom-in; width: 168px; height: 112px; flex: none; }
.cimgs .cimg:only-child { width: auto; height: auto; max-width: 100%; }
.cimgs .cimg:only-child img { max-height: 260px; width: auto; max-width: 100%; }
.cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cimg:hover { border-color: var(--border-strong); }
.composer { position: relative; padding: 10px 14px; border-top: 1px solid var(--separator); background: var(--surface); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.composer textarea { min-height: 44px; border-radius: var(--radius); }
.composer-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.composer-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cimg-pending { position: relative; width: 64px; height: 64px; border-radius: 9px; overflow: hidden; border: 1px solid var(--separator); background: var(--fill-2); }
.cimg-pending img { width: 100%; height: 100%; object-fit: cover; }
.cimg-pending.busy img { opacity: .4; }
.cimg-pending.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cimg-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.mentions { position: absolute; bottom: 100%; left: 14px; right: 14px; background: var(--material-pop); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; }
.mentions:empty { display: none; }
.mentions .pick-item { justify-content: flex-start; }
.task-view.readonly .tv-main input:disabled, .task-view.readonly .tv-main select:disabled, .task-view.readonly .tv-main textarea:disabled { opacity: .8; cursor: default; }
.task-view.readonly .desc, .task-view.readonly .tv-main .btn:disabled { pointer-events: none; }
.task-view.readonly .tv-main .btn:disabled { opacity: .5; }

/* cronômetro no topo e na tarefa */
.top-timer { display: inline-flex; align-items: center; height: 32px; border-radius: 16px; background: var(--green-tint); color: var(--green); overflow: hidden; }
.top-timer-task { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: inherit; font: inherit; font-weight: 650; padding: 0 6px 0 11px; cursor: pointer; height: 100%; }
.top-timer-title { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text-2); }
.top-timer-stop { border: 0; background: var(--green); color: #fff; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.timer-live { font-variant-numeric: tabular-nums; }
.timer-btn.running { background: var(--green); color: #fff; }
.time-pop .time-by { padding: 4px 0; border-bottom: 1px solid var(--separator); }
.time-add { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.time-entry { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }

/* ================================================================ telas avulsas */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-tint), transparent), radial-gradient(1000px 600px at 110% 110%, var(--link-tint), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 22px; padding: 30px 26px 24px; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand img { height: 34px; width: auto; }
.auth-brand .brand-app { font-size: 15px; }
.auth-error { color: var(--red); min-height: 18px; font-size: 13px; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface); box-shadow: var(--shadow-sm); border-radius: var(--radius-l); padding: 0 14px; margin-bottom: 14px; color: var(--muted); }
.search-box .input { border: 0; background: transparent; box-shadow: none; }
.settings { max-width: 680px; display: flex; flex-direction: column; gap: 16px; }
.settings .input[type=password] { margin-top: 8px; }
.panel { background: var(--surface); border-radius: var(--radius-l); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.panel.archived, tr.archived, .admin-row.archived { opacity: .55; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; flex: 1; }
.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--separator); cursor: pointer; }
.toggle-row:last-child { border-bottom: 0; }
.admin-tabs { display: flex; gap: 2px; overflow-x: auto; margin: -4px 0 18px; padding: 2px; border-radius: 10px; background: var(--fill); width: fit-content; max-width: 100%; }
.admin-tabs { scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { padding: 6px 13px; color: var(--text-2); white-space: nowrap; border-radius: 8px; text-decoration: none !important; font-size: 13.5px; font-weight: 510; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a.on { color: var(--text); font-weight: 650; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .admin-tabs a.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .admin-tabs a.on { background: #636366; } }
.admin-body { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.admin-body > .btn { align-self: flex-start; }
.rows { display: flex; flex-direction: column; }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--separator); flex-wrap: wrap; }
.admin-row.folder-row { background: var(--surface-2); padding-left: 8px; border-radius: 8px; }
.admin-row.nested { padding-left: 30px; }
.status-dots { display: inline-flex; gap: 3px; }
.status-editor { display: flex; flex-direction: column; gap: 6px; }
.status-row { display: flex; align-items: center; gap: 8px; }
.status-row .input { flex: 1; max-width: none; }
.tbl-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-sm); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--separator); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .btn { margin-left: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--radius-l); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.stat.good { box-shadow: inset 3px 0 0 var(--green), var(--shadow-sm); }
.stat.bad { box-shadow: inset 3px 0 0 var(--red), var(--shadow-sm); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-weight: 600; margin-top: 2px; word-break: break-word; }

/* início e notificações */
.home-section { margin-bottom: 22px; }
.home-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; margin: 6px 0 10px; color: var(--text); }
.hlist { background: var(--surface); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-sm); }
.hgroup { padding: 8px 16px; font-size: 12.5px; font-weight: 650; color: var(--muted); background: var(--surface-3); border-bottom: 1px solid var(--separator); }
.hgroup-late { color: var(--red); }
.hgroup-today { color: var(--accent-text); }
.hrow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--separator); cursor: pointer; }
.hrow:last-child { border-bottom: 0; }
.hrow:hover { background: var(--hover); }
.hrow.closed .hrow-title { color: var(--muted); }
.hrow-main { flex: 1; min-width: 0; }
.hrow-title { font-weight: 560; word-break: break-word; }
.hrow-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.hrow-sub .where { display: inline-flex; align-items: center; gap: 5px; }
.hrow-sub .space-dot { width: 8px; height: 8px; }
.hrow-sub .icon { display: inline; vertical-align: -2px; }
.hrow-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.notif-list { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-l); overflow: hidden; margin-top: 10px; box-shadow: var(--shadow-sm); }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--separator); cursor: pointer; align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--hover); }
.notif:not(.read) { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.notif:not(.read) .notif-title { font-weight: 650; }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--text-2); flex: none; }
.notif:not(.read) .notif-icon { color: #fff; background: var(--accent); }
.notif-main { flex: 1; min-width: 0; }
.notif-body { color: var(--text-2); font-size: 13px; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.notif-meta { margin-top: 4px; }
.notif-actions { display: flex; gap: 2px; flex: none; }

/* automações */
.auto-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--separator); border-radius: var(--radius-l); background: var(--surface); flex-wrap: wrap; }
.auto-row > input { margin-top: 3px; width: 18px; height: 18px; }
.auto-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.auto-when { color: var(--link); font-weight: 600; }
.action-card { border: 1px solid var(--separator); border-radius: var(--radius-l); padding: 12px 14px; background: var(--surface-3); display: flex; flex-direction: column; gap: 8px; }
.action-head { display: flex; align-items: center; gap: 8px; }
.action-head select { flex: 1; font-weight: 600; }
.action-num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.extra-filters summary { cursor: pointer; color: var(--text-2); font-size: 13px; padding: 4px 0; }
.extra-filters[open] summary { margin-bottom: 8px; }
.perm-grid { display: flex; flex-direction: column; border: 1px solid var(--separator); border-radius: var(--radius-l); overflow: hidden; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--separator); }
.perm-row:last-child { border-bottom: 0; }
.perm-row.default { background: var(--surface-2); font-weight: 600; }
.perm-row select { min-width: 190px; }

/* ================================================================ 1.7: mover, ordenar e Google Drive */

/* Arrastar a tarefa para uma lista, pasta ou espaço da barra lateral */
.ltable .lrow:not(.ladd) { -webkit-user-select: none; user-select: none; }
/* Com mouse, o título da tarefa se seleciona para copiar (arrastar continua pelo resto da linha) */
@media (pointer: fine) { .ltable .lrow .tlink { -webkit-user-select: text; user-select: text; } }
body.is-dragging, body.is-dragging * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }
[data-drop-target].drop-hover { background: var(--accent) !important; color: #fff !important; box-shadow: 0 0 0 2px var(--accent-tint); }
[data-drop-target].drop-hover .icon, [data-drop-target].drop-hover a { color: #fff !important; }
.drag-ghost.drag-out { transform-origin: left top; opacity: .85; scale: .6; }
/* Seta da ordenação no cabeçalho */
.sort-arrow { display: inline-grid; place-items: center; color: var(--accent); }
.lhbtn .sort-arrow .icon { opacity: 1; }
.seg.seg-full { display: flex; width: 100%; }
.seg.seg-full button { flex: 1; min-width: 0; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .seg.seg-full .icon { display: none; } .action-card { padding: 10px; } }
.cols-pick > .seg-full { margin: 4px 12px 8px; width: auto; }
.seg button:disabled { opacity: .45; cursor: default; }
/* Google Drive */
.drive-check:empty { display: none; }
.drive-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--green); font-weight: 560; }
.drive-ok.bad { color: var(--red); }
.drive-job { align-items: flex-start; }
.drive-st { display: inline-flex; align-items: center; gap: 4px; min-width: 84px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--text-2); }
.drive-st.st-done { background: var(--green-tint); color: var(--green); }
.drive-st.st-failed { background: var(--red-tint); color: var(--red); }
.drive-st.st-pending { background: var(--link-tint); color: var(--link); }

/* ================================================================ importação do ClickUp */
.modal.import-modal { max-width: 1240px; height: 90vh; max-height: 90vh; }
.import-modal .modal-body { flex: 1; padding-bottom: 0; }
.import h3 { margin: 18px 0 6px; }
.import .tbl td { vertical-align: top; }
.import code { font-size: 11.5px; background: var(--surface-2); color: var(--muted); padding: 1px 5px; border-radius: 4px; }
.import details summary { cursor: pointer; padding: 6px 0; }
.import-actions {
  position: sticky; bottom: 0; z-index: 4; justify-content: flex-end; margin-top: 18px;
  padding: 12px 0 16px; background: var(--surface); border-top: 1px solid var(--border);
}
.check.wrap { white-space: normal; align-items: flex-start; }
.check.wrap input { margin-top: 3px; }
.imp-file { max-width: 560px; }
.imp-intro { margin: 0 0 10px; color: var(--text-2); }
.imp-review .stats { grid-template-columns: minmax(0, 1fr); }

/* passos */
.imp-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; }
.imp-steps button {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border: 1px solid var(--separator); border-radius: 16px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; cursor: default;
}
.imp-steps button:enabled { cursor: pointer; color: var(--text-2); }
.imp-steps button:enabled:hover { background: var(--surface-2); }
.imp-steps .n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); font-size: 12px; font-weight: 700; }
.imp-steps .cur button { border-color: var(--orange); color: var(--text); font-weight: 600; }
.imp-steps .cur .n { background: var(--accent); color: #fff; }
.imp-steps .done .n { background: var(--ok); color: #fff; }

/* passo 2: colunas à esquerda, tarefa de exemplo à direita */
.imp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.imp-count { font-weight: 600; }
.imp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 18px; align-items: start; }
.imp-left { min-width: 0; }
section.imp-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
section.imp-group > h3, section.imp-group > p { margin: 0; }
details.imp-group { margin-bottom: 14px; border-top: 1px solid var(--border); padding-top: 6px; }
details.imp-group > summary { font-weight: 600; color: var(--text-2); }
details.imp-group > p { margin: 0 0 8px; }
.imp-col { display: flex; gap: 12px; padding: 10px 12px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); transition: border-color .12s; }
.imp-col:not(.on) { background: var(--surface-2); }
.imp-col:not(.on) .imp-col-head b { color: var(--muted); }
.imp-col.focus { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.imp-col-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.imp-col-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.imp-fill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.imp-bar { width: 44px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; display: inline-block; }
.imp-bar span { display: block; height: 100%; background: var(--blue); }
.imp-help { font-size: 12.5px; color: var(--text-2); }
.imp-ex { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-ex .link-btn { padding: 0; font-size: 12.5px; }
.imp-ex-val { font-weight: 600; }
.imp-ctl { margin-top: 2px; }
.imp-ctl .input.compact { height: 30px; font-size: 13px; }
.imp-how { font-size: 12px; color: var(--text-2); border-left: 3px solid var(--blue); padding-left: 8px; }
.imp-warn { font-size: 12px; color: var(--warn-text); margin-top: 2px; }
/* tarefa de exemplo */
.imp-right {
  position: sticky; top: 0; max-height: calc(90vh - 150px); overflow-y: auto; z-index: 2;
  border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.imp-right-head {
  position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.imp-right-head .btn.small { width: 30px; padding: 0; font-size: 16px; }
.imp-right-head .input.compact { width: 150px; height: 28px; font-size: 12.5px; }
.imp-hint { margin: 10px 12px 0; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; background: color-mix(in srgb, var(--orange) 10%, transparent); }
.imp-hint:empty { display: none; }
.imp-hint .link-btn { padding: 0; font-size: 12.5px; }
.imp-task { display: flex; flex-direction: column; gap: 14px; padding: 12px 14px 18px; }
.imp-t-title { font-size: 18px; font-weight: 650; line-height: 1.3; margin-top: -8px; }
.imp-props { display: flex; flex-direction: column; gap: 2px; }
.imp-prop { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 3px 4px; border-radius: 4px; font-size: 13px; }
.imp-prop .k { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.imp-prop .v { min-width: 0; overflow-wrap: anywhere; }
.imp-sec h4 { margin: 0 0 6px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.imp-desc { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }
.imp-tag { background: color-mix(in srgb, var(--text-2) 12%, transparent); color: var(--text-2); }
.imp-out { border-top: 1px dashed var(--border); padding-top: 6px; }
.imp-out > summary { font-size: 12.5px; color: var(--muted); }
.imp-out .imp-prop { color: var(--muted); font-size: 12px; }
.imp-task [data-k] { cursor: pointer; }
.imp-task .hl { outline: 2px solid var(--orange); outline-offset: 1px; border-radius: 4px; background: color-mix(in srgb, var(--orange) 10%, transparent); }

/* ================================================================ calendário, linha do tempo, relatório de tempo */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-title { margin: 0 0 0 6px; font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--separator); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-dow { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-height: 112px; padding: 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-week .cal-day { min-height: 60vh; }
.cal-day.other { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cal-day.other .cal-num { color: var(--muted); }
.cal-day.today .cal-num { background: var(--orange); color: #fff; }
.cal-day.drop { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; }
.cal-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; font-size: 12px; font-weight: 600; padding: 0 4px; }
.cal-add { border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; display: grid; place-items: center; width: 22px; height: 22px; opacity: 0; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--surface-2); color: var(--text); }
.cal-chip { display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; border-left: 3px solid; background: var(--surface-2); font-size: 12px; cursor: pointer; min-width: 0; }
.cal-chip:hover { background: color-mix(in srgb, var(--blue) 10%, var(--surface-2)); }
.cal-chip-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.closed .cal-chip-title { color: var(--muted); }
.cal-more { border: 0; background: none; color: var(--blue); font: inherit; font-size: 12px; cursor: pointer; text-align: left; padding: 2px 6px; }

/* linha do tempo */
.tl-wrap { overflow: auto; max-height: calc(100vh - var(--topbar) - 150px); border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); }
.tl { min-width: max-content; }
.tl-row { display: flex; border-bottom: 1px solid var(--border); min-height: 34px; }
.tl-row.closed .tl-label a { color: var(--muted); }
.tl-label {
  position: sticky; left: 0; z-index: 2; width: 280px; min-width: 280px; display: flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--surface); border-right: 1px solid var(--border); font-size: 13px; overflow: hidden;
}
.tl-label a { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-header { position: sticky; top: 0; z-index: 4; background: var(--surface); }
.tl-header .tl-label { z-index: 5; font-size: 12px; color: var(--muted); font-weight: 600; }
.tl-scale { position: relative; height: 44px; }
.tl-months, .tl-days { position: absolute; left: 0; right: 0; height: 22px; }
.tl-months { top: 0; }
.tl-days { top: 22px; }
.tl-month { position: absolute; top: 0; height: 22px; padding: 3px 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-transform: capitalize; }
.tl-day { position: absolute; top: 0; height: 22px; font-size: 11px; color: var(--muted); text-align: center; line-height: 22px; }
.tl-day.we { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tl-day.today { color: #fff; background: var(--accent); border-radius: 5px; font-weight: 700; }
.tl-track { position: relative; flex: none; background-image: linear-gradient(to right, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px); }
.tl-pick { cursor: crosshair; }
.tl-pick:hover { background-color: color-mix(in srgb, var(--blue) 5%, transparent); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--orange); opacity: .6; z-index: 1; }
.tl-group { display: flex; background: var(--surface-2); border-bottom: 1px solid var(--border); min-height: 30px; }
.tl-group-label { background: var(--surface-2); font-weight: 650; color: var(--text-2); }
.tl-bar {
  position: absolute; top: 6px; height: 22px; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center;
  cursor: grab; z-index: 2; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); overflow: hidden; touch-action: none; user-select: none;
}
.tl-bar.single { opacity: .85; }
.tl-bar.closed { opacity: .45; }
.tl-bar.dragging { cursor: grabbing; outline: 2px solid var(--blue); }
.tl-bar-title { flex: 1; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.tl-handle { width: 7px; align-self: stretch; cursor: ew-resize; flex: none; }
.tl-handle:hover { background: rgba(255, 255, 255, .35); }

/* relatório de tempo */
.tr-body { gap: 14px; }
.big-num { font-size: 22px; }
.tr-person { display: grid; grid-template-columns: 24px 160px minmax(0, 1fr) 70px 44px; align-items: center; gap: 10px; }
.tr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.tr-bar span { display: block; height: 100%; background: var(--blue); border-radius: 5px; }
.tr-val { text-align: right; font-variant-numeric: tabular-nums; }
.tr-pct { text-align: right; }
.tr-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 6px 1px 1px; border-radius: 12px; background: var(--surface-2); }
.tr-modal { min-height: 300px; }

/* ================================================================ pasta e espaço, campos por escopo, pacotes */
.scope-lists { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.scope-list { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }
.fscope { border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); padding: 10px 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.fscope-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fscope-space { margin: 14px 0; }
.fscope-space > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 0; }
.fscope-folder { margin-left: 18px; }
.fscope-list { margin-left: 18px; }
.fscope-children .fscope-list { margin-left: 18px; }
.fscope-all { border-color: color-mix(in srgb, var(--blue) 35%, var(--border)); }

/* pacotes */
.pk-intro { max-width: 760px; }
.pk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pk-card { display: flex; flex-direction: column; gap: 8px; }
.pk-card h2 { margin: 0; }
.pk-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 18px; align-items: start; }
.pk-left { gap: 14px; }
.pk-right { position: sticky; top: calc(var(--topbar) + 12px); max-height: calc(100vh - var(--topbar) - 32px); overflow-y: auto; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); padding: 12px; }
.pk-right h3 { margin: 0 0 8px; }
.pk-name { font-size: 17px; font-weight: 650; height: 40px; }
.pk-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pk-tag { border: 1px dashed color-mix(in srgb, var(--blue) 55%, var(--border)); background: color-mix(in srgb, var(--blue) 7%, transparent); color: var(--blue); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; cursor: pointer; }
.pk-tag:hover { background: color-mix(in srgb, var(--blue) 15%, transparent); }
.pk-var code { min-width: 110px; }
.pk-mode { align-items: flex-start; }
.pk-mother-create { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.pk-group { border: 1px solid var(--separator); border-radius: var(--radius); margin-top: 12px; overflow: hidden; }
.pk-group-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); }
.pk-item { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.pk-item.sub { padding-left: 34px; background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.pk-item-main { display: flex; align-items: center; gap: 6px; }
.pk-title { flex: 1; font-weight: 600; }
.pk-item-tools { display: flex; gap: 0; opacity: .55; }
.pk-item:hover .pk-item-tools { opacity: 1; }
.pk-item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pk-offlabel { display: inline-flex; align-items: center; gap: 4px; }
.pk-off { width: 64px !important; }
.pk-more summary { cursor: pointer; }
.pk-field { display: flex; flex-direction: column; gap: 2px; }
.pk-addlist { margin-top: 12px; }
.pk-addlist select { max-width: 420px; }
.pk-preview { display: flex; flex-direction: column; gap: 10px; }
.pk-prev-mother { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; background: color-mix(in srgb, var(--orange) 10%, transparent); }
.pk-prev-list { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-2); margin-bottom: 2px; }
.pk-prev-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 8px; border-left: 2px solid var(--border); }
.pk-apply-prev { max-height: 46vh; overflow-y: auto; border: 1px solid var(--separator); border-radius: var(--radius); padding: 10px; }

/* ================================================================ telas menores */

.tabbar { display: none; }
.icon-btn.only-narrow { display: none; }

/* Topo apertado: primeiro sai a pesquisa (fica na barra lateral e na tecla /), depois os rótulos. */
@media (max-width: 1500px) {
  .top-search-wrap { display: none; }
  .top-actions .seg .hide-sm { display: none; }
}
@media (max-width: 1300px) {
  .top-actions .btn > span { display: none; }
  .top-actions .btn { padding: 0 9px; }
}
@media (max-width: 1180px) {
  .top-actions .hide-narrow { display: none !important; }
  .icon-btn.only-narrow { display: inline-grid; }
}
/* Ação principal do topo sempre com rótulo (ex.: Salvar). */
.top-actions .btn.primary > span { display: inline; }

@media (max-width: 1100px) {
  .tv-body { grid-template-columns: minmax(0, 1fr) 330px; }
  .props, .fgrid { grid-template-columns: 1fr; }
  .fgrid .frow:nth-last-child(2) { border-bottom: 1px solid var(--separator); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.3, .7, .4, 1); box-shadow: var(--shadow-lg); background: var(--surface); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 35; touch-action: none; }
  .sidebar { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  html.sb-lock, html.sb-lock body { overflow: hidden; overscroll-behavior: none; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: 0 8px; gap: 6px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .content { padding: 14px; }

  /* Tarefa em tela cheia, comentários abaixo */
  .overlay { padding: 0; }
  .modal { max-height: 100vh; }
  .task-modal { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; max-width: none; }
  .task-modal .modal-body { overflow-y: auto; display: block; }
  .tv-head { position: sticky; top: 0; background: var(--material-bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); z-index: 3; padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px; }
  .tv-body { display: block; }
  .tv-main { overflow: visible; padding: 16px 16px 12px; }
  .tv-side { border-left: 0; border-top: 1px solid var(--separator); }
  .tv-feed { overflow: visible; }
  .composer { position: sticky; bottom: 0; }

  /* Importação: tarefa de exemplo em cima, presa no topo, colunas embaixo */
  .modal.import-modal { height: 100vh; height: 100dvh; max-height: none; }
  .imp-split { grid-template-columns: minmax(0, 1fr); }
  .imp-right { order: -1; max-height: 42vh; }
}

/* ================================================================ toque (iPhone, iPad): alvos de 44 pt */

@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn.tiny { width: 36px; height: 36px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 36px; height: auto; }
  .menu-item { min-height: 44px; padding: 10px 12px; font-size: 16px; }
  .pick-item { min-height: 44px; font-size: 16px; }
  .cell-btn { min-height: 40px; }
  .chk { width: 24px; height: 24px; position: relative; }
  .chk::after { content: ''; position: absolute; inset: -10px; }
  .comment-chk { width: 24px; height: 24px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  .switch { width: 51px; height: 31px; }
  .switch-ui { border-radius: 16px; }
  .switch-ui::after { width: 27px; height: 27px; }
  .switch input:checked + .switch-ui::after { transform: translateX(20px); }
  .tabs button { min-height: 44px; }
  .tabs.seg-tabs button { height: 36px; min-height: 36px; }
  .vtab, .vtab-name { min-height: 40px; }
  .seg button { min-height: 36px; }
  .space-more { min-width: 40px; min-height: 40px; }
  .caret { min-width: 32px; min-height: 32px; }
  .add-input { height: 44px; font-size: 16px; }
  .lhbtn .icon { opacity: .8; }
  .cimg-x { width: 28px; height: 28px; }
}
@media (hover: none) {
  .cal-add, .pk-item-tools, .space-more { opacity: 1 !important; }
  .lrow:hover:not(.lhead):not(.ladd) { background: transparent; }
  .menu-item:hover { background: var(--hover); color: var(--text); }
  .menu-item:hover .icon { color: var(--text-2) !important; }
}

/* ================================================================ celular */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .small, .muted.small { font-size: 13px; }
  .hide-xs { display: none !important; }
  .only-xs { display: inline-flex !important; }
  .icon-btn.only-xs { display: inline-grid !important; }
  .hide-sm { display: none; }
  .content { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .input, .top-search { font-size: 16px; } /* evita o zoom automático do iPhone */
  .input { height: 40px; }
  .input.compact { height: 36px; }
  .grid2 { grid-template-columns: 1fr; }

  /* Barra de abas flutuante embaixo, em vidro, como no iOS */
  .tabbar {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 45;
    padding: 4px; border-radius: 28px; background: var(--material-bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    box-shadow: var(--shadow-lg);
  }
  .tab {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; border-radius: 24px;
    border: 0; background: none; color: var(--text-2); font: inherit; font-size: 10.5px; font-weight: 600; text-decoration: none !important; cursor: pointer;
  }
  .tab.on { color: var(--accent); background: var(--fill-2); }
  .tab-badge { position: absolute; top: 4px; left: calc(50% + 4px); }
  body.sidebar-open .tabbar { z-index: 46; }
  .sidebar { width: min(86vw, 330px); padding-top: env(safe-area-inset-top); padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .sidebar .nav-item, .space-lists .nav-item, .fav-item { min-height: 44px; padding: 10px 12px; font-size: 16px; }
  .space-head, .folder-head { min-height: 44px; padding: 10px 10px; font-size: 16px; }
  .add-list { min-height: 44px; padding: 10px 12px; font-size: 15px; }
  .nav { display: none; }

  /* Topo */
  .topbar { gap: 4px; }
  .top-right { gap: 2px; }
  .top-actions .seg button { padding: 0 9px; }
  .top-title { min-width: 60px; gap: 2px; }
  .top-right .search-xs { display: none !important; }
  .top-timer-task { padding: 0 6px 0 8px; }
  .top-timer-task .icon, .top-timer-title { display: none; }
  .top-timer-task .timer-live { font-size: 12px; }
  h1 { font-size: 18px; }
  .crumb-space, .crumb-sep { display: none; }

  /* Avisos e barra de lote acima da barra de abas */
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .bulk-bar { left: 8px; right: 8px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)) !important; flex-wrap: nowrap; justify-content: space-between; border-radius: 18px; }
  .bulk-bar > * { flex: none; }

  /* Janelas viram folhas que sobem de baixo, com alça */
  .overlay { align-items: flex-end; }
  .modal:not(.task-modal) { max-width: none; border-radius: 18px 18px 0 0; margin-top: auto; max-height: calc(100dvh - env(safe-area-inset-top) - 12px); position: relative; padding-top: 6px; animation: sheet-up .28s cubic-bezier(.3, .7, .4, 1); }
  @keyframes sheet-up { from { transform: translateY(40%); opacity: .6; } }
  .modal:not(.task-modal)::before, .popover.sheet::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 6px auto 0; flex: none; }
  .modal-actions { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-actions .btn { flex: 1; min-height: 48px; font-size: 16px; }
  .modal-body, .popover.sheet { overscroll-behavior: contain; }
  .popover.sheet { max-height: 80dvh; padding: 0 6px env(safe-area-inset-bottom); }
  .modal.import-modal, .modal.wide { max-height: 100dvh; height: 100dvh; border-radius: 0; margin-top: 0; padding-top: env(safe-area-inset-top); }
  .modal.import-modal::before, .modal.wide::before { display: none; }
  .lightbox-modal { margin: auto; }

  /* Quadro e lista */
  .board { scroll-snap-type: x mandatory; min-height: 0; }
  .col { flex-basis: 86vw; max-height: none; }
  .col-body { overflow: visible; }
  .my-board { flex-direction: column; align-items: stretch; overflow: visible; }
  .my-board .col { flex-basis: auto; }
  .ltable-scroll { overflow: visible; }
  .ltable { min-width: 0; }
  .lhead { display: none; }
  .lrow { grid-template-columns: 0 82px minmax(0, 1fr) !important; min-height: 56px; }
  .lrow > .lsel { visibility: hidden; padding: 0; overflow: hidden; }
  .lrow > .lcell:nth-child(n+4) { display: none; }
  .row-mobile-meta { display: flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; margin-top: 2px; }
  .ladd, .lmore { grid-template-columns: 0 0 1fr !important; }
  .ltitle-main { row-gap: 4px; }
  .ltitle-main > .tlink { flex: 1 1 100%; min-width: 0; }
  .ltitle > .caret, .ltitle > .caret-space { flex: none; }
  .ltitle > .caret-space { width: 0; }
  .tlink { font-size: 16px; }
  .lcell { padding: 8px 6px; }
  .card-title { font-size: 16px; }
  .filters .input[type=search] { width: 100%; flex: 1 1 100%; max-width: none; }
  .filters .input.compact { flex: 1; max-width: none; }
  .filters.collapsed > :not(.f-keep) { display: none !important; }
  .filters .f-keep.input { flex: 1; }
  .filters-toggle.active { background: var(--accent-tint); color: var(--accent-text); }
  .ltable.selecting .lrow { grid-template-columns: 34px 82px minmax(0, 1fr) !important; }
  .ltable.selecting .lrow > .lsel { visibility: visible; }
  .ltable.selecting .lsel input { opacity: 1; }
  .lgroup-sel { display: none; }
  .ltable.selecting .lgroup-sel { display: grid; width: 34px; }
  .lgroup.has-sel .lgroup-head { padding-left: 12px; }
  .ltable.selecting .lgroup.has-sel .lgroup-head { padding-left: 4px; }

  /* Tarefa aberta */
  .tv-crumbs { flex-wrap: nowrap; overflow: hidden; }
  .tv-crumbs a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tv-crumbs .crumb-sep, .tv-crumbs > a:not(:first-child) { display: none; }
  .tv-title { font-size: 21px; }
  .prop { grid-template-columns: 108px minmax(0, 1fr); min-height: 44px; }
  .prop-status { grid-template-columns: 64px minmax(0, 1fr); } /* mais espaço para o status grande */
  .chk.tv-done { margin-left: 4px; }
  .frow { min-height: 46px; }
  .fields-card { padding: 2px 12px; }
  .an-card-form { grid-template-columns: 1fr 1fr; width: 100%; }
  .an-statuses { padding-left: 14px; }
  .comment { gap: 8px; }
  .cimg { width: 136px; height: 96px; }

  /* Calendário compacto: pontos no mês e a agenda do dia embaixo */
  .cal-month .cal-day { min-height: 70px; }
  .cal-chip .avatars { display: none; }
  .cal-m-day { min-height: 46px; padding: 4px 2px; align-items: center; gap: 2px; cursor: pointer; -webkit-appearance: none; appearance: none; background: none; color: var(--text); font: inherit; border-style: solid; border-color: var(--separator); border-width: 0 1px 1px 0; border-radius: 0; }
  .cal-m-day.other { color: var(--muted); background: var(--fill-2); }
  .cal-m-day .cal-num { min-width: 30px; height: 30px; border-radius: 15px; font-size: 14px; }
  .cal-m-day.sel .cal-num { box-shadow: 0 0 0 2px var(--accent); }
  .cal-dots { display: flex; gap: 2px; justify-content: center; min-height: 6px; }
  .cal-dot { width: 6px; height: 6px; border-radius: 3px; }
  .cal-day.cal-m-day { min-height: 52px; }
  .cal-agenda { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
  .cal-agenda-day { font-weight: 650; margin: 10px 0 2px; display: flex; align-items: center; justify-content: space-between; }
  .cal-agenda .cal-chip { width: 100%; text-align: left; color: var(--text); font: inherit; font-size: 16px; gap: 10px; padding: 12px 14px; border-left-width: 4px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border-top: 0; border-right: 0; border-bottom: 0; }
  .cal-agenda .cal-chip-sub { font-size: 12.5px; color: var(--muted); }
  .cal-agenda .cal-chip-title { white-space: normal; overflow: visible; }
  .cal-agenda .cal-chip > .grow { min-width: 0; }
  .cal-head .cal-title { font-size: 18px; width: 100%; order: -1; margin: 0; }

  /* Telas largas (pacotes, linha do tempo, relatório) empilhadas */
  .pk-editor { grid-template-columns: minmax(0, 1fr); }
  .pk-right { position: static; max-height: none; }
  .pk-item-main { flex-wrap: wrap; }
  .pk-title { flex: 1 1 100%; }
  .pk-var { flex-wrap: wrap; }
  .tl-label { width: 150px; min-width: 150px; }
  .tr-person { grid-template-columns: 24px minmax(0, 1fr) auto; row-gap: 4px; }
  .tr-person .tr-bar { grid-column: 2 / -1; grid-row: 2; }
  .tr-pct { display: none; }
  .admin-tabs { flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .panel-head > h2 { flex: 1 1 100%; }
  /* Tabelas da Administração viram cartões: nada fica escondido à direita da tela. */
  .tbl-scroll:has(.tbl-cards) { background: transparent; box-shadow: none; overflow: visible; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards thead { display: none; }
  .tbl-cards tr { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-sm); padding: 10px 14px; margin-bottom: 10px; }
  .tbl-cards td { border: 0; padding: 5px 0; text-align: left !important; white-space: normal !important; }
  .tbl-cards td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 1px; }
  .tbl-cards td:empty { display: none; }
  .tbl-cards td .btn { margin: 4px 6px 0 0; }
  .tbl-cards td.right { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  .tbl-cards td.right .btn { margin: 0; }
  .admin-tabs a { flex: none; }
  .panel { padding: 16px; }
  .panel-head { flex-wrap: wrap; gap: 8px; }
  .hrow { flex-wrap: wrap; gap: 8px 10px; padding: 12px 14px; }
  .hrow-meta { width: 100%; padding-left: 30px; flex-wrap: wrap; gap: 8px; }
  .notif-actions { flex-direction: column; }
  .quick-add { padding: 8px 8px 8px 12px; }
}

/* Reduzir movimento: sem deslizar nem crescer, só aparecer. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ texto formatado (descrição e comentário) */
.md { line-height: 1.55; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .45em; }
.md p.md-gap { height: .9em; margin: 0; }
.md h1, .md h2, .md h3 { margin: .9em 0 .35em; line-height: 1.25; letter-spacing: -.01em; }
.md h1 { font-size: 1.32em; font-weight: 700; }
.md h2 { font-size: 1.16em; font-weight: 700; }
.md h3 { font-size: 1.02em; font-weight: 650; }
.md ul, .md ol { margin: 0 0 .5em; padding-left: 1.5em; }
.md li { margin: .12em 0; }
.md li > ul, .md li > ol { margin: .1em 0 .2em; }
.md li.md-task { list-style: none; margin-left: -1.35em; display: flex; gap: .5em; align-items: flex-start; }
.md li.md-task > input { margin-top: .32em; accent-color: var(--accent); flex: none; }
.md li.md-task.done > span { color: var(--muted); text-decoration: line-through; }
.md blockquote { margin: 0 0 .5em; padding: 2px 0 2px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--fill-2); padding: .1em .35em; border-radius: 5px; }
.md pre { margin: 0 0 .5em; padding: 10px 12px; background: var(--fill-2); border-radius: var(--radius-s); overflow-x: auto; white-space: pre-wrap; }
.md pre code { background: none; padding: 0; font-size: .86em; }
.md hr { border: 0; border-top: 1px solid var(--separator); margin: .8em 0; }
.md a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.md .cimgs { margin: 6px 0; }

/* editor */
.md-editor { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); }
.md-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint, rgba(255, 95, 52, .15)); }
.md-toolbar { display: flex; align-items: center; gap: 1px; padding: 4px 6px; border-bottom: 1px solid var(--separator); overflow-x: auto; scrollbar-width: none; }
.md-toolbar::-webkit-scrollbar { display: none; }
.md-tb { flex: none; display: inline-grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--text-2); cursor: pointer; padding: 0; }
.md-tb:hover { background: var(--hover); color: var(--text); }
.md-tb.on { background: var(--fill); color: var(--accent); }
.md-sep { flex: none; width: 1px; height: 18px; background: var(--separator); margin: 0 4px; }
.md-area { position: relative; min-height: 120px; max-height: 60vh; overflow-y: auto; padding: 10px 12px; outline: none; color: var(--text); cursor: text; }
.md-area.is-empty::before { content: attr(data-placeholder); color: var(--placeholder); position: absolute; top: 10px; left: 12px; right: 12px; pointer-events: none; }
.md-editor.compact .md-area.is-empty::before { top: 8px; left: 10px; }
.md-area .md-att { display: inline-block; vertical-align: middle; margin: 2px; border-radius: 6px; overflow: hidden; border: 1px solid var(--separator); user-select: none; }
.md-area .md-att img { display: block; height: 56px; width: auto; }
.md-editor.compact .md-tb { width: 28px; height: 26px; }
.md-editor.compact .md-area { min-height: 44px; max-height: 220px; padding: 8px 10px; }
.md-mentions:empty { display: none; }
.md-mentions { position: absolute; left: 8px; bottom: 100%; margin-bottom: 4px; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); padding: 4px; min-width: 220px; }
.desc.md-view { white-space: normal; }
@media (max-width: 640px) {
  .md-tb { width: 36px; height: 34px; }
  .md-area { font-size: 16px; }
}

/* setas de status (voltar ‹ e avançar ›) junto da bolinha e do status */
.st-step { flex: none; display: inline-grid; place-items: center; width: 18px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; opacity: .75; transition: opacity .12s, color .12s, background .12s; }
.st-step.prev .icon { transform: scaleX(-1); }
.lrow:hover .st-step, .st-step:focus-visible, .prop .st-step { opacity: 1; }
.st-step:hover:not(:disabled) { color: var(--accent); background: var(--hover); }
.st-step:disabled { opacity: 0 !important; cursor: default; }
.lcell.lchk, .lcell.lstatus { display: flex; align-items: center; gap: 2px; }
.lcell.lchk { justify-content: center; padding: 4px 2px; }
.lcell.lstatus .pill { min-width: 0; }
@media (hover: none) { .st-step { opacity: .9; width: 24px; height: 32px; } }
.warn-text { color: var(--orange, #c2410c); }

/* Coluna de link, e-mail e telefone na lista: texto + abrir e copiar (aparecem ao passar o mouse na linha). */
.lcell.llink { gap: 2px; }
.lcell.llink > .lfield { flex: 1 1 auto; min-width: 0; }
.llink-btns { display: inline-flex; flex: 0 0 auto; gap: 0; opacity: 0; transition: opacity .12s; }
.lrow:hover .llink-btns, .llink-btns:focus-within { opacity: 1; }
.llink-btns .icon-btn.tiny { width: 24px; height: 24px; }
@media (hover: none) { .llink-btns { opacity: 1; } }

/* Arrastar coluna pelo cabeçalho da lista. */
.lhcell[data-col] { cursor: grab; }
body.col-moving, body.col-moving * { cursor: grabbing !important; user-select: none; }
.lhcell.col-drag-src { opacity: .35; }
.col-drag-ghost { position: fixed; z-index: 1000; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--surface); color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.col-drop-marker { position: fixed; z-index: 999; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--accent); pointer-events: none; }

/* Hora opcional ao lado da data (início e prazo). Cabe na metade do painel da tarefa. */
.date-time { gap: 4px; min-width: 0; }
.date-time .input.date { min-width: 0; flex: 1 1 128px; max-width: 150px; }
.date-time .input.time { width: 82px; min-width: 0; flex: 0 1 82px; padding-left: 6px; padding-right: 4px; }
.prop-value .date-time .input.time { height: 32px; border-color: transparent; background-color: var(--fill-2); }
.prop-value .date-time .input.time:hover { background-color: var(--fill); }
.date-time .input.time:disabled { opacity: .45; }
.cal-chip-time { font-weight: 650; }

/* Caixa de comentário da tarefa: alta o bastante para o texto de exemplo inteiro e algumas linhas. */
.composer .md-editor.compact .md-area { min-height: 96px; max-height: 320px; }
@media (max-width: 640px) { .composer .md-editor.compact .md-area { min-height: 72px; max-height: 40vh; } }
/* O ícone de relógio do Chrome tomava o espaço da hora ("14:0"); a hora se digita ou muda com as setas. */
.date-time .input.time::-webkit-calendar-picker-indicator { display: none; }
.date-time .input.time { width: 72px; flex-basis: 72px; text-align: center; }

/* ---------------------------------------------------------------- campo de data DD/MM/AAAA e calendário */
.datefield { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.datefield > .input { width: 100%; min-width: 0; padding-right: 30px; font-variant-numeric: tabular-nums; }
.datefield:not(.compact):not(.df-prop) > .input { min-width: 150px; }
.datefield.compact > .input { width: 128px; }
.datefield.df-prop > .input { min-width: 0; }
.df-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; }
.df-btn:hover { background: var(--fill); color: var(--text); }
.datefield.disabled { opacity: .5; }
.date-time .datefield { flex: 1 1 128px; max-width: 150px; }
.tf-text { font-variant-numeric: tabular-nums; }
.datepick { position: fixed; z-index: 3000; width: 252px; padding: 10px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--separator); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13.5px; }
.dp-head .icon-btn:first-child .icon { transform: scaleX(-1); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.dp-day { height: 30px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--fill); }
.dp-day.other { color: var(--muted); opacity: .6; }
.dp-day.today { color: var(--accent); font-weight: 700; }
.dp-day.on { background: var(--accent); color: #fff; font-weight: 700; }
.dp-foot { display: flex; align-items: center; gap: 4px; margin-top: 8px; border-top: 1px solid var(--separator); padding-top: 8px; }

/* ---------------------------------------------------------------- comentários: conversa dentro do comentário */
.comment-body { color: var(--text-2); font-weight: 400; }
.comment-head b { color: var(--text); }
.thread { margin-bottom: 14px; }
.thread .comment { margin-bottom: 6px; }
.thread-replies { margin: 2px 0 4px 36px; padding-left: 12px; border-left: 2px solid var(--separator); }
.thread-replies .comment { margin-bottom: 10px; }
.comment.reply .comment-body { font-size: 13.5px; }
.comment-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.comment-foot .link-btn { font-size: 12.5px; padding: 2px 4px; color: var(--muted); }
.comment-foot .link-btn:hover { color: var(--link); }
.reply-box { margin: 4px 0 10px; }
.reply-box .md-editor.compact .md-area { min-height: 64px; }

/* ---------------------------------------------------------------- linha do tempo: subtarefas e mãe pelas subtarefas */
.tl-label .caret, .tl-label .caret-space { flex: none; width: 20px; }
.tl-label .caret { height: 20px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 5px; cursor: pointer; padding: 0; }
.tl-label .caret:hover { background: var(--fill); color: var(--text); }
.tl-label .meta-count { flex: none; }
.tl-row.ctx .tl-label a { color: var(--muted); }
.tl-row.ctx .tl-bar { opacity: .4; }
.tl-bar.rollup { background: transparent !important; color: var(--text-2); border: 2px solid currentColor; border-top-width: 4px; box-shadow: none; cursor: pointer; top: 9px; height: 16px; }
.tl-bar.rollup .tl-bar-title { color: var(--text); text-shadow: none; font-weight: 650; }
.tl-filters { margin-bottom: 10px; }

/* ---------------------------------------------------------------- painel da equipe */
.team-filters { margin-bottom: 8px; }
.team-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0 0 10px; font-size: 12.5px; color: var(--text-2); }
.team-leg { display: inline-flex; align-items: center; gap: 6px; }
.team-wrap { overflow: auto; max-height: calc(100vh - var(--topbar) - 190px); border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); }
.team { min-width: max-content; }
.team-row { display: flex; border-bottom: 1px solid var(--border); }
.team-block { border-bottom: 2px solid var(--separator); }
.team-block .team-row:last-child { border-bottom: 0; }
.team-label { position: sticky; left: 0; z-index: 3; width: 300px; min-width: 300px; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  background: var(--surface); border-right: 1px solid var(--border); font-size: 13px; }
.tl-header .team-label { align-items: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 12px; z-index: 5; }
.team-label-sub { padding: 0; }
.team-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.team-who > b { font-size: 14px; }
.team-kpis { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 3px; }
.team-kpi { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 10px; background: var(--fill-2); font-size: 12px; color: var(--text-2); cursor: default; }
.team-kpi b { color: var(--text); }
.team-kpi.bad { background: var(--red-tint); color: var(--red); }
.team-kpi.bad b { color: var(--red); }
.team-kpi-text { font-size: 12px; color: var(--muted); }
.team-kpi-text b { color: var(--text-2); font-weight: 600; }
.team-track { position: relative; flex: none; background-image: linear-gradient(to right, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px); }
.team-person .team-track { display: flex; align-items: center; }
.team-heat { position: relative; height: 22px; align-self: center; }
.heat-cell { position: absolute; top: 0; height: 22px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--text);
  background: color-mix(in srgb, var(--green) calc(18% + var(--lv) * 45%), transparent); }
.heat-cell.over { background: color-mix(in srgb, var(--red) 70%, transparent); color: #fff; }
.team-bars { min-height: 34px; }
.team-bar { position: absolute; height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 7px; border: 0; border-radius: 5px; cursor: pointer;
  background: var(--c); color: #fff; font: inherit; font-size: 12px; font-weight: 600; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); text-align: left; }
.team-bar:hover { filter: brightness(1.08); z-index: 2; }
.team-bar.closed { opacity: .4; }
.team-bar.late { box-shadow: 0 0 0 2px var(--red); }
.team-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.team-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.team-bar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.team-bar-end { flex: none; font-weight: 500; opacity: .85; font-size: 11px; }
@media (max-width: 640px) {
  .team-label { width: 190px; min-width: 190px; }
  .team-kpi-text { display: none; }
}

/* ---------------------------------------------------------------- editor de template */
.tpl-tree { display: flex; flex-direction: column; gap: 8px; }
.tpl-node { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--separator); border-radius: 10px; background: var(--surface); }
.tpl-node .tpl-node { margin-top: 2px; }
.tpl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-row > .input:not(.compact) { flex: 1 1 220px; min-width: 0; }
.tpl-days-l { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tpl-days.input { width: 64px; min-width: 0; flex: none; }
.tpl-row2 .input.compact { width: auto; }
.tpl-desc summary { cursor: pointer; }
.tpl-desc textarea { margin-top: 4px; width: 100%; }

/* ---------------------------------------------------------------- Conversas (painel do time) */
.conv-intro { max-width: 760px; margin: -4px 0 12px; }
.conv-list { display: flex; flex-direction: column; gap: 12px; max-width: 860px; margin-top: 10px; }
.conv-card { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-sm); border: 1px solid var(--separator); overflow: hidden; }
.conv-card.unread { border-color: color-mix(in srgb, var(--accent) 45%, var(--separator)); }
.conv-card.resolved { opacity: .72; }
.conv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--separator); background: var(--surface-3); flex-wrap: wrap; }
.conv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.conv-task { color: var(--text); font-weight: 600; min-width: 0; word-break: break-word; }
.conv-card.unread .conv-task { font-weight: 700; }
.conv-task:hover { color: var(--link); text-decoration: none; }
.conv-where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }
.conv-people { display: inline-flex; }
.conv-people .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface-3); }
.conv-head .icon-btn.on { color: var(--accent); }
.conv-body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.conv-msg { display: flex; gap: 10px; align-items: flex-start; }
.conv-msg-main { flex: 1; min-width: 0; }
.conv-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conv-msg-head b { font-weight: 650; }
.conv-msg.is-new { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: var(--radius-s); padding: 6px; margin: -6px; }
.conv-new { font-size: 11px; font-weight: 700; color: var(--accent-text, var(--accent)); background: var(--accent-tint); border-radius: 10px; padding: 1px 7px; }
.conv-replies { display: flex; flex-direction: column; gap: 10px; margin-left: 20px; padding-left: 14px; border-left: 2px solid var(--separator); }
.conv-older { align-self: flex-start; padding: 0; font-size: 13px; }
.conv-reply { margin-left: 40px; }
.conv-reply-open { width: 100%; display: flex; align-items: center; gap: 8px; border: 1px solid var(--separator); background: var(--field, transparent); color: var(--placeholder); border-radius: var(--radius); padding: 9px 12px; font: inherit; cursor: text; text-align: left; }
.conv-reply-open:hover { border-color: var(--border-strong); }
.conv-reply-actions { margin-top: 6px; }
.conv-more { display: flex; justify-content: center; padding: 12px 0 24px; max-width: 860px; }
.conv-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--link); background: var(--link-tint); border-radius: 10px; padding: 1px 7px; text-decoration: none !important; }
@media (max-width: 640px) {
  .conv-head { padding: 10px 12px; }
  .conv-where { max-width: 100%; flex-basis: 100%; }
  .conv-filters .input[type=search] { flex: 1 1 100%; width: 100%; max-width: none; }
  .conv-body { padding: 12px; }
  .conv-replies { margin-left: 6px; padding-left: 10px; }
  .conv-reply { margin-left: 0; }
}

/* Pesquisa rápida (Ctrl+K / ⌘K) */
.modal.palette { max-width: 640px; margin-top: 5vh; padding: 0; overflow: hidden; }
.modal.palette .modal-body { padding: 0; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--separator); color: var(--muted); }
.palette-input { flex: 1; min-width: 0; height: 52px; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.palette-input::-webkit-search-cancel-button { display: none; }
.palette-input:focus, .palette-input:focus-visible { outline: none; border: 0; box-shadow: none; }
.palette-results { max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.palette-item > .icon { color: var(--muted); flex: none; }
.palette-item.on { background: var(--accent-tint); }
.palette-item .pill { flex: none; }
.palette-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 18px 12px; }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--separator); }
.palette-foot kbd { margin-right: 2px; }
@media (max-width: 640px) { .modal.palette { margin-top: 0; border-radius: 14px; padding-top: 0; animation: pop-in .2s ease; } .palette-foot { display: none; } }

/* Tarefa no celular: duas abas, Tarefa e Comentários (a de comentários ocupa a tela, com o campo de comentar embaixo) */
.tv-mtabs { display: none; }
@media (max-width: 900px) {
  .tv-head { flex-wrap: wrap; row-gap: 6px; }
  .tv-mtabs { display: grid; grid-template-columns: 1fr 1fr; flex-basis: 100%; gap: 2px; padding: 2px; margin-right: 8px; border-radius: 9px; background: var(--fill); }
  .tv-mtabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .tv-mtabs button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
  .task-view:not(.mpane-side) .tv-side { display: none; }
  .task-view.mpane-side .tv-main { display: none; }
  .task-view.mpane-side .tv-side { border-top: 0; min-height: calc(100dvh - 110px - env(safe-area-inset-top)); }
  .task-view.pane-anim.mpane-side .tv-side { animation: pane-in .22s cubic-bezier(.3, .7, .4, 1); }
  .task-view.mpane-side .tv-side .tabs.seg-tabs { margin-top: 10px; }
  .task-view.pane-anim:not(.mpane-side) .tv-main { animation: pane-back .22s cubic-bezier(.3, .7, .4, 1); }
}
@keyframes pane-in { from { opacity: .4; transform: translateX(24px); } }
@keyframes pane-back { from { opacity: .4; transform: translateX(-24px); } }
@media (prefers-reduced-motion: reduce) { .task-view .tv-side, .task-view .tv-main { animation: none !important; } }

/* Descrição em tela cheia: só o texto, largura de leitura, barra de formatação presa no topo */
.overlay.flush { padding: 0; }
.modal.task-modal.desc-full-modal { max-width: none; width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
.task-view.desc-full { display: flex; flex-direction: column; height: 100%; width: 100%; }
.df-head { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px 24px; border-bottom: 1px solid var(--separator); flex: none; }
.df-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.df-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.df-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.df-body { max-width: 780px; margin: 0 auto; padding: 28px 24px 80px; }
.df-body .md-view, .df-body .md-area { font-size: 16px; line-height: 1.65; }
.df-body .md-editor .md-toolbar { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.df-body .md-editor .md-area { min-height: calc(100dvh - 220px); max-height: none; overflow: visible; }
@media (max-width: 640px) { .df-head { padding-left: 16px; } .df-head .btn span, .df-head .btn { white-space: nowrap; } .df-body { padding: 16px 16px 60px; } }

/* Itens de lista no editor: alça para arrastar (aparece com o mouse em cima) e marcador de onde vai cair */
.md-area li { position: relative; }
@media (hover: hover) {
  .md-area li::before { content: ''; position: absolute; left: -2.35em; top: .25em; width: .8em; height: 1.1em; opacity: 0; cursor: grab; border-radius: 3px;
    background: radial-gradient(circle, var(--muted) 1.1px, transparent 1.3px) 0 0 / .4em .37em; transition: opacity .12s; }
  .md-area li:hover:not(:has(li:hover))::before { opacity: .8; }
}
.md-area li.li-dragging { opacity: .45; }
.li-drop-marker { position: fixed; height: 2px; background: var(--accent); border-radius: 1px; z-index: 300; pointer-events: none; }
.md-tb.off { opacity: .35; }

/* ================================================================ sprints */
.sp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sp-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.sp-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .08)); text-decoration: none; }
.sp-card.closed { opacity: .75; }
.sp-card-head { display: flex; align-items: center; gap: 8px; }
.sp-card-head .icon { color: var(--accent); flex: none; }
.sp-card-head b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-card-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-2); }
.sp-closed { margin-top: 22px; }
.sp-closed > summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.late-text { color: var(--red); font-weight: 600; }
.sp-progress { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--fill); }
.sp-progress { gap: 2px; }
.sp-progress > span { display: block; height: 100%; }
.sp-progress > span:empty[style*='width: 0%'] { display: none; }
.sp-p-done { background: var(--chart-done); }
.sp-p-prog { background: var(--chart-prog); }
.sp-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.sp-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.sp-dates { display: inline-flex; align-items: center; gap: 5px; }
.sp-desc { max-width: 720px; }
.sp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--text-2); }
.sp-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--fill); }
.sp-leg-done i { background: var(--chart-done); }
.sp-leg-in_progress i { background: var(--chart-prog); }
.sp-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.sp-filters { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.sp-group { margin-bottom: 18px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sp-group-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface-3); border-bottom: 1px solid var(--separator); font-weight: 600; }
.sp-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 5px 12px 5px 8px; border-bottom: 1px solid var(--separator); }
.sp-row:last-child { border-bottom: 0; }
.sp-row:hover { background: var(--hover); }
.sp-row.closed .tlink { color: var(--muted); }
.sp-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.sp-main .tlink { min-width: 0; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; flex-basis: 100%; font-size: 12px; }
.sp-meta a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.sp-meta a:hover { color: var(--link); text-decoration: none; }
.sp-mother { color: var(--text-2) !important; }
.sp-status { display: inline-flex; align-items: center; flex: none; }
.sp-due { display: inline-flex; align-items: center; gap: 4px; flex: none; min-width: 0; }
.sp-due.after-end { color: var(--orange, #ea580c); }
.sp-due.after-end .due { color: var(--orange, #ea580c); font-weight: 600; }
.sp-noone { flex: none; }
.sp-empty { padding: 14px 16px; }
.sp-group .sub-hidden-note { margin: 4px 8px 6px; }
.sp-pick { padding: 8px 10px; border: 1px solid var(--separator); border-radius: var(--radius-s); }
.sp-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 8px; border-radius: 12px; background: var(--accent-tint); font-size: 12.5px; }
.sp-chip a { color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.sp-chip a .icon { color: var(--accent); }
.sp-chip.closed { background: var(--fill); }
.point-anchor { position: fixed; width: 1px; height: 1px; pointer-events: none; }
.sp-side { display: inline-flex; align-items: center; gap: 12px; flex: none; }
/* Celular: seta e bolinha à esquerda, título ao lado; status, prazo e pessoa na linha de baixo, alinhados com o título */
@media (max-width: 640px) {
  .sp-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 8px; row-gap: 6px; padding-right: 10px; }
  .sp-main { grid-column: 3; }
  .sp-side { grid-column: 3; flex-wrap: wrap; gap: 6px 12px; }
}

/* Painel do sprint. Cores validadas (daltonismo e contraste) para o claro e o escuro:
   concluída verde, em andamento azul, não iniciada = trilho cinza, atrasada vermelho, ideal cinza tracejado. */
:root { --chart-done: #28A745; --chart-prog: #006DF6; --chart-late: #E5383B; --chart-ideal: #8E8E93; --chart-track: rgba(118, 118, 128, .2); --chart-grid: rgba(60, 60, 67, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-done: #25A848; --chart-prog: #3D8EFF; --chart-late: #F2484C; --chart-ideal: #8E8E93; --chart-track: rgba(118, 118, 128, .32); --chart-grid: rgba(255, 255, 255, .1); } }
:root[data-theme="dark"] { --chart-done: #25A848; --chart-prog: #3D8EFF; --chart-late: #F2484C; --chart-ideal: #8E8E93; --chart-track: rgba(118, 118, 128, .32); --chart-grid: rgba(255, 255, 255, .1); }
.chart-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-line { display: inline-block; width: 14px; height: 0; border-top: 2px solid; flex: none; }
.chart-key.k-done { background: var(--chart-done); }
.chart-key.k-prog { background: var(--chart-prog); }
.chart-key.k-track { background: var(--chart-track); }
.chart-key.k-late { background: var(--chart-late); }
.chart-key.k-ideal { background: var(--chart-ideal); }
.chart-line.k-prog { border-color: var(--chart-prog); }
.chart-line.k-ideal { border-color: var(--chart-ideal); border-top-style: dashed; }
.chart-tip { position: fixed; z-index: 400; display: none; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--separator); box-shadow: var(--shadow-lg); font-size: 12.5px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip-row b { font-variant-numeric: tabular-nums; }
.chart-tip-row span { color: var(--text-2); }
.chart-tip-row .chart-key { width: 12px; height: 2px; border-radius: 1px; }
.dash { margin-bottom: 18px; }
.dash-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 6px 4px 2px; margin-bottom: 8px; color: var(--text); font: inherit; font-weight: 650; cursor: pointer; border-radius: 6px; }
.dash-toggle:hover { background: var(--hover); }
.dash.closed .dash-toggle { margin-bottom: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.dash-card { border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; min-width: 0; }
.dash-card h3 { margin: 0; font-size: 14px; }
.dash-wide { grid-column: 1 / -1; }
.dash-sub { margin: 2px 0 10px; font-size: 12px; color: var(--muted); }
.dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.dash-tile { display: flex; flex-direction: column; gap: 2px; }
.dash-tile-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.dash-tile-value { font-size: 26px; font-weight: 600; line-height: 1.1; }
.dash-tile-sub { font-size: 12px; color: var(--muted); }
.dash-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--chart-track); }
.dash-seg { display: block; min-width: 3px; cursor: default; }
.dash-seg.k-done { background: var(--chart-done); }
.dash-seg.k-prog { background: var(--chart-prog); }
.dash-seg.k-track { background: transparent; }
.dash-seg:hover, .dash-seg:focus-visible, .load-seg:hover, .load-seg:focus-visible { filter: brightness(1.12); outline: none; }
.dash-alert { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; color: var(--red); font-weight: 600; font-size: 13px; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; font-size: 12px; color: var(--text-2); }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.load-rows { display: flex; flex-direction: column; gap: 8px; }
.load-row { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr); align-items: center; gap: 10px; }
.load-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.load-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.load-bar { display: flex; gap: 2px; height: 16px; min-width: 6px; }
.load-seg { display: block; height: 100%; min-width: 3px; }
.load-seg:first-child { border-radius: 0; }
.load-seg:last-child { border-radius: 0 4px 4px 0; }
.load-seg.k-prog { background: var(--chart-prog); }
.load-seg.k-late { background: var(--chart-late); }
.load-val { font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-2); }
.bd-chart { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; }
.bd-yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 11px; color: var(--muted); text-align: right; margin-top: -6px; margin-bottom: -6px; }
.bd-plot { position: relative; height: 180px; }
.bd-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bd-grid { stroke: var(--chart-grid); stroke-width: 1; }
.bd-ideal { fill: none; stroke: var(--chart-ideal); stroke-width: 2; stroke-dasharray: 5 5; stroke-linecap: round; }
.bd-actual { fill: none; stroke: var(--chart-prog); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bd-area { fill: var(--chart-prog); opacity: .08; }
.bd-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--chart-prog); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.bd-endlabel { position: absolute; transform: translate(8px, -22px); font-size: 12px; font-weight: 600; pointer-events: none; }
.bd-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-strong); display: none; pointer-events: none; }
.bd-hit { position: absolute; inset: 0; cursor: crosshair; outline: none; }
.bd-xaxis { display: flex; justify-content: space-between; margin: 4px 0 0 34px; font-size: 11px; color: var(--muted); }
.bd-table { margin-top: 8px; font-size: 12px; }
.bd-table summary { cursor: pointer; color: var(--muted); }
.bd-table table { border-collapse: collapse; margin-top: 6px; }
.bd-table th, .bd-table td { padding: 2px 12px 2px 0; text-align: left; font-variant-numeric: tabular-nums; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 10px; }
.att-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.att-head .att-n { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-2); }
.att-late .icon { color: var(--red); }
.att-stale .icon { color: var(--muted); }
.att-after .icon { color: var(--orange); }
.att-list { display: flex; flex-direction: column; }
.att-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.att-row:hover { background: var(--hover); }
.att-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-info { flex: none; font-size: 12px; color: var(--muted); }
.att-more, .att-none { padding: 4px 6px; }
@media (max-width: 640px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .dash-tile-value { font-size: 22px; } }
.sp-home:empty { display: none; }
.sp-home { margin-bottom: 14px; }
.sp-home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.sp-home-card { padding: 11px 14px; gap: 7px; }
.sp-home-pct { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ================================================================ metas de alunos (sprint) e vendas */
.goals { margin: 0 0 18px; }
.goals-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.goals-head h3 { margin: 0; font-size: 15px; flex: 1; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.goal-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); }
.goal-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.goal-head > .icon { color: var(--accent); flex: none; }
.goal-name { flex: 1; min-width: 0; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.goal-name:hover { color: var(--link); text-decoration: none; }
.goal-num { display: flex; align-items: baseline; gap: 4px; }
.goal-num b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.goal-pct { margin-left: auto; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.goal-pct.hit { color: var(--green); }
.goal-bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.goal-bar > span { display: block; height: 100%; background: var(--chart-done); border-radius: 4px; transition: width .2s; }
.goal-bar.hit > span { background: var(--green); }
.goal-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--text-2); }
.goal-empty { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 16px; }
.goal-mini { display: flex; flex-direction: column; gap: 5px; }
.goal-mini-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; font-size: 12.5px; }
.goal-mini-row .goal-bar { grid-column: 1 / -1; height: 4px; }
.goal-mini-name { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.goal-mini-name .icon { color: var(--accent); flex: none; }
.goal-mini-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.prod-chip { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; min-height: 24px; padding: 2px 8px; border-radius: 12px; background: var(--accent-tint); font-size: 12.5px; }
.prod-chip > .icon { color: var(--accent); }
.names-pick { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; border: 1px solid var(--separator); border-radius: var(--radius-s); padding: 4px 8px; }
.name-pick { padding: 5px 0; border-bottom: 1px solid var(--separator); }
.name-pick:last-child { border-bottom: 0; }
.input.seats-in { width: 80px; flex: none; }
tr.row-warn td { background: var(--warn-bg); }
.goal-plus { flex: none; height: 24px; min-width: 34px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--separator); background: var(--fill); color: var(--text); font-weight: 650; font-size: 12.5px; cursor: pointer; }
.goal-plus:hover { border-color: var(--accent); color: var(--accent-text, var(--accent)); }
.status-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.status-checks .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 2px; }


/* ================================================================ CRM: moldura e peças comuns */

.nav-item.sub { min-height: 28px; padding: 3px 10px 3px 37px; font-size: 13.5px; color: var(--text-2); }
.nav-item.sub.active { color: var(--accent-text); }
.nav-count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 8px; }
.nav-item.active .nav-count { color: var(--accent-text); }
.sidebar .grow { flex: 1; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { white-space: normal; }
.page-sub { color: var(--muted); font-size: 13px; margin: -10px 0 16px; }
.panel { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { margin-bottom: 12px; }
.panel.tight { padding: 12px 14px; }
.panels-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.panels-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .panels-2, .panels-3 { grid-template-columns: 1fr; } }

/* Tabela de dados (contatos, campanhas, listas) */
.table-wrap { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-sm); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--separator); white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table tr.selected td { background: var(--accent-tint); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--text); font-weight: 600; }
.table .muted { font-size: 12.5px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager { display: inline-flex; gap: 4px; align-items: center; }

/* Filtros em linha */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters .input { width: auto; min-width: 140px; height: 32px; font-size: 13px; }
.filters .search { min-width: 240px; }

/* Status e chips */
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-badge.active, .status-badge.sent, .status-badge.done { background: var(--green-tint); color: var(--green); }
.status-badge.unsubscribed, .status-badge.paused, .status-badge.inactive, .status-badge.cancelled { background: var(--fill); color: var(--muted); }
.status-badge.bounced, .status-badge.failed { background: var(--red-tint); color: var(--red); }
.status-badge.scheduled, .status-badge.sending, .status-badge.running, .status-badge.waiting { background: var(--link-tint); color: var(--link); }
.status-badge.draft, .status-badge.pending { background: var(--fill); color: var(--text-2); }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; padding: 2px 8px 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--tag, #6B7280) 14%, transparent); color: var(--text); white-space: nowrap; max-width: 100%; }
.tag-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--tag, #6B7280); flex: none; }
.tag-chip .chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
.tag-chip .chip-x:hover { color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* Indicadores (relatórios) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.stat .stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .stat-sub { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.bar.blue > i { background: var(--link); }
.bar.green > i { background: var(--green); }

/* Assistente em passos (campanha) */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-steps .step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 13px; font-weight: 600; }
.wizard-steps .step .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 11.5px; }
.wizard-steps .step.on { background: var(--accent-tint); color: var(--accent-text); }
.wizard-steps .step.done { color: var(--green); }
.wizard-steps .step.done .n { background: var(--green); color: #fff; }
.wizard-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* Caixas de aviso */
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--link-tint); color: var(--text); font-size: 13.5px; margin-bottom: 12px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.notice.err { background: var(--red-tint); color: var(--red); }
.notice.ok { background: var(--green-tint); color: var(--green); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv > b { color: var(--muted); font-weight: 600; }
code.inline { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--fill-2); padding: 1px 6px; border-radius: 5px; word-break: break-all; }
.copy-box { display: flex; gap: 6px; align-items: center; }
.copy-box .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* Celular: a barra de abas de baixo troca Espaços por Mais */
@media (max-width: 1100px) {
  .sidebar .nav-section { padding-top: 12px; }
}
