/* DayPlanner — visual. Cores e medidas ficam nas variáveis abaixo. */

:root {
  color-scheme: light;
  --bg: #f8f7f4;
  --side: #f1f0eb;
  --surface: #ffffff;
  --well: #efeee9;
  --hover: rgba(26, 26, 25, .055);
  --active: rgba(26, 26, 25, .09);
  --border: #e4e3dc;
  --border-strong: #d0cfc7;
  --text: #1a1a19;
  --text-2: #52514e;
  --text-3: #898781;
  --accent: #2a78d6;
  --ink: #1a1a19;
  --ink-text: #ffffff;
  --danger: #d03b3b;
  --ok: #1baf7a;
  /* gráfico */
  --grid: #e6e5df;
  --axis: #c3c2b7;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-mute: #cfcec6;
  --shadow-1: 0 1px 2px rgba(26, 26, 25, .06);
  --shadow-2: 0 6px 20px rgba(26, 26, 25, .10), 0 1px 3px rgba(26, 26, 25, .06);
  --shadow-3: 0 24px 64px rgba(26, 26, 25, .24), 0 2px 8px rgba(26, 26, 25, .08);
  --r: 10px;
  --r-sm: 8px;
  --r-lg: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-d: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413;
  --side: #0f0f0e;
  --surface: #1e1e1c;
  --well: #191918;
  --hover: rgba(240, 239, 236, .07);
  --active: rgba(240, 239, 236, .11);
  --border: #2e2e2b;
  --border-strong: #42423e;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #8f8d86;
  --accent: #3987e5;
  --ink: #f0efec;
  --ink-text: #1a1a19;
  --danger: #e66767;
  --ok: #199e70;
  --grid: #2c2c2a;
  --axis: #42423e;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-mute: #55554f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-3: 0 24px 64px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.ico { flex: none; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.late { color: var(--danger); font-weight: 600; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }
*::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }

kbd {
  font: 600 10.5px var(--font);
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(127, 127, 127, .22);
  opacity: .8;
}

/* ---------- estrutura ---------- */

.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); height: 100vh; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--side);
  border-right: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 18px;
  font: 600 16px var(--font-d);
  letter-spacing: -.01em;
}
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 12px; }
.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  margin: 14px 0 2px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.side-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 8px 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.side-item:hover { background: var(--hover); color: var(--text); }
.side-item.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }
.side-item.drop-hover { background: color-mix(in srgb, var(--accent) 16%, transparent); outline: 1.5px dashed var(--accent); outline-offset: -2px; }
.side-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .ico { color: var(--text-3); }
.side-item .dot { margin: 0 3px; }
.count { font-size: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-more { display: none; margin-right: -4px; }
.side-item:hover .side-more, .side-more:focus-visible { display: grid; }
.side-item:hover .count:has(+ .side-more) { display: none; }
.side-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-3);
  text-align: left;
}
.side-add:hover { background: var(--hover); color: var(--text); }
.side-task {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 30px;
  padding: 4px 8px 4px 13px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  color: var(--text-2);
}
.side-task:hover { background: var(--hover); color: var(--text); }
.side-task span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-task small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.side-task small.late { color: var(--danger); }
.side-empty { padding: 4px 10px; font-size: 12.5px; color: var(--text-3); }
.side-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

.dot { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--text-3)); }

.topbar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px; flex: none; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 40vw);
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-3);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.tabs {
  display: flex;
  gap: 2px;
  flex: none;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 11px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab .ico { color: var(--text-3); }
.tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.tab.active .ico { color: var(--accent); }

.view { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px 28px; }
.view.fill { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 20px; }

.view-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex: none; }
.view-head h1, .cal-toolbar h1 { font: 600 21px/1.2 var(--font-d); letter-spacing: -.015em; }
.view-head p { margin-top: 3px; color: var(--text-2); max-width: 110ch; }
.view-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.summary { color: var(--text-2); font-size: 13px; }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-bottom: 16px;
  padding: 9px 10px 9px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--r);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--text-2);
}
.banner > span { flex: 1; }
.banner > .ico { color: var(--accent); }
.banner strong { color: var(--text); }
.banner.error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--text); }
.banner.error > .ico { color: var(--danger); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 64px 20px;
  color: var(--text-3);
  text-align: center;
}
.empty strong { margin-top: 6px; font-size: 15px; color: var(--text); }
.empty span { max-width: 46ch; }
.empty .btn { margin-top: 14px; }

