/* =========================================================
   Painel do Dia — KDS pessoal
   Tokens
   ========================================================= */
:root {
  --bg: #0a0d12;
  --surface: #121821;
  --surface-2: #171e29;
  --surface-3: #202a38;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9eef6;
  --text-dim: #93a0b4;
  --text-faint: #66738a;
  --lime: #c8f751;
  --lime-ink: #0c1006;
  --amber: #ffb224;
  --red: #ff6159;
  --green: #4ddc8b;
  --blue: #5b9dff;
  --notion: #cfd6e2;
  --radius: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Roboto", sans-serif;
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  --shadow-md: 0 16px 34px -24px rgba(0, 0, 0, 0.95);
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

html,
body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(200, 247, 81, 0.07), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(91, 157, 255, 0.07), transparent 55%),
    radial-gradient(700px 700px at 50% 130%, rgba(200, 247, 81, 0.03), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.5;
  mix-blend-mode: overlay;
}

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

svg { display: block; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

::selection { background: rgba(200, 247, 81, 0.28); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2b3749 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #2b3749;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #3a4a60; background-clip: content-box; }

/* =========================================================
   Shell
   ========================================================= */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 1800px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px 12px;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1d2532, #131923);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 20px -12px #000;
}
.brand__mark svg { width: 25px; height: 25px; }

.brand__text { min-width: 0; }

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.015em;
  line-height: 1.2;
  white-space: nowrap;
}

.brand p {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__sep { color: var(--text-faint); }

.tag-demo {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime);
  background: rgba(200, 247, 81, 0.1);
  border: 1px solid rgba(200, 247, 81, 0.22);
  border-radius: 999px;
  padding: 2px 7px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.stat__value {
  font-size: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat__slash { color: var(--text-faint); margin: 0 1px; font-weight: 400; }
.stat__label {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 3px;
}

.progress {
  width: 120px;
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #a9e433, var(--lime));
  box-shadow: 0 0 12px rgba(200, 247, 81, 0.55);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.clock {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
  min-width: 68px;
  text-align: right;
}

/* =========================================================
   Toolbar
   ========================================================= */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 26px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

/* Aviso de conexão (API/Google/Notion) */
.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 26px 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 178, 36, 0.26);
  background: rgba(255, 178, 36, 0.08);
  color: #ffd99a;
  font-size: 12px;
  line-height: 1.4;
}
.notice svg { width: 15px; height: 15px; flex: 0 0 15px; }
.notice__text { min-width: 0; flex: 1; }
.notice__action {
  margin-left: auto;
  color: var(--lime);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  padding: 3px 6px;
  border-radius: 6px;
  flex: 0 0 auto;
}
.notice__action:hover { background: rgba(200, 247, 81, 0.12); }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  flex: 0 0 auto;
}
.segmented__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 550;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.segmented__btn svg { width: 14px; height: 14px; opacity: 0.85; }
.segmented__btn:hover { color: var(--text); }
.segmented__btn.is-active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 10px -6px #000;
}

.chips {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active {
  color: var(--lime);
  background: rgba(200, 247, 81, 0.09);
  border-color: rgba(200, 247, 81, 0.28);
}
.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  flex: 0 0 6px;
}
.chip__dot--google { background: var(--blue); }
.chip__dot--notion { background: var(--notion); }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  width: min(260px, 28vw);
  padding: 0 8px 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-faint);
  transition: border-color 0.15s, background 0.15s;
}
.search:focus-within {
  border-color: rgba(200, 247, 81, 0.4);
  background: #141b25;
}
.search svg { width: 15px; height: 15px; flex: 0 0 15px; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--text);
}
.search input::placeholder { color: var(--text-faint); }
.search input::-webkit-search-cancel-button { filter: invert(0.6); }
.search kbd {
  font-family: var(--font);
  font-size: 10px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  flex: 0 0 auto;
}

