:root {
  --brand: #0f5c52;
  --brand-hover: #0c4a42;
  --brand-deep: #08332e;
  --on-brand: #ffffff;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #12202b;
  --muted: #5d6b76;
  --line: #dfe5ea;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --danger: #b42318;
  --ok-bg: #e8f7ef;
  --ok-ink: #087443;
  --warn-bg: #fff4e5;
  --warn-ink: #b54708;
  --sidebar: #ffffff;
  --sidebar-ink: #1b2a34;
  --sidebar-muted: #6b7a86;
  --sidebar-hover: #f3f6f8;
  --login-bg: #0f1720;
}

html[data-theme="dark"] {
  --bg: #0e141b;
  --surface: #161d26;
  --surface-2: #1d2631;
  --ink: #e8eef3;
  --muted: #93a1ae;
  --line: #2a3542;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --sidebar: #121922;
  --sidebar-ink: #e8eef3;
  --sidebar-muted: #8b99a6;
  --sidebar-hover: #1c2530;
  --login-bg: #0b1016;
  --ok-bg: #123526;
  --ok-ink: #6ee7b7;
  --warn-bg: #3a2712;
  --warn-ink: #fbbf24;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: -0.011em;
}
.hidden { display: none !important; }
.kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.03em; }
.sub, .muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.1em; }