/* ---------- botões e campos ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: color-mix(in srgb, var(--text) 5%, var(--surface)); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.ghost.danger { color: var(--danger); }
.btn.ghost.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.btn.ghost[aria-pressed="true"] { color: var(--text); background: var(--active); }
.btn.danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; gap: 5px; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 6px; color: var(--text-3); }
.icon-btn.linked { color: var(--accent); }
.badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font: 700 10px/16px var(--font);
  text-align: center;
}

.input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  outline: 0;
}
textarea.input { height: auto; min-height: 36px; padding: 8px 11px; resize: vertical; field-sizing: content; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.input.sm { height: 30px; padding: 0 9px; font-size: 13px; }
.input::placeholder, textarea::placeholder, input::placeholder { color: var(--text-3); }
select.input { padding-right: 6px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 14px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field > span { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.field > span em { font-style: normal; font-weight: 400; color: var(--text-3); }
.inline { display: flex; align-items: center; gap: 6px; }
.title-input { height: 44px; font: 600 17px var(--font-d); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--well); width: fit-content; }
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font-size: 12px;
}
.chip-btn:hover { border-color: var(--accent); color: var(--text); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  outline-offset: 2px;
}
.swatch.none { background: var(--surface); border: 1.5px dashed var(--border-strong); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

.switch { position: relative; display: inline-block; flex: none; width: 38px; height: 22px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: var(--border-strong); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .15s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:disabled + i { opacity: .45; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- etiquetas e cartão de tarefa ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--text-3)) 15%, transparent);
  color: color-mix(in srgb, var(--c, var(--text-3)) 55%, var(--text));
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; }
.meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.meta.today { color: var(--text); font-weight: 600; }
.meta.overdue { color: var(--danger); font-weight: 600; }
.meta.bell-on { color: var(--accent); }

.task {
  position: relative;
  display: flex;
  gap: 10px;
  flex: none;
  padding: 10px 12px 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: box-shadow .12s, border-color .12s;
}
.task::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c, transparent);
}
.task:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.task.dragging { opacity: .35; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 7px; }
.task.is-done .task-title { color: var(--text-3); text-decoration: line-through; }
.task.is-done .chip { opacity: .6; }

.check {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: none;
  color: transparent;
}
.check.sq { border-radius: 5px; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.on { border-color: var(--ok); background: var(--ok); color: #fff; }

.quick-add {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 34px;
  padding: 0 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text-3);
}
.quick-add:focus-within { border-style: solid; border-color: var(--accent); background: var(--surface); }
.quick-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); }

.drop-line { flex: none; height: 3px; margin: -2px 0; border-radius: 3px; background: var(--accent); }

/* ---------- Kanban ---------- */

.kanban { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; }
.kcol {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 10px 4px;
  border-radius: var(--r-lg);
  background: var(--well);
}
.kcol-head { display: flex; align-items: center; gap: 8px; height: 26px; margin-bottom: 10px; padding: 0 4px; flex: none; }
.kcol-head h2, .quad-head h2 { font-size: 14px; font-weight: 600; }
.kcol .quick-add { margin: 0 0 8px; }
.kcol-list {
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -6px;
  padding: 2px 6px 10px;
  border-radius: var(--r);
}
.kcol-list.drop-hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.kcol-empty { padding: 14px 6px; font-size: 13px; color: var(--text-3); text-align: center; }

/* ---------- Eisenhower ---------- */