.toolbar__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.sync {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
  white-space: nowrap;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.icon-btn.is-on {
  color: var(--lime);
  background: rgba(200, 247, 81, 0.1);
  border-color: rgba(200, 247, 81, 0.26);
}
.icon-btn.is-spinning svg { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Main / views
   ========================================================= */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.view {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 26px 18px;
  overflow: hidden;
}

/* =========================================================
   Board
   ========================================================= */
.board {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.column {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.006));
  overflow: hidden;
  transition: background 0.15s, outline-color 0.15s, flex-basis 0.2s ease;
  outline: 1.5px solid transparent;
  outline-offset: -1.5px;
}
.column.is-dragover {
  background: rgba(200, 247, 81, 0.045);
  outline-color: rgba(200, 247, 81, 0.55);
}

.column__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
  flex: 0 0 auto;
}
.column__dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  flex: 0 0 8px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.column[data-status="late"] .column__dot { background: var(--red); box-shadow: 0 0 10px rgba(255, 97, 89, 0.45); }
.column[data-status="todo"] .column__dot { background: #7d8ba1; }
.column[data-status="doing"] .column__dot { background: var(--amber); box-shadow: 0 0 10px rgba(255, 178, 36, 0.5); }
.column[data-status="done"] .column__dot { background: var(--green); box-shadow: 0 0 10px rgba(77, 220, 139, 0.45); }

.column__title {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.column__count {
  margin-left: auto;
  min-width: 23px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.column[data-status="doing"] .column__count { color: var(--amber); background: rgba(255, 178, 36, 0.12); }
.column[data-status="done"] .column__count { color: var(--green); background: rgba(77, 220, 139, 0.1); }
.column[data-status="late"] .column__count { color: var(--red); background: rgba(255, 97, 89, 0.12); }

.column__collapse {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  margin-left: 2px;
  transition: background 0.15s, color 0.15s, transform 0.2s;
}
.column__collapse svg { width: 13px; height: 13px; }
.column__collapse:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

.column.is-collapsed {
  flex: 0 0 58px;
  min-width: 58px;
}
.column.is-collapsed .column__head {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 12px 0;
}
.column.is-collapsed .column__dot { order: 0; margin: 0; }
.column.is-collapsed .column__count { order: 1; margin: 0; }
.column.is-collapsed .column__title {
  order: 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.14em;
  font-size: 10px;
  white-space: nowrap;
  margin-top: 2px;
}
.column.is-collapsed .column__collapse {
  order: 3;
  margin: auto 0 0;
  transform: rotate(180deg);
}
.column.is-collapsed .column__collapse svg { transform: none; }
.column.is-collapsed .column__body { display: none; }

.column__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px;
}

.column__empty {
  margin: auto 0;
  padding: 26px 16px;
  text-align: center;
  border: 1.5px dashed rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}
.column__empty svg {
  width: 26px;
  height: 26px;
  margin: 0 auto 8px;
  opacity: 0.4;
}
.column__empty strong { display: block; color: var(--text-dim); font-weight: 600; margin-bottom: 2px; }

/* =========================================================
   Card
   ========================================================= */
.card {
  position: relative;
  padding: 12px 12px 10px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: linear-gradient(165deg, #1a212c, #151a23);
  box-shadow: 0 12px 26px -22px #000;
  cursor: grab;
  transition: transform 0.16s ease, border-color 0.16s, box-shadow 0.16s, opacity 0.2s;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--pri, var(--text-faint));
  opacity: 0.9;
}
.card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 34px -24px #000;
}
.card:active { cursor: grabbing; }
.card.is-dragging { opacity: 0.4; }
.card.is-drop-target {
  box-shadow: 0 -2px 0 0 var(--lime), 0 18px 34px -24px #000;
  border-color: rgba(200, 247, 81, 0.45);
}
.card:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.card--done {
  background: linear-gradient(165deg, #161c25, #131820);
  opacity: 0.68;
}
.card--done:hover { opacity: 0.9; }
.card--done .card__title {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.28);
  color: var(--text-dim);
}
.card--done::before { background: var(--green); opacity: 0.55; }

.card--urgent { border-color: rgba(255, 97, 89, 0.24); }
.card--urgent:hover { border-color: rgba(255, 97, 89, 0.45); }
.card--doing { border-color: rgba(255, 178, 36, 0.2); }
.card--doing:hover { border-color: rgba(255, 178, 36, 0.38); }

.card__top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  min-height: 18px;
}