.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 15% -10%, color-mix(in srgb, var(--brand) 45%, transparent), transparent 60%),
    var(--login-bg);
}
.card, .form-grid, .stat, table, .kanban-col {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card { padding: 26px; border-radius: var(--radius); }
.login .card { width: min(400px, 92vw); display: grid; gap: 12px; box-shadow: var(--shadow); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  border: 1px solid var(--line);
  padding: 11px 12px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-color: var(--brand);
}
.field-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.field-box:focus-within {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-color: var(--brand);
}
.field-prefix {
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-2);
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.field-box input {
  border: 0;
  outline: none;
  flex: 1;
  min-width: 0;
  border-radius: 0;
}
.field-box input:focus { outline: none; }
input.busy { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
button {
  border: 0;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
button:hover { background: var(--brand-hover); }
button.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid var(--line);
}
button.ghost:hover { background: var(--surface-2); }
button.small { padding: 6px 10px; font-size: 12px; }

.shell { height: 100%; display: grid; grid-template-columns: 256px 1fr; transition: grid-template-columns 0.18s ease; }
.shell.collapsed { grid-template-columns: 76px 1fr; }
.side {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.brand { padding: 22px 18px 10px; display: grid; gap: 10px; }
.brand h2 { color: var(--sidebar-ink); font-size: 18px; white-space: nowrap; }
.biz-logo { height: 36px; max-width: 148px; object-fit: contain; display: block; }
.login-logo {
  height: 44px;
  max-width: 260px;
  object-fit: contain;
  display: block;
  margin-bottom: 8px;
  background: #07090d;
  border-radius: 10px;
  padding: 8px 12px;
}
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: color-mix(in srgb, var(--brand) 22%, var(--surface-2));
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.avatar.placeholder { background: var(--brand); }
.logo-pick {
  width: 88px;
  height: 88px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
}
.logo-pick img { width: 100%; height: 100%; object-fit: contain; }

.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.fold-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  color: var(--ink);
  padding: 14px 16px;
  text-align: left;
}
.fold-head:hover { background: var(--surface-2); }
.fold-head span { color: var(--muted); font-size: 12px; }
.fold.closed .fold-body { display: none; }
.fold-body { padding: 0 16px 16px; }
.name-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.name-link:hover { text-decoration: underline; background: none; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag.NEW { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.tag.QUALIFIED { background: #e8f1ff; color: #1d4ed8; }
.tag.COLD { background: #eef2f6; color: #475569; }
.tag.PROPOSAL { background: #f3e8ff; color: #7e22ce; }
.tag.CONTRACT { background: #e0f2fe; color: #0369a1; }
.tag.NEGOTIATION { background: var(--warn-bg); color: var(--warn-ink); }
.tag.WON { background: var(--ok-bg); color: var(--ok-ink); }
.tag.LOST, .tag.DECLINED { background: #fde8e8; color: #b42318; }
.tag.JUNK { background: #f1f5f9; color: #64748b; }
.tag.NOTE { background: #e8f1ff; color: #1d4ed8; }
.tag.TASK { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.tag.REMINDER { background: var(--warn-bg); color: var(--warn-ink); }
.tag.MEETING { background: #e0f2fe; color: #0369a1; }
.tag.EMAIL { background: #fce7f3; color: #9d174d; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.check-row input { width: auto; }
.tag.ON { background: var(--ok-bg); color: var(--ok-ink); }
.tag.OFF { background: #eef2f6; color: #475569; }
.tag.GOOGLE { background: #e8f1ff; color: #1d4ed8; }
html[data-theme="dark"] .tag.OFF { background: #243040; color: #cbd5e1; }
html[data-theme="dark"] .tag.GOOGLE { background: #1b2a44; color: #93c5fd; }
.google-card {
  margin-top: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
#pay-apis-box { margin-top: 22px; }
.google-card code { font-size: 12px; word-break: break-all; }
.insight-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.insight-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.insight-list .row { display: flex; gap: 6px; flex-shrink: 0; }
.totp-qr {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  margin: 10px 0;
}
.ok-msg { color: var(--ok-ink); }
.tpl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .tag.QUALIFIED, html[data-theme="dark"] .tag.NOTE { background: #1b2a44; color: #93c5fd; }
html[data-theme="dark"] .tag.LOST, html[data-theme="dark"] .tag.DECLINED { background: #3b1a1a; color: #fca5a5; }
html[data-theme="dark"] .tag.COLD, html[data-theme="dark"] .tag.JUNK { background: #243040; color: #cbd5e1; }
html[data-theme="dark"] .tag.PROPOSAL { background: #2e1b45; color: #d8b4fe; }
html[data-theme="dark"] .tag.CONTRACT { background: #163246; color: #7dd3fc; }
html[data-theme="dark"] .tag.MEETING { background: #163246; color: #7dd3fc; }
html[data-theme="dark"] .tag.EMAIL { background: #3b1a2e; color: #f9a8d4; }
.drawer-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.38);
  z-index: 40;
  display: grid;
  justify-content: end;
}
.drawer {
  width: min(640px, 100vw);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 22px;
  box-shadow: var(--shadow);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.action-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.lead-action-box {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.lead-action-box .form-grid {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.lead-timeline { margin-bottom: 20px; }
.lead-timeline .kicker { margin-bottom: 10px; }
.timeline-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-item strong { display: block; margin: 6px 0 4px; }
.timeline-item p { margin: 0 0 6px; color: var(--muted); white-space: pre-wrap; }
.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.timeline-top time { color: var(--muted); font-size: 12px; }
.lead-lock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-size: 13px;
}
.confirm-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.45);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}
.confirm-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.confirm-card h3 { margin-bottom: 10px; }
.confirm-body { color: var(--ink); margin-bottom: 16px; }
.confirm-body p { margin: 0 0 8px; }
tr.is-open td { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.pomo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tomato-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 999px;
  color: inherit;
  user-select: none;
}
.tomato-btn:hover { background: var(--surface-2); }
.tomato-icon { width: 28px; height: 28px; display: block; filter: grayscale(0.15); }
.tomato-btn.is-run .tomato-icon {
  filter: none;
  animation: tomato-pulse 1.2s ease-in-out infinite;
}
.tomato-btn.is-paused .tomato-icon { filter: grayscale(0.4); }
.timer-clock {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.tomato-btn.is-run .timer-clock { color: var(--brand); }
.tomato-btn.is-paused .timer-clock { color: var(--warn-ink); }
@keyframes tomato-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.tasks-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.form-grid .full, .form-grid label.full { grid-column: 1 / -1; }
.recipient-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 8px 0;
}
.muted.tiny { font-size: 12px; margin: 4px 0 0; }
.filters-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.filters-bar.slim { grid-template-columns: 1.6fr 1fr; }
.wa-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #25d366;
  color: #fff;
  border-radius: 999px;
}
.wa-btn:hover { background: #1ebe57; }
.wa-btn[disabled] { opacity: 0.35; cursor: not-allowed; background: #9aa7a0; }
.wa-btn svg { width: 18px; height: 18px; fill: currentColor; }
.menu { flex: 1; overflow: auto; padding: 6px 10px 20px; }
.menu .group {
  margin: 16px 10px 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.menu .group svg { width: 13px; height: 13px; flex-shrink: 0; }
.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-ink);
  text-decoration: none;
  padding: 9px 10px;
  font-size: 14px;
  white-space: nowrap;
  border-radius: 10px;
}
.menu a svg { width: 18px; height: 18px; flex-shrink: 0; }
.menu a:hover { background: var(--sidebar-hover); }
.menu a.on {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
  font-weight: 650;
}
.side-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--sidebar-muted);
  gap: 8px;
}
.side-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shell.collapsed .brand { padding: 18px 10px 8px; text-align: center; justify-items: center; }
.shell.collapsed .biz-logo { height: 28px; max-width: 36px; }
.shell.collapsed .brand .kicker,
.shell.collapsed .brand h2,
.shell.collapsed .menu .group span,
.shell.collapsed .menu a span,
.shell.collapsed .side-foot span,
.shell.collapsed .user-chip span { display: none; }
.shell.collapsed .menu .group,
.shell.collapsed .menu a { justify-content: center; margin-left: 0; margin-right: 0; padding-left: 8px; padding-right: 8px; }
.shell.collapsed .side-foot {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 14px;
}
.shell.collapsed .user-chip {
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
}
.shell.collapsed .side-foot #logout {
  width: 100%;
  padding: 7px 4px;
  font-size: 11px;
  white-space: nowrap;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(10px);
}
.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  flex-shrink: 0;
  border-radius: 10px;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); }
.qc-wrap { position: relative; }
.qc-btn { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.qc-btn:hover { background: var(--brand-hover); }
.qc-btn.is-open { background: var(--brand-deep); }
.qc-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 55;
  min-width: 230px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.qc-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--ink);
  border: 0;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.qc-item:hover { background: var(--surface-2); }
.qc-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--brand); }
.qc-card {
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.qc-card h3 { margin-bottom: 12px; }
.qc-card .form-grid { margin-bottom: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.page { padding: 22px 24px 48px; overflow: auto; flex: 1; }

.copilot { margin-bottom: 22px; }
.copilot-box {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow-sm);
}
.copilot-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.copilot-box input {
  border: 0;
  outline: none;
  flex: 1;
  min-width: 0;
  background: transparent;
  padding: 12px 8px;
  font-size: 16px;
  border-radius: 0;
}
.copilot-box input:focus { outline: none; }
.copilot-box button[type="submit"] {
  border-radius: 999px;
  padding: 10px 18px;
  flex-shrink: 0;
}
.copilot-box[data-busy="1"] button[type="submit"] { opacity: 0.65; }
.copilot-hint { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }
button.linkish, .copilot-hint .linkish {
  background: none;
  border: 0;
  color: var(--brand);
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
button.linkish:hover, .copilot-hint .linkish:hover { background: none; text-decoration: underline; }
.copilot-thread {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding: 4px 2px 8px;
}
.copilot-msg {
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 92%;
  font-size: 14px;
  line-height: 1.45;
}
.copilot-msg.user {
  justify-self: end;
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
}
.copilot-msg.bot {
  justify-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
}
.copilot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.copilot-actions a, .copilot-actions span {
  font-size: 12px;
  font-weight: 650;
  color: var(--brand);
  text-decoration: none;
}
.pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 999px;
  text-decoration: none;
}
.pill.on { background: var(--ok-bg); color: var(--ok-ink); }
.pill.off { background: var(--warn-bg); color: var(--warn-ink); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { padding: 16px; border-radius: var(--radius); }
.stat b { display: block; font-size: 28px; }
.stat span { color: var(--muted); font-size: 13px; }

.page .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.page .filters button {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 13px;
}
.page .filters button.on {
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.dash-create { margin: 4px 0 28px; }
.dash-create .kicker { margin-bottom: 10px; }
.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.dash-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.dash-action:hover {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.dash-action svg { width: 20px; height: 20px; color: var(--brand); }

.channel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 980px) {
  .channel-grid { grid-template-columns: 1fr 1fr; }
}
.channel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.channel-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.channel-card h3 { margin: 0; font-size: 16px; }
.channel-howto {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.channel-howto li { margin-bottom: 6px; }
.channel-howto a { color: var(--brand); }
.channel-form {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
}
.channel-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  min-width: 0;
}
.channel-form input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.channel-form .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.webhook-box {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.webhook-box code, .copy-url {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  background: var(--surface-2, var(--bg));
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 14px; border-radius: var(--radius); overflow: hidden; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--brand);
  padding: 10px 12px;
  background: var(--surface-2);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
}
.form-grid.full { grid-template-columns: 1fr; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kanban-col { min-height: 280px; padding: 12px; border-radius: var(--radius); }
.kanban-col h3 { font-size: 13px; margin-bottom: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.kanban-card {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg);
  cursor: pointer;
  border-radius: 10px;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}
.kanban-card:hover { border-color: var(--brand); }
.kanban-card strong { display: block; }
.kanban-card[draggable="true"] { cursor: grab; }
.pix { word-break: break-all; font-size: 12px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  padding: 0;
}
.swatch.on { box-shadow: 0 0 0 2px var(--brand); }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 256px;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }
  .shell.nav-open .side { transform: none; }
  .shell.collapsed .brand .kicker,
  .shell.collapsed .brand h2,
  .shell.collapsed .menu .group span,
  .shell.collapsed .menu a span,
  .shell.collapsed .side-foot span { display: unset; }
  .shell.collapsed .menu .group,
  .shell.collapsed .menu a { justify-content: flex-start; }
  .shell.collapsed .side-foot {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 14px;
  }
  .shell.collapsed .user-chip { width: auto; }
  .shell.collapsed .side-foot #logout { width: auto; padding: 12px 16px; font-size: inherit; }
  .stats, .form-grid, .kanban, .filters-bar { grid-template-columns: 1fr; }
  .tasks-stats { grid-template-columns: 1fr 1fr; }
}