.eis { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; }
.eis-board { display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: 22px minmax(0, 1fr); gap: 6px; min-height: 0; }
.eis-top, .eis-left { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); }
.eis-top { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: center; align-items: center; }
.eis-left { grid-row: 2; display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.eis-left span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.eis-grid { grid-row: 2; grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-height: 0; }
.quad, .eis-inbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  padding: 12px;
  border-radius: var(--r-lg);
}
.quad {
  border: 1px solid color-mix(in srgb, var(--c) 38%, var(--border));
  background: color-mix(in srgb, var(--c) 13%, var(--surface));
}
.eis-inbox { background: var(--well); }
.quad.drop-hover, .eis-inbox.drop-hover { outline: 2px dashed color-mix(in srgb, var(--c, var(--accent)) 80%, var(--text)); outline-offset: -3px; }
.quad-head { display: flex; align-items: center; gap: 10px; flex: none; }
.quad-head > div { flex: 1; min-width: 0; }
.quad-tag { display: block; font-size: 12px; line-height: 1.35; color: var(--text-2); }
.quad-head { align-items: flex-start; }
.quad-head .count { margin-top: 5px; }
.quad-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.quad-n.plain { background: var(--surface); color: var(--text-2); text-shadow: none; }
.quad-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 0 -4px; padding: 2px 4px; }
.quad .quick-add { border-color: color-mix(in srgb, var(--c) 45%, var(--border-strong)); }
.quad-action { margin-right: 3px; font-weight: 700; font-style: italic; color: color-mix(in srgb, var(--c) 58%, var(--text)); white-space: nowrap; }

/* ---------- Calendário ---------- */

.cal { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
.cal-main { display: flex; flex-direction: column; min-height: 0; }
.cal-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex: none; }
.cal-toolbar h1 span { color: var(--text-3); font-weight: 400; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); flex: none; padding-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.cal-week span { padding-left: 8px; }
.cal-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(var(--weeks, 6), minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.cal-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 4px 5px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.weekend { background: color-mix(in srgb, var(--well) 55%, var(--surface)); }
.cal-day.other .cal-num > span:first-child { color: var(--text-3); opacity: .6; }
.cal-day.other .cal-ev { opacity: .55; }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.drop-hover { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.cal-num { display: flex; align-items: center; justify-content: space-between; height: 24px; flex: none; }
.cal-num > span:first-child { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-num > span:first-child { background: var(--ink); color: var(--ink-text); }
.cal-add { visibility: hidden; width: 22px; height: 22px; }
.cal-day:hover .cal-add, .cal-add:focus-visible { visibility: visible; }
.cal-ev {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 20px;
  padding: 0 6px;
  border-left: 3px solid var(--c);
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  font-size: 11.5px;
  cursor: pointer;
}
.cal-ev span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-ev.done span { text-decoration: line-through; color: var(--text-3); }
.cal-ev.late { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 55%, transparent); }
.cal-ev.dragging { opacity: .35; }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.cal-more { padding-left: 6px; font-size: 11px; color: var(--text-3); }
.cal-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }
.cal-side h2 { display: flex; align-items: center; gap: 8px; font: 600 16px/1.3 var(--font-d); }
.cal-side h3 { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.cal-side-list { display: flex; flex-direction: column; gap: 8px; }
.cal-alarms { display: flex; flex-direction: column; }
.cal-foot { font-size: 12.5px; color: var(--text-3); }

.row-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
}
.row-btn:hover { background: var(--hover); }
.row-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-btn small { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.row-btn small.late { color: var(--danger); }

/* ---------- Anotações ---------- */

.notes { columns: 250px; column-gap: 14px; }
.note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  break-inside: avoid;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}
.note.tinted { background: color-mix(in srgb, var(--c) 13%, var(--surface)); border-color: color-mix(in srgb, var(--c) 30%, var(--border)); }
.note:hover { box-shadow: var(--shadow-2); }
.note header { display: flex; align-items: flex-start; gap: 8px; }
.note h2 { flex: 1; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.note .pin { color: color-mix(in srgb, var(--c, var(--text-3)) 60%, var(--text)); }
.note p { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 12; overflow: hidden; }
.note footer { display: flex; align-items: center; gap: 8px; min-height: 21px; }
.note small { font-size: 11.5px; color: var(--text-3); }
.note-body { min-height: 240px; }

/* ---------- ferramentas: lista de cartões e cabeçalho ---------- */

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  transition: box-shadow .12s, border-color .12s;
}
.tool-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.tool-card-top { display: flex; align-items: center; min-height: 21px; }
.tool-card-top small, .tool-card-stats { font-size: 12px; color: var(--text-3); }
.tool-card h2 { font: 600 16px/1.3 var(--font-d); overflow-wrap: anywhere; }
.tool-card-text { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tool-card-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 4px; }
.tool-card-stats span { display: inline-flex; align-items: center; gap: 5px; }
.tool-card-root { display: flex; gap: 7px; padding: 7px 9px; border-radius: var(--r-sm); background: var(--well); font-size: 12.5px; color: var(--text-2); }
.tool-card-root .ico { margin-top: 2px; }

.tool-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tool-head .btn.ghost { margin-left: -8px; }
.tool-head select { width: 170px; flex: none; }
.tool-title {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  font: 600 21px var(--font-d);
  letter-spacing: -.015em;
  outline: 0;
}
.tool-title:hover { border-color: var(--border); }
.tool-title:focus { border-color: var(--accent); background: var(--surface); }

.goal {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-3);
}
.goal .ico { margin-top: 3px; }
.goal-input, .why-input { flex: 1; width: 100%; border: 0; outline: 0; background: none; resize: none; field-sizing: content; color: var(--text); line-height: 1.5; }