.src {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid transparent;
}
.src svg { width: 11px; height: 11px; }
.src--google {
  color: #8dbcff;
  background: rgba(91, 157, 255, 0.12);
  border-color: rgba(91, 157, 255, 0.22);
}
.src--notion {
  color: var(--notion);
  background: rgba(207, 214, 226, 0.1);
  border-color: rgba(207, 214, 226, 0.18);
}

.card__pri {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pri);
}

.card__status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.card__status--live { color: var(--amber); }
.card__status--late { color: var(--red); }
.card__status--done { color: var(--green); }

.dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 1.8s ease-out infinite;
  flex: 0 0 6px;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 178, 36, 0.45); }
  70% { box-shadow: 0 0 0 5px rgba(255, 178, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 178, 36, 0); }
}

.card__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__bottom {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.card__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.card__range { white-space: nowrap; }
.card__range--none { font-style: italic; opacity: 0.8; }
.card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 1px 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag::before { content: "#"; opacity: 0.5; }

.card__actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s, transform 0.15s;
}
.card:hover .card__actions,
.card:focus-within .card__actions { opacity: 1; transform: none; }

.mini-btn {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-dim);
  transition: all 0.14s;
}
.mini-btn svg { width: 13px; height: 13px; }
.mini-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); border-color: var(--line-strong); }
.mini-btn--primary {
  color: var(--lime);
  background: rgba(200, 247, 81, 0.11);
  border-color: rgba(200, 247, 81, 0.26);
}
.mini-btn--primary:hover { background: rgba(200, 247, 81, 0.2); color: var(--lime); }
.mini-btn--amber {
  color: var(--amber);
  background: rgba(255, 178, 36, 0.11);
  border-color: rgba(255, 178, 36, 0.24);
}
.mini-btn--amber:hover { background: rgba(255, 178, 36, 0.2); }

/* Tarefas de dias anteriores */
.card--late { border-color: rgba(255, 97, 89, 0.18); }
.card--late:hover { border-color: rgba(255, 97, 89, 0.42); }
.card--late::before { background: var(--red); opacity: 0.7; }

/* Alerta ativo: o cartão inteiro pisca no fundo, mantendo o texto legível. */
.card.is-alerting {
  background-image: none;
  background-color: #1a212c;
  border-color: rgba(255, 178, 36, 0.55);
  animation: card-alert 1.15s ease-in-out infinite;
}
@keyframes card-alert {
  0%,
  100% {
    background-color: #1a212c;
    border-color: rgba(255, 178, 36, 0.45);
    box-shadow: 0 12px 26px -22px #000;
  }
  18%,
  55% {
    background-color: #4a3413;
    border-color: #ffc85a;
    box-shadow: 0 0 0 2px rgba(255, 178, 36, 0.34), 0 0 40px -2px rgba(255, 178, 36, 0.7);
  }
  72% {
    background-color: #1a212c;
    border-color: rgba(255, 178, 36, 0.45);
    box-shadow: 0 12px 26px -22px #000;
  }
}

/* Mantém contraste alto no pico do pisca (fundo âmbar escuro). */
.card.is-alerting .card__meta { color: #b9c5d6; }
.card.is-alerting .tag { color: #dde5f0; background: rgba(255, 255, 255, 0.09); }
.card.is-alerting .card__pri { filter: brightness(1.5); }
.card.is-alerting .card__status--late { color: #ff9d97; }
.card.is-alerting .card__status--live { color: #ffd166; }
.card.is-alerting .alert-btn--ghost { color: #c9d2df; border-color: rgba(255, 255, 255, 0.16); }

@media (prefers-reduced-motion: reduce) {
  .card.is-alerting {
    background-color: #3a2b12;
    border-color: rgba(255, 178, 36, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 178, 36, 0.2);
  }
}

.card__alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 178, 36, 0.3);
}
.card__alert-label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}
.card__alert-label svg { width: 12px; height: 12px; }

.alert-btn {
  height: 27px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 178, 36, 0.3);
  background: rgba(255, 178, 36, 0.12);
  color: #ffd073;
  font-size: 10.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.alert-btn svg { width: 11px; height: 11px; }
.alert-btn:hover { background: rgba(255, 178, 36, 0.2); }
.alert-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text-dim);
}
.alert-btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.alert-btn--lime {
  width: 100%;
  height: 29px;
  background: rgba(200, 247, 81, 0.12);
  border-color: rgba(200, 247, 81, 0.3);
  color: var(--lime);
}
.alert-btn--lime:hover { background: rgba(200, 247, 81, 0.2); }

.card__late {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.09);
}

/* =========================================================
   Mobile column tabs
   ========================================================= */
.mobile-tabs {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}
.mobile-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 600;
  padding: 0 5px;
  transition: all 0.15s;
  min-width: 0;
}
.mobile-tab span {
  font-variant-numeric: tabular-nums;
  min-width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 5px;
  background: var(--surface-3);
  font-size: 9.5px;
  flex: 0 0 auto;
}
.mobile-tab.is-active {
  color: var(--text);
  background: var(--surface-3);
  border-color: var(--line-strong);
}
.mobile-tab[data-status="doing"].is-active { color: var(--amber); }
.mobile-tab[data-status="done"].is-active { color: var(--green); }
.mobile-tab[data-status="late"].is-active { color: var(--red); }

/* =========================================================
   Agenda
   ========================================================= */
.agenda {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.agenda__timeline {
  flex: 1;
  min-width: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.timeline {
  position: relative;
  margin: 0;
}

.timeline__hours {
  position: absolute;
  inset: 20px 16px 20px 0;
}

.hour {
  height: 64px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  position: relative;
}
.hour:first-child { border-top-color: transparent; }
.hour__label {
  position: absolute;
  left: 12px;
  top: -7px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  background: #0d1219;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.timeline__events {
  position: absolute;
  top: 20px;
  left: 58px;
  right: 18px;
  bottom: 20px;
}

.evt {
  position: absolute;
  padding: 6px 8px 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--evt, var(--blue));
  background: linear-gradient(165deg, #1c2430, #171d27);
  box-shadow: 0 10px 20px -16px #000;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, filter 0.14s;
  font-size: 11px;
  min-height: 22px;
  text-align: left;
  font-family: var(--font);
}
.evt:hover { transform: translateX(2px); filter: brightness(1.12); border-color: rgba(255, 255, 255, 0.18); }
.evt--google { --evt: var(--blue); background: linear-gradient(165deg, rgba(43, 72, 118, 0.62), rgba(28, 45, 72, 0.55)); }
.evt--notion { --evt: var(--notion); }
.evt--doing { --evt: var(--amber); }
.evt--done { --evt: var(--green); opacity: 0.5; }
.evt--done .evt__title { text-decoration: line-through; }

.evt__time {
  font-size: 9.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
  white-space: nowrap;
}
.evt__title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.evt--compact { padding-top: 4px; padding-bottom: 4px; }
.evt--compact .evt__time { display: none; }
.evt--compact .evt__title { -webkit-line-clamp: 1; font-size: 11px; }

.now-line {
  position: absolute;
  left: 44px;
  right: 12px;
  height: 0;
  border-top: 1.5px solid rgba(255, 97, 89, 0.85);
  z-index: 6;
  pointer-events: none;
}
.now-line span {
  position: absolute;
  right: 0;
  top: -9px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.now-line::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 97, 89, 0.18);
}

.agenda__rail {
  width: 296px;
  flex: 0 0 296px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.panel {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.006));
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.panel--summary { flex: 0 0 auto; }

.panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.panel__title {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.panel__count {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.panel__body {
  padding: 8px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.summary__item {
  padding: 11px 14px;
  background: #10151d;
}
.summary__value {
  font-size: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.summary__label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  margin-top: 3px;
}
.summary__value--warn { color: var(--amber); }
.summary__value--late { color: var(--red); }
.summary__value--ok { color: var(--green); }

.rail-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 8px 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition: background 0.14s, border-color 0.14s;
}
.rail-item:hover { background: rgba(255, 255, 255, 0.045); border-color: var(--line); }
.rail-item__check {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  color: transparent;
  background: transparent;
  transition: all 0.14s;
}
.rail-item__check svg { width: 11px; height: 11px; }
.rail-item__check:hover { border-color: var(--lime); color: rgba(200, 247, 81, 0.55); }
.rail-item.is-done .rail-item__check {
  background: var(--green);
  border-color: var(--green);
  color: #07200f;
}
.rail-item.is-doing .rail-item__check { border-color: var(--amber); }
.rail-item__text { flex: 1; min-width: 0; }
.rail-item__title {
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-item.is-done .rail-item__title { color: var(--text-faint); text-decoration: line-through; }
.rail-item__meta {
  font-size: 10px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.rail-item__meta .dot { width: 4px; height: 4px; border-radius: 99px; background: currentColor; opacity: 0.6; }
.rail-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* =========================================================
   Botão "Nova tarefa"
   ========================================================= */
.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px -12px rgba(200, 247, 81, 0.85);
  transition: transform 0.15s, filter 0.15s;
}
.btn-new svg { width: 15px; height: 15px; }
.btn-new:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-new:active { transform: none; }

/* =========================================================
   Modal
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fade 0.18s ease both;
}
@keyframes fade { from { opacity: 0; } }

.modal__panel {
  position: relative;
  width: min(500px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 20px 22px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #1a212c, #131922);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal__eyebrow {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 4px;
}
.modal__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.modal--sm .modal__panel { width: min(400px, 100%); }

.reschedule__task {
  margin: -4px 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.reschedule__hint {
  margin: 0 0 14px;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}

/* Configuração de integração */
.setup__hint {
  margin: -6px 0 12px;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}
.setup__section {
  margin: 8px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
}
.setup__status {
  min-height: 14px;
  font-size: 10.5px;
  color: var(--text-faint);
}
.setup__status strong { color: var(--lime); font-weight: 600; }
.setup__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.setup__result {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.setup__result--ok { color: var(--lime); }
.setup__result--error { color: var(--red); }
.setup__note {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
}
.setup__note code {
  font-size: 10.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
}

.form { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e141c;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
  border-color: rgba(200, 247, 81, 0.45);
  box-shadow: 0 0 0 3px rgba(200, 247, 81, 0.11);
}
.input.is-invalid {
  border-color: rgba(255, 97, 89, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 97, 89, 0.14);
  animation: shake 0.3s ease;
}
@keyframes shake {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
textarea.input { resize: vertical; min-height: 64px; line-height: 1.45; }
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%2393a0b4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-color: #0e141c;
}
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="number"]::-webkit-inner-spin-button {
  filter: invert(0.65);
  opacity: 0.7;
  cursor: pointer;
}
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.linked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed rgba(200, 247, 81, 0.26);
  background: rgba(200, 247, 81, 0.055);
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
}
.linked svg { width: 14px; height: 14px; color: var(--lime); flex: 0 0 14px; }
.linked strong { color: var(--text); font-weight: 600; }

.modal__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.modal__spacer { flex: 1; }

.btn {
  height: 37px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--lime);
  color: var(--lime-ink);
  box-shadow: 0 8px 18px -12px rgba(200, 247, 81, 0.8);
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}
.btn--ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); border-color: var(--line-strong); }
.btn--danger {
  background: rgba(255, 97, 89, 0.09);
  border-color: rgba(255, 97, 89, 0.22);
  color: var(--red);
}
.btn--danger:hover { background: rgba(255, 97, 89, 0.16); }