.panel { padding: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-note { margin-top: 10px; font-size: 12px; color: var(--text-3); }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.inline-field .input { width: 170px; }

.grid-table { width: 100%; border-collapse: collapse; }
.grid-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-3);
  white-space: nowrap;
}
.grid-table td { padding: 2px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.grid-table tfoot td { border-bottom: 0; padding-top: 8px; }
.grid-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table td.rank, .grid-table td.calc, .grid-table td.total { padding: 8px; color: var(--text-2); white-space: nowrap; }
.grid-table td.total { font-weight: 700; color: var(--text); }
.grid-table td.rank { width: 34px; color: var(--text-3); }
.cell {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  outline: 0;
  resize: none;
  field-sizing: content;
  line-height: 1.4;
}
.cell:hover { border-color: var(--border); }
.cell:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.cell.num { text-align: right; }
.row-actions { width: 62px; white-space: nowrap; text-align: right; }
.row-actions .icon-btn { display: inline-grid; margin-top: 3px; }

/* ---------- Pareto ---------- */

.pareto { display: grid; grid-template-columns: minmax(360px, 5fr) minmax(380px, 6fr); gap: 16px; align-items: start; }
.pareto .grid-table tr.vital td.rank { color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--series-1); }
.pareto td:nth-child(3) { width: 104px; }
.insight { margin-bottom: 12px; color: var(--text-2); }
.insight strong { color: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; }
.key { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
.bar-key { background: var(--series-mute); }
.bar-key.vital { background: var(--series-1); }
.line-key { width: 14px; height: 2px; border-radius: 1px; background: var(--series-2); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; }
.chart-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 70px 10px; color: var(--text-3); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .threshold { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .tick { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .xlabel { fill: var(--text-2); font-size: 11.5px; }
.chart .direct { fill: var(--text); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.chart .bar { fill: var(--series-mute); transition: opacity .1s; }
.chart .bar.vital { fill: var(--series-1); }
.chart .cum-line { fill: none; stroke: var(--series-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cum-dot { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
.chart .cum-dot.on { r: 5.5; }
.chart.hovering .bar:not(.on) { opacity: .5; }
.chart .hit { fill: transparent; cursor: default; outline: 0; }
.chart .hit:focus-visible { stroke: var(--accent); stroke-width: 1.5; }
.chart-tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
  min-width: 170px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  pointer-events: none;
}
.chart-tip strong { display: block; margin-bottom: 4px; color: var(--text); white-space: normal; }
.chart-tip div { display: flex; align-items: center; }
.chart-tip b { margin-left: auto; padding-left: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 44px; padding-bottom: 1px; border-bottom: 1px solid var(--axis); }
.mini-bars i { width: 14px; border-radius: 3px 3px 0 0; background: var(--series-mute); }
.mini-bars i.vital { background: var(--series-1); }

/* ---------- PDCA ---------- */

.pdca-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
}
.step strong { display: block; font-weight: 600; line-height: 1.25; }
.step small { font-size: 11.5px; color: var(--text-3); }
.step:hover { border-color: var(--border-strong); }
.step.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.step-arrow { color: var(--text-3); display: grid; }
.phase-letter {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 18%, var(--surface));
  color: color-mix(in srgb, var(--c) 68%, var(--text));
  font: 700 16px var(--font-d);
}
.phase-letter.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
.step.on .phase-letter, .step.past .phase-letter { background: var(--c); color: #fff; }
.pdca-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.phase { display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--c); }
.phase.current { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent); }
.phase-head { display: flex; align-items: flex-start; gap: 12px; }
.phase-head > div { flex: 1; min-width: 0; }
.phase-head h2 { font-size: 15px; font-weight: 600; }
.phase-head h2 small { font-size: 12px; font-weight: 400; color: var(--text-3); }
.phase-head p { font-size: 12.5px; color: var(--text-2); }
.area { min-height: 64px; }
.phase-items { display: flex; flex-direction: column; }
.cl-row { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.cl-row .check { margin: 0; }
.cl-text { flex: 1; min-width: 0; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: none; outline: 0; }
.cl-text:hover { border-color: var(--border); }
.cl-text:focus { border-color: var(--accent); background: var(--surface); }
.cl-text.done { color: var(--text-3); text-decoration: line-through; }
.pdca-mini { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.pdca-mini span { display: flex; align-items: center; gap: 6px; flex: 1; font-size: 11px; color: var(--text-3); }
.pdca-mini span.on b { color: var(--text); }
.pdca-mini i { flex: 1; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--c) 22%, var(--well)); overflow: hidden; }
.pdca-mini u { display: block; height: 100%; background: var(--c); }

/* ---------- 5W2H ---------- */

.w5h2 { padding: 6px 6px 10px; }
.table-scroll { overflow-x: auto; }
.w5h2-table { min-width: 1020px; table-layout: fixed; }
.w5h2-table th { padding: 10px 8px 8px; }
.w5h2-table th b { display: block; font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--text); }
.w5h2-table th small { font-size: 10.5px; font-weight: 600; }
.w5h2-table th.w { box-shadow: inset 0 3px 0 #2a78d6; }
.w5h2-table th.h { box-shadow: inset 0 3px 0 #eb6834; }
.w5h2-table .col-where, .w5h2-table .col-who { width: 11%; }
.w5h2-table .col-when { width: 138px; }
.w5h2-table .col-cost { width: 118px; }
.w5h2-table .col-status { width: 136px; }
.w5h2-table .col-actions { width: 64px; }
.w5h2-table td.col-status { padding-top: 6px; }
.w5h2-table tr.row-done textarea.cell { color: var(--text-3); }
.money { display: flex; align-items: center; }
.money span { padding-left: 6px; font-size: 12px; color: var(--text-3); }
.status-select {
  width: 100%;
  height: 26px;
  padding: 0 4px 0 8px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  color: color-mix(in srgb, var(--c) 55%, var(--text));
  font-size: 12px;
  font-weight: 600;
  outline-offset: 1px;
}
.status-select option { background: var(--surface); color: var(--text); }
.table-foot { display: flex; align-items: center; gap: 18px; padding: 10px 8px 0; font-size: 13px; color: var(--text-2); }
.table-foot .total strong { margin-left: 6px; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- 5 Porquês ---------- */

.whys { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.why-box {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--c, var(--border-strong));
  border-radius: var(--r);
  background: var(--surface);
}
.why-box header { display: flex; align-items: center; gap: 9px; min-height: 26px; margin-bottom: 4px; color: color-mix(in srgb, var(--c, var(--text-3)) 60%, var(--text)); }
.why-box h2 { font-size: 13px; font-weight: 700; }
.why-box.problem { --c: #e34948; }
.why-box.root { --c: #6250d6; margin-top: 6px; background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.why-box.action { --c: #1baf7a; }
.why-step { display: flex; align-items: flex-start; gap: 8px; margin-left: calc(min(var(--i), 6) * 26px); }
.why-step .why-box { flex: 1; min-width: 0; --c: #2a78d6; }
.why-arrow { display: grid; place-items: center; width: 22px; height: 44px; color: var(--text-3); }
.why-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, transparent); font-size: 12px; font-weight: 700; }
.why-step > .btn { margin-left: 30px; }

/* ---------- janela modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 18, 17, .46);
  backdrop-filter: blur(2px);
  animation: fade .12s ease-out;
}
.modal {
  display: flex;
  flex-direction: column;
  width: min(var(--w, 560px), 100%);
  /* altura medida pela tela (não pelo conteúdo): o miolo rola e os botões ficam sempre visíveis */
  max-height: calc(100vh - 48px);
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  animation: pop .14s ease-out;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 20px; flex: none; }
.modal-head h2 { font-size: 13px; font-weight: 600; color: var(--text-3); }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 6px 20px 18px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex: none; }
.confirm-text { color: var(--text-2); line-height: 1.55; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }

.quad-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quad-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
}
.quad-opt strong { display: block; font-weight: 600; line-height: 1.25; }
.quad-opt small { font-size: 12px; color: var(--text-3); }
.quad-opt .quad-n { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.quad-opt:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--border)); }
.quad-opt.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.task-modal .cl-row { min-height: 34px; }
.task-modal #tf-checklist:not(:empty) { margin-bottom: 4px; }

/* ---------- menus e avisos ---------- */

.menu {
  position: fixed;
  z-index: 70;
  min-width: 200px;
  max-width: 360px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: fade .1s ease-out;
}
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; white-space: nowrap; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.menu-item .ico { color: currentColor; opacity: .75; }
.menu-sep { height: 1px; margin: 5px 6px; background: var(--border); }
.menu.pop { width: 340px; max-height: 70vh; overflow-y: auto; padding: 8px; }
.pop-section + .pop-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.pop-section h3 { display: flex; align-items: center; gap: 7px; padding: 4px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.pop-empty { padding: 4px 8px 8px; font-size: 13px; color: var(--text-3); }

.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(520px, 90vw);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--ink-text);
  box-shadow: var(--shadow-2);
  font-size: 13.5px;
  pointer-events: auto;
  animation: pop .16s ease-out;
  transition: opacity .2s, transform .2s;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

/* ---------- configurações ---------- */

.set-group + .set-group { margin-top: 18px; }
.set-group h3 { margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.set-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child { flex: 1; min-width: 0; }
.set-row strong { display: block; font-weight: 600; }
.set-row small { display: block; font-size: 12.5px; color: var(--text-3); }
.set-row small.path { overflow-wrap: anywhere; font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; }
.arch-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.arch-row > div { flex: 1; min-width: 0; }
.arch-row strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-row small { font-size: 12px; color: var(--text-3); }

/* ---------- Projetos: barra lateral e aviso de projeto selecionado ---------- */

.side-head { margin-top: 4px; font-weight: 600; color: var(--text); }
.side-title .count { letter-spacing: 0; text-transform: none; }
.side-head .chev { color: var(--text-3); }
.count.late { color: var(--danger); font-weight: 700; }
.scope {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  flex: none;
  height: 28px;
  padding: 0 3px 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.scope .icon-btn { width: 22px; height: 22px; border-radius: 50%; }
.tabs .spacer { min-width: 12px; }
.chip.proj .ico { opacity: .75; }
.task.ghost { opacity: .5; }
.task.ghost:hover { opacity: 1; }

/* carga do dia (calendário, janela da tarefa) */
.lv-ok { --lv: var(--series-1); }
.lv-high { --lv: #fab219; }
.lv-over { --lv: var(--danger); }
.cal-day { position: relative; }
.cal-load { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w); border-radius: 0 3px 0 0; background: var(--lv); }
.cal-alert { display: inline-flex; align-items: center; gap: 3px; margin: 0 auto 0 4px; font-size: 10.5px; font-weight: 700; color: var(--danger); }
.cal-ev.ghost { opacity: .4; }
.cal-ev.ghost:hover { opacity: 1; }
.cal-focus { margin-left: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
.cal-side h3 small { margin-left: auto; font-weight: 400; letter-spacing: 0; text-transform: none; }
.day-load { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.day-load-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seg-bar { display: flex; gap: 2px; height: 8px; }
.seg-bar i { min-width: 4px; border-radius: 4px; background: var(--c); }
.seg-bar i.free { background: var(--well); }
.day-load-list { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.day-load-list li { display: flex; align-items: center; gap: 8px; }
.day-load-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.day-load-list b { font-weight: 600; font-variant-numeric: tabular-nums; }
.warn { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; }
.warn > .ico { margin-top: 2px; color: var(--danger); }
.fine { font-size: 11.5px; color: var(--text-3); }
.load-hint { display: flex; flex-direction: column; gap: 6px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--well); font-size: 12.5px; color: var(--text-2); }
.load-hint p { display: flex; align-items: flex-start; gap: 8px; }
.load-hint p > span { flex: 1; }
.load-hint p > .ico { margin-top: 2px; }
.load-hint p.warn { color: var(--text); }
.load-hint .btn { flex: none; }
.chips-label { display: inline-flex; align-items: center; gap: 4px; margin-right: 2px; font-size: 12px; color: var(--text-3); }
.task-modal #tf-remind-chips { align-items: center; margin-top: -6px; }
.row-btn.add { color: var(--text-3); }
.row-btn.is-done span { color: var(--text-3); text-decoration: line-through; }

/* ---------- tela Projetos: linha do tempo, conflitos e cartões ---------- */

.tl-panel { margin-bottom: 14px; }
.tl-range { font-size: 12.5px; color: var(--text-3); }
.tl-scroll { overflow-x: auto; }
.tl { --label: 176px; min-width: calc(var(--label) + var(--days) * 20px); }
.tl-row { display: grid; grid-template-columns: var(--label) repeat(var(--days), minmax(0, 1fr)); align-items: center; }
.tl-row > * { grid-row: 1; }
.tl-label {
  grid-column: 1;
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  min-width: 0;
  padding: 0 10px 0 4px;
  background: var(--surface);
  font-size: 13px;
}
.tl-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-label small { font-size: 11px; color: var(--text-3); }
.tl-label > .ico { color: var(--text-3); }
.tl-label.link { cursor: pointer; border-radius: 6px; }
.tl-label.link:hover { background: color-mix(in srgb, var(--text) 6%, var(--surface)); }
.tl-cell { align-self: stretch; border-left: 1px solid var(--grid); }
.tl-cell.weekend { background: color-mix(in srgb, var(--well) 65%, var(--surface)); }
.tl-cell.today { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.tl-months { height: 20px; }
.tl-month { padding-left: 5px; border-left: 1px solid var(--axis); overflow: hidden; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--text-3); }
.tl-days { height: 32px; }
.tl-day { font-size: 11px; line-height: 1.15; text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-day small { display: block; font-size: 9.5px; color: var(--text-3); }
.tl-day.weekend { color: var(--text-3); }
.tl-day.today { margin: 0 1px; padding: 1px 0; border-radius: 6px; background: var(--ink); color: var(--ink-text); font-weight: 700; }
.tl-day.today small { color: inherit; opacity: .7; }
.tl-loads { height: 46px; border-top: 1px solid var(--axis); }
.tl-loads .tl-label { font-weight: 600; }
.tl-load {
  position: relative;
  z-index: 2;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px 0 0;
  border: 0;
  background: none;
}
.tl-track { display: flex; align-items: flex-end; width: 10px; height: 100%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--lv) 20%, var(--surface)); }
.tl-track i { width: 100%; border-radius: 4px 4px 0 0; background: var(--lv); }
.tl-load b { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; line-height: 14px; color: var(--danger); }
.tl-load:hover .tl-track { outline: 2px solid color-mix(in srgb, var(--lv) 45%, transparent); }
.tl-proj { height: 36px; border-top: 1px solid var(--grid); }
.tl-proj.on .tl-label { font-weight: 700; }
.tl-bar { z-index: 1; height: 10px; margin: 0 2px; border-radius: 5px; background: color-mix(in srgb, var(--c) 34%, var(--surface)); }
.tl-bar.open-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tl-bar.open-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-mark {
  z-index: 2;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--c);
  color: var(--ink, #fff);
  font: 700 10px/1 var(--font);
}
.tl-mark.done { border-color: color-mix(in srgb, var(--c) 45%, var(--surface)); background: var(--surface); color: var(--text-3); }
.tl-mark.late { box-shadow: 0 0 0 2px var(--danger); }
.tl-mark:hover { transform: scale(1.15); }
.tl-legend { margin: 12px 0 0; }
.tl-legend .key { font-style: normal; }
.tl-key-bar { width: 18px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--series-1) 34%, var(--surface)); }
.tl-key-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--series-1); color: #fff; font: 700 9.5px/1 var(--font); }
.tl-key-load { width: 8px; height: 14px; border-radius: 3px 3px 0 0; background: var(--series-1); }
.tl-key-alert { width: auto; height: auto; color: var(--danger); font-weight: 800; }

.issues.none { display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.issues.none > .ico { color: var(--ok); }
.issues.none strong { display: block; color: var(--text); }
.issues .panel-head { margin-bottom: 4px; }
.issue-list { margin: 0; padding: 0; list-style: none; }
.issue-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.issue-list li > .ico { color: var(--danger); }
.issue-date { flex: 0 0 108px; font-size: 13px; font-weight: 600; }
.issue-list li > div { flex: 1; min-width: 0; }
.issue-list strong { display: block; }
.issue-list li > div span { font-size: 12.5px; color: var(--text-2); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font: 600 16px var(--font-d); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.proj-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--c);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: box-shadow .12s;
}
.proj-card:hover { box-shadow: var(--shadow-2); }
.proj-card.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 24%, transparent); }
.proj-card.is-done { opacity: .68; }
.proj-card header { display: flex; align-items: center; gap: 8px; }
.proj-card h3 { flex: 1; min-width: 0; font: 600 15.5px/1.3 var(--font-d); overflow-wrap: anywhere; }
.proj-period { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.proj-note { font-size: 12.5px; color: var(--text-3); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.meter { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--c) 20%, var(--surface)); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.proj-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.proj-stats span { display: inline-flex; align-items: center; gap: 3px; }
.proj-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.proj-stats .late b { color: inherit; }
.proj-next { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quad-plus { display: none; margin: 1px -2px 0 -4px; color: var(--text-2); }

/* ---------- telas baixas (notebook 1366×768): menos margens, mais conteúdo ---------- */

@media (max-height: 820px) {
  .topbar, .brand { height: 50px; }
  .tab { height: 38px; }
  .view { padding: 14px 20px 18px; }
  .view.fill { padding-bottom: 14px; }
  .view-head { margin-bottom: 10px; align-items: center; }
  .view-head > div:first-child { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
  .view-head h1, .cal-toolbar h1 { font-size: 19px; white-space: nowrap; }
  .view-head p { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .banner { margin-bottom: 10px; padding: 6px 8px 6px 12px; }
  .kcol { padding-top: 10px; }
  .kcol-head { margin-bottom: 8px; }
  .quad, .eis-inbox { padding: 10px; gap: 8px; }
  .quad .quick-add { display: none; }
  .quad-plus { display: grid; }
  .quad-tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .eis-grid, .eis-top, .eis-left { gap: 10px; }
  .cal-toolbar { margin-bottom: 8px; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); }
  .modal-head { padding-top: 10px; }
  .modal-body { padding-bottom: 12px; }
  .modal-foot { padding: 9px 20px; }
  .form { gap: 10px; }
  .title-input { height: 40px; }
  .quad-opt { padding: 6px 10px; }
  .side-title { margin-top: 10px; }
}

/* ---------- versão web: entrar, instalar, conta ---------- */

body.auth-mode .app { display: none; }
.auth {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  overflow-y: auto;
  background: var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  padding: 26px 28px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: pop .14s ease-out;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font: 600 16px var(--font-d); letter-spacing: -.01em; }
.auth h1 { font: 600 21px/1.2 var(--font-d); letter-spacing: -.015em; }
.auth-sub { margin: 5px 0 18px; color: var(--text-2); }
.auth .form-row > .field { min-width: 0; }
.auth-go { height: 38px; margin-top: 2px; }
.auth-error {
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
  font-size: 13px;
}
.auth-note { margin-top: 16px; font-size: 12.5px; color: var(--text-3); }
.auth-link { padding: 0; border: 0; background: none; color: var(--text-2); text-decoration: underline; }
.field-hint { font-size: 12px; color: var(--text-3); }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin-left: 2px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ink-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.avatar:hover { background: color-mix(in srgb, var(--ink) 82%, var(--bg)); }
.menu.acct { min-width: 240px; }
.acct-head { padding: 6px 10px 4px; }
.acct-head strong { display: block; font-weight: 600; }
.acct-head small { display: block; font-size: 12.5px; color: var(--text-3); }

.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
}
.choice input { margin: 3px 0 0; accent-color: var(--accent); }
.choice strong { display: block; font-weight: 600; }
.choice small { display: block; font-size: 12.5px; color: var(--text-3); }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }

/* ---------- janelas estreitas ---------- */

@media (max-width: 1180px) {
  .app { grid-template-columns: 208px minmax(0, 1fr); }
  .eis { grid-template-columns: minmax(0, 1fr) 240px; }
  .cal { grid-template-columns: minmax(0, 1fr) 260px; }
  .pareto { grid-template-columns: 1fr; }
  .tab { padding: 0 8px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .eis, .cal { grid-template-columns: 1fr; }
  .eis-inbox, .cal-side { display: none; }
  .pdca-grid { grid-template-columns: 1fr; }
  .pdca-steps .step small, .step-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