/* =========================================================
   Toasts
   ========================================================= */
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #1b2330;
  box-shadow: 0 18px 40px -18px #000;
  font-size: 12.5px;
  animation: toast-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.toast.is-leaving { animation: toast-out 0.2s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}
.toast__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: rgba(200, 247, 81, 0.14);
  color: var(--lime);
}
.toast__icon svg { width: 11px; height: 11px; }
.toast__msg { flex: 1; min-width: 0; color: var(--text); }
.toast__action {
  border: 0;
  background: transparent;
  color: var(--lime);
  font-size: 12px;
  font-weight: 650;
  padding: 4px 6px;
  border-radius: 6px;
}
.toast__action:hover { background: rgba(200, 247, 81, 0.12); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .sync { display: none; }
  .search { width: min(220px, 30vw); }
  .progress { width: 90px; }
  .column__title { font-size: 10.5px; letter-spacing: 0.07em; }
}

@media (max-width: 980px) {
  .topbar { padding: 15px 18px 10px; }
  .toolbar { padding: 3px 18px 12px; }
  .view { padding: 13px 18px 16px; }
  .board { gap: 12px; }
  .chip { padding: 6px 9px; }
  .card__title { font-size: 15px; }
  .search kbd { display: none; }
}

@media (max-width: 860px) {
  .app { height: 100dvh; }

  .topbar {
    padding: 12px 15px 8px;
    align-items: flex-start;
    gap: 10px;
  }
  .brand { gap: 10px; align-items: flex-start; }
  .brand__mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .brand__mark svg { width: 21px; height: 21px; }
  .brand h1 { font-size: 15px; padding-top: 1px; }
  .brand p { font-size: 11px; margin-top: 2px; }
  .tag-demo { font-size: 8.5px; padding: 1px 5px; }

  .topbar__right { gap: 10px; align-items: center; margin-top: 2px; }
  .stat { display: none; }
  .progress { display: none; }
  .clock { font-size: 16px; min-width: 52px; }

  .toolbar {
    padding: 4px 15px 10px;
    flex-wrap: wrap;
    gap: 7px;
    row-gap: 8px;
  }
  .segmented { padding: 2px; order: 1; }
  .segmented__btn { padding: 6px 10px; font-size: 11.5px; }
  .segmented__btn svg { width: 13px; height: 13px; }
  .chips {
    order: 3;
    width: 100%;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { font-size: 11px; padding: 5px 9px; flex: 0 0 auto; }
  .search { display: none; }
  .toolbar__actions { order: 2; margin-left: auto; gap: 5px; }
  .icon-btn { width: 31px; height: 31px; border-radius: 9px; }
  .icon-btn svg { width: 15px; height: 15px; }
  .toolbar__actions [data-action="fullscreen"] { display: none; }
  .btn-new { width: 31px; height: 31px; padding: 0; justify-content: center; border-radius: 9px; }
  .btn-new span { display: none; }

  .view { padding: 0 15px 10px; }
  .notice { margin: 0 15px 8px; font-size: 11.5px; padding: 8px 10px; }
  .mobile-tabs { display: grid; }
  .board { display: block; }
  .column { display: none; height: 100%; }
  .column.is-mobile-active { display: flex; }

  .column__head { display: none; }
  .column__collapse { display: none; }
  .column.is-collapsed { flex: 1 1 auto; }
  .column.is-collapsed .column__body { display: flex; }
  .column__body { padding: 10px; gap: 9px; }

  .card { padding: 13px 12px 12px 16px; }
  .card__title { font-size: 15.5px; }
  .card__actions { opacity: 1; transform: none; }
  .mini-btn { width: 32px; height: 32px; border-radius: 9px; }
  .mini-btn svg { width: 14px; height: 14px; }
  .card__alert-label { font-size: 10px; }
  .alert-btn { height: 32px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
  .alert-btn svg { width: 12px; height: 12px; }
  .alert-btn--lime { height: 34px; }

  .agenda { flex-direction: column; gap: 12px; overflow-y: auto; }
  .agenda__timeline { flex: 0 0 auto; min-height: 58vh; overflow: visible; }
  .agenda__rail { width: 100%; flex: 0 0 auto; }
  .panel { min-height: 160px; }
  .panel--summary { flex: 0 0 auto; }
  .summary { grid-template-columns: repeat(4, 1fr); }
  .summary__item { padding: 9px 10px; }
  .summary__value { font-size: 16px; }
  .summary__label { font-size: 8.5px; letter-spacing: 0.06em; }

  .toasts {
    left: 15px;
    right: 15px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    align-items: stretch;
  }
  .toast { max-width: none; }

  .modal { padding: 12px; place-items: end center; }
  .modal__panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 18px 18px 16px;
    border-radius: 20px;
  }
  .field-row { gap: 8px; }
}

@media (max-width: 420px) {
  .chip span.chip__dot { display: none; }
  .brand p { max-width: 190px; }
  .clock { font-size: 15px; min-width: 46px; }
  .modal__foot { flex-wrap: wrap; }
  .modal__foot .btn--danger { order: 4; margin-right: auto; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .topbar { padding-top: 8px; padding-bottom: 6px; }
  .brand p { display: none; }
  .view { padding-top: 8px; }
  .mobile-tabs { margin-bottom: 6px; height: 34px; }
}

@media (hover: none) {
  .card__actions { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
