/* Fluxo · Avanço Commerce */
:root {
  --brand: #6d28d9; --brand-2: #5b21b6; --brand-soft: #ede9fe; --brand-text: #5b21b6;
  --bg: #f4f1fb; --panel: #ffffff; --panel-2: #f7f5fc; --list: #efecf6; --border: #e4dff0;
  --text: #1c1530; --muted: #6b6485; --danger: #dc2626; --ok: #16a34a; --warn: #ca8a04;
  --shadow: 0 1px 2px rgba(30,10,60,.08), 0 1px 1px rgba(30,10,60,.04);
  --radius: 12px;
  --c-verde: #22c55e; --c-amarelo: #eab308; --c-laranja: #f97316; --c-vermelho: #ef4444; --c-roxo: #8b5cf6;
  --c-azul: #3b82f6; --c-ciano: #06b6d4; --c-rosa: #ec4899; --c-cinza: #94a3b8; --c-preto: #334155;
  --top-h: 56px;
  --field: #ffffff; --glass: rgba(255,255,255,.55); --hover: rgba(255,255,255,.75); --border-strong: #d6cdef;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
/* Modo escuro */
html.dark {
  --brand-soft: #2c2052; --brand-text: #c4b5fd;
  --bg: #0e0a1a; --panel: #1a1430; --panel-2: #231b3e; --list: #151027; --border: #2d2550; --border-strong: #3d3270;
  --text: #ece8f8; --muted: #9b93b9; --danger: #f05252;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 1px rgba(0,0,0,.25);
  --field: #120d22; --glass: rgba(20,14,38,.7); --hover: rgba(255,255,255,.06);
  color-scheme: dark;
}
html.dark body[data-color="roxo"] { --bg: #120c22; } html.dark body[data-color="azul"] { --bg: #0b1222; } html.dark body[data-color="verde"] { --bg: #0a1712; }
html.dark body[data-color="laranja"] { --bg: #18110b; } html.dark body[data-color="vermelho"] { --bg: #190c0f; } html.dark body[data-color="amarelo"] { --bg: #16140a; }
html.dark body[data-color="ciano"] { --bg: #091619; } html.dark body[data-color="rosa"] { --bg: #180c15; } html.dark body[data-color="cinza"] { --bg: #111318; } html.dark body[data-color="preto"] { --bg: #0d0f14; }
html.dark .top { background: linear-gradient(90deg, #1c0b3a, #120726); border-bottom: 1px solid #2a1f4d; }
html.dark .btn.danger { background: #3a1418; border-color: #5c1d24; }
html.dark .alert { background: #3a1418; color: #fecaca; }
html.dark .badge.meet { background: #0f2e1c; color: #86efac; }
html.dark .badge.meet.late, html.dark .badge.human { background: #3a1418; color: #fca5a5; }
html.dark .badge.due.soon { background: #3d3410; color: #fde68a; }
html.dark .card:hover { border-color: #5b47a8; }
html.dark .modal { background: rgba(4,2,10,.7); }
html.dark .login-box { border: 1px solid var(--border); }
html.dark ::-webkit-scrollbar-thumb { background: rgba(196,181,253,.18); background-clip: padding-box; border: 2px solid transparent; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45;
  color: var(--text); background: var(--bg); display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased;
}
body.booting > *:not(.login) { visibility: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
a { color: var(--brand-text); }
button { font: inherit; cursor: pointer; border: 0; }
input, textarea, select { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; width: 100%; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-weight: 700; font-size: 12.5px; margin: 12px 0 5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-weight: 600; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn:hover { background: var(--brand-soft); }
.btn.primary { background: linear-gradient(180deg, #7c3aed, #5b21b6); color: #fff; border: 0; box-shadow: 0 4px 12px rgba(91,33,182,.25); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.btn.ghost { background: none; border-color: transparent; }
.btn.wide { width: 100%; margin-top: 16px; padding: 11px; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.icon-btn { background: none; color: var(--muted); padding: 6px 9px; border-radius: 8px; font-size: 15px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.alert { background: #fee2e2; color: #991b1b; border-radius: 10px; padding: 9px 12px; margin-top: 12px; font-size: 13px; }

/* Login */
.login { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px;
  background: radial-gradient(circle at 20% 10%, #3b1d7a 0, transparent 50%), radial-gradient(circle at 80% 90%, #241050 0, transparent 50%), #140a2b; }
.login-box { width: min(380px, 100%); background: var(--panel); border-radius: 20px; padding: 28px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-logo { font-size: 28px; font-weight: 800; text-align: center; letter-spacing: -.03em; color: var(--brand-2); }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #8b5cf6, #4c1d95); color: #fff; font-size: 18px; vertical-align: middle; margin-right: 4px; }

/* Topo */
.top { height: var(--top-h); flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: linear-gradient(90deg, #2c0f57, #1d0a3b); color: #fff; z-index: 20; }
.brand { display: flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-size: 18px; letter-spacing: -.02em; }
.board-pick { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); color: #fff; padding: 7px 12px; border-radius: 10px; max-width: 280px; }
.board-pick b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-pick:hover { background: rgba(255,255,255,.18); }
.bp-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c-roxo); flex-shrink: 0; }
.caret { opacity: .7; font-size: 11px; }
.search-wrap { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search-wrap input { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; padding: 8px 12px; }
.search-wrap input::placeholder { color: rgba(255,255,255,.6); }
.search-wrap input:focus { background: var(--field); color: var(--text); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); color: var(--text); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.25); max-height: 60vh; overflow: auto; padding: 6px; z-index: 30; }
.sr-item { display: block; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.sr-item:hover { background: var(--panel-2); }
.sr-item small { display: block; color: var(--muted); }
.top-btn { background: rgba(255,255,255,.1); color: #fff; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.top-btn:hover { background: rgba(255,255,255,.18); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #8b5cf6, #4c1d95); flex-shrink: 0; }
.avatar.me { width: 34px; height: 34px; padding: 0; border: 2px solid rgba(255,255,255,.4); }
.avatar.me img { border-radius: 50%; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }

/* Barra do quadro */
.board-bar { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--glass); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.board-bar h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; cursor: text; padding: 2px 6px; border-radius: 8px; }
.board-bar h1:hover { background: var(--hover); }
.board-bar h1 input { font-size: 18px; font-weight: 800; padding: 2px 6px; width: 260px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand-text); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag:empty { display: none; }
.bb-filter { display: flex; gap: 6px; align-items: center; }
.bb-filter input { width: 200px; padding: 7px 10px; background: var(--field); }
.bb-btn { color: var(--text); background: var(--panel); border: 1px solid var(--border); padding: 7px 11px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.bb-btn:hover { background: var(--brand-soft); }
.count { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }

/* Quadro */
.board { flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 16px; overflow-x: auto; overflow-y: hidden; }
body[data-color="roxo"] { --bg: #f1ecfc; } body[data-color="azul"] { --bg: #e9f1fd; } body[data-color="verde"] { --bg: #e8f7ee; }
body[data-color="laranja"] { --bg: #fdf0e6; } body[data-color="vermelho"] { --bg: #fcebeb; } body[data-color="amarelo"] { --bg: #fbf6e2; }
body[data-color="ciano"] { --bg: #e5f7fa; } body[data-color="rosa"] { --bg: #fcebf4; } body[data-color="cinza"] { --bg: #eef0f4; } body[data-color="preto"] { --bg: #e6e8ee; }
.list { width: 280px; flex-shrink: 0; max-height: 100%; display: flex; flex-direction: column; background: var(--list); border-radius: 14px; border: 1px solid var(--border); }
.list.dragging-list { opacity: .4; }
.list-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px 12px; cursor: grab; user-select: none; }
.list-head b { flex: 1; font-size: 14px; word-break: break-word; cursor: text; }
.list-head input { padding: 4px 8px; font-weight: 700; }
.list-head .n { font-size: 12px; color: var(--muted); font-weight: 700; }
.list-head .stage { font-size: 10.5px; }
.cards > * { flex-shrink: 0; }
.cards { flex: 1; min-height: 8px; overflow-y: auto; padding: 2px 8px 4px; display: flex; flex-direction: column; gap: 8px; }
.add-card { margin: 4px 8px 8px; padding: 8px 10px; border-radius: 10px; color: var(--muted); background: none; text-align: left; font-weight: 600; }
.add-card:hover { background: var(--hover); color: var(--text); }
.composer { padding: 0 8px 8px; }
.composer textarea { min-height: 62px; resize: none; box-shadow: var(--shadow); }
.composer .row { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.add-list { width: 280px; flex-shrink: 0; background: var(--glass); border: 1px dashed var(--border-strong); border-radius: 14px; padding: 11px 14px; color: var(--muted); font-weight: 700; text-align: left; }
.add-list:hover { background: var(--hover); color: var(--text); }
.add-list-form { width: 280px; flex-shrink: 0; background: var(--list); border-radius: 14px; padding: 8px; }

/* Cartão */
.card { flex-shrink: 0; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); border: 1px solid transparent; cursor: pointer; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card:hover { border-color: #c4b5fd; }
.card .cover { height: 30px; }
.card .in { padding: 8px 10px 8px; }
.card .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.lbl { display: inline-block; min-width: 36px; height: 8px; border-radius: 4px; }
body.labels-open .lbl, .card-box .lbl { height: auto; min-height: 18px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; color: #fff; line-height: 16px; }
.card .t { font-weight: 600; word-break: break-word; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 6px; }
.badge.due.late { background: var(--danger); color: #fff; }
.badge.due.soon { background: #fde68a; color: #713f12; }
.badge.due.done { background: var(--ok); color: #fff; }
.badge.ck.done { background: var(--ok); color: #fff; }
.badge.meet { background: #dcfce7; color: #166534; font-weight: 600; }
.badge.meet.late { background: #fee2e2; color: #991b1b; }
.badge.human { background: #fee2e2; color: #991b1b; font-weight: 700; }
.members { display: flex; margin-left: auto; }
.members .avatar { margin-left: -6px; border: 2px solid var(--panel); }
.card.ghost { position: fixed; z-index: 90; pointer-events: none; transform: rotate(3deg); box-shadow: 0 14px 36px rgba(30,10,60,.3); opacity: .95; }
.placeholder { border-radius: 10px; background: rgba(91,33,182,.12); border: 2px dashed rgba(91,33,182,.35); flex-shrink: 0; }
.card.dragging { display: none; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
.c-verde { background: var(--c-verde); } .c-amarelo { background: var(--c-amarelo); } .c-laranja { background: var(--c-laranja); } .c-vermelho { background: var(--c-vermelho); }
.c-roxo { background: var(--c-roxo); } .c-azul { background: var(--c-azul); } .c-ciano { background: var(--c-ciano); } .c-rosa { background: var(--c-rosa); }
.c-cinza { background: var(--c-cinza); } .c-preto { background: var(--c-preto); }

/* Janela do cartão */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20,8,45,.55); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; }
.modal-box { background: var(--bg); border-radius: 16px; width: min(820px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.35); position: relative; }
.card-box .cover-big { height: 90px; border-radius: 16px 16px 0 0; }
.cb-head { display: flex; gap: 10px; align-items: flex-start; padding: 18px 20px 6px; }
.cb-head .title { color: var(--text); flex: 1; font-size: 19px; font-weight: 800; border: 0; background: none; padding: 4px 6px; margin-left: -6px; resize: none; min-height: 0; overflow: hidden; letter-spacing: -.01em; }
.cb-head .title:focus { background: var(--field); }
.cb-where { padding: 0 20px; font-size: 12.5px; color: var(--muted); }
.cb-cols { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 18px; padding: 14px 20px 22px; }
.cb-side { display: flex; flex-direction: column; gap: 6px; }
.cb-side .side-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 2px; }
.cb-side .btn { justify-content: flex-start; width: 100%; background: var(--panel); }
.sec { margin-bottom: 20px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sec-head h3 { margin: 0; font-size: 15px; font-weight: 800; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.chip-group .side-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.chip-group .row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.add-chip { width: 28px; height: 28px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); font-weight: 800; color: var(--muted); }
.due-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-weight: 600; }
.due-chip input { width: auto; }
.desc-view { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 50px; white-space: pre-wrap; word-break: break-word; cursor: text; }
.desc-view.empty { color: var(--muted); }
.ck { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.ck-head { display: flex; align-items: center; gap: 8px; }
.ck-head b { flex: 1; cursor: text; }
.progress { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 11.5px; color: var(--muted); }
.progress .bar { flex: 1; height: 7px; background: var(--list); border-radius: 4px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .2s; }
.progress.full .bar i { background: var(--ok); }
.item { display: flex; align-items: flex-start; gap: 9px; padding: 5px 4px; border-radius: 8px; }
.item:hover { background: var(--panel-2); }
.item input[type=checkbox] { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--ok); flex-shrink: 0; }
.item .txt { flex: 1; word-break: break-word; cursor: text; }
.item.done .txt { text-decoration: line-through; color: var(--muted); }
.item .icon-btn { padding: 0 6px; opacity: 0; }
.item:hover .icon-btn { opacity: 1; }
.item-add { margin-top: 6px; }
.item-add textarea { min-height: 40px; }
.link-row { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; }
.link-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.comment { display: flex; gap: 9px; margin-top: 12px; }
.comment .bubble { flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; white-space: pre-wrap; word-break: break-word; }
.comment .meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.comment .meta b { color: var(--text); }
.comment .acts { font-size: 12px; margin-top: 3px; }
.comment .acts a { margin-right: 10px; cursor: pointer; }
.act-row { font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.act-row b { color: var(--text); }
.lead-box { background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; }
.lead-box .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead-box .summary { white-space: pre-wrap; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.lead-box h4 { margin: 12px 0 6px; font-size: 13px; }

/* Popover e painel lateral */
.pop { position: fixed; z-index: 70; width: 300px; max-width: calc(100vw - 16px); max-height: 70vh; overflow: auto; background: var(--panel); border-radius: 12px; box-shadow: 0 18px 50px rgba(30,10,60,.28); border: 1px solid var(--border); padding: 12px; }
.pop h4 { margin: 0 0 10px; text-align: center; font-size: 13.5px; }
.pop .opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pop .opt:hover { background: var(--panel-2); }
.pop .opt .chk { margin-left: auto; color: var(--brand); font-weight: 800; }
.pop .lbl-opt { flex: 1; height: 30px; border-radius: 6px; color: #fff; font-weight: 700; display: flex; align-items: center; padding: 0 10px; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0; }
.swatches button { height: 30px; border-radius: 6px; border: 2px solid transparent; }
.swatches button.on { border-color: var(--text); }
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(20,8,45,.35); display: flex; justify-content: flex-end; }
.drawer-box { width: min(380px, 100%); height: 100%; background: var(--panel); display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.2); }
.drawer-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-head b { flex: 1; font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px 24px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px; border-radius: 10px; background: none; text-align: left; font-weight: 600; color: var(--text); }
.menu-item:hover { background: var(--panel-2); }
.menu-item.danger { color: var(--danger); }
.mini-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; }
.mini-card small { display: block; color: var(--muted); }
.board-tile { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.board-tile:hover, .board-tile.on { background: var(--panel-2); }
.board-tile .sw { width: 28px; height: 22px; border-radius: 6px; flex-shrink: 0; }
.board-tile small { margin-left: auto; color: var(--muted); font-weight: 500; }
.empty { flex: 1; display: grid; place-items: center; color: var(--muted); padding: 40px; text-align: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1c1530; color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 120; max-width: min(460px, calc(100vw - 24px)); box-shadow: 0 12px 32px rgba(0,0,0,.3); font-weight: 500; }
.toast.error { background: var(--danger); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(91,33,182,.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* Celular */
@media (max-width: 760px) {
  :root { --top-h: 52px; }
  .top { gap: 8px; padding: 0 10px; }
  .brand b, .hide-sm { display: none; }
  .board-pick { max-width: 46vw; }
  .search-wrap { max-width: none; }
  .search-wrap input { font-size: 16px; padding: 7px 10px; }
  .search-wrap input:not(:focus)::placeholder { color: transparent; }
  .search-wrap input:not(:focus) { background: rgba(255,255,255,.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 9px center / 17px; }
  .search-results { position: fixed; top: var(--top-h); left: 8px; right: 8px; }
  .top-btn { padding: 8px 10px; }
  .board-bar { padding: 8px 10px; gap: 6px; }
  .board-bar h1 { font-size: 16px; }
  .sync { display: none; }
  .bb-filter { order: 10; width: 100%; }
  .bb-filter input { flex: 1; width: auto; font-size: 16px; }
  .board { gap: 10px; padding: 10px; scroll-snap-type: x mandatory; scroll-padding: 10px; }
  .list, .add-list, .add-list-form { width: 84vw; scroll-snap-align: start; }
  input, textarea, select { font-size: 16px; }
  .modal { padding: 0; align-items: stretch; }
  .modal-box { border-radius: 0; min-height: 100%; }
  .card-box .cover-big { border-radius: 0; }
  .modal-box { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .cb-cols { grid-template-columns: minmax(0, 1fr); padding: 10px 14px 30px; }
  .cb-cols > * { min-width: 0; }
  .cb-side { order: -1; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .cb-side .side-label { display: none; }
  .cb-side .btn { width: auto; min-width: 0; flex: 1 1 calc(50% - 6px); }
  .card-box a, .card-box .txt, .desc-view { overflow-wrap: anywhere; }
  .board-bar .grow { display: none; }
  .board-bar #board-menu-btn { margin-left: auto; }
  .board-bar h1 { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cb-head { padding: 14px 14px 4px; }
  .cb-where { padding: 0 14px; }
  .item .icon-btn { opacity: 1; }
  .pop { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; max-height: 80vh; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* Foto de perfil e Minha conta */
.avatar { overflow: hidden; }
.avatar img, .acc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-top { display: flex; align-items: center; gap: 16px; margin: 4px 0 8px; }
.acc-photo { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #4c1d95); box-shadow: 0 10px 26px -12px rgba(76,29,149,.7); }
.acc-photo:hover { filter: brightness(1.08); }
.acc-photo-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acc-row { display: flex; gap: 8px; align-items: center; }
.acc-row input { flex: 1; min-width: 0; }
.acc-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: 8px 0 4px; }
.acc-h { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; }
.acc-note { background: var(--brand-soft); color: var(--brand-text); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; margin: 14px 0 0; }

/* ID do login, discreto */
.uid { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--muted); opacity: .75; margin-left: 6px; letter-spacing: .02em; }
.pop .opt .uid { margin-left: auto; }
.pop .opt .uid + .chk { margin-left: 8px; }

/* ================= Início (tela geral) e Tarefas ================= */
body[data-view="home"] .board-bar, body[data-view="home"] #board, body[data-view="home"] #empty-board,
body[data-view="tasks"] .board-bar, body[data-view="tasks"] #board, body[data-view="tasks"] #empty-board { display: none !important; }
.home {
  --h-bg: #f3f0fb; --h-grid: rgba(109,40,217,.07); --h-glow1: rgba(139,92,246,.22); --h-glow2: rgba(34,197,94,.14);
  --h-card: rgba(255,255,255,.82); --h-card-border: rgba(109,40,217,.16); --h-line: rgba(109,40,217,.12);
  flex: 1; min-height: 0; overflow-y: auto; position: relative;
  background:
    radial-gradient(ellipse 60% 45% at 12% 0%, var(--h-glow1), transparent 70%),
    radial-gradient(ellipse 50% 40% at 95% 30%, var(--h-glow2), transparent 70%),
    linear-gradient(var(--h-grid) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, var(--h-grid) 1px, transparent 1px) 0 0 / 34px 34px,
    var(--h-bg);
}
html.dark .home {
  --h-bg: #07050f; --h-grid: rgba(167,139,250,.06); --h-glow1: rgba(124,58,237,.32); --h-glow2: rgba(16,185,129,.16);
  --h-card: rgba(22,16,42,.78); --h-card-border: rgba(167,139,250,.18); --h-line: rgba(167,139,250,.12);
}
.home-in { max-width: 1140px; margin: 0 auto; padding: 34px 24px 70px; position: relative; }
.mono { font-family: var(--mono); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--brand-text); margin: 0 0 8px; text-transform: lowercase; }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.hero h1 .grad { background: linear-gradient(90deg, #7c3aed, #c026d3 55%, #22c55e); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.dark .hero h1 .grad { background: linear-gradient(90deg, #a78bfa, #e879f9 55%, #4ade80); -webkit-background-clip: text; background-clip: text; }
.hero .sub { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.hero-side { display: flex; align-items: center; gap: 16px; text-align: right; }
.hero-clock { display: flex; flex-direction: column; align-items: flex-end; }
.clock { font-family: var(--mono); font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.clock-date { color: var(--muted); font-size: 13px; margin-top: 6px; }
.pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: var(--h-card); border: 1px solid var(--h-card-border); font-size: 12.5px; font-weight: 600; backdrop-filter: blur(8px); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
.pulse.off { background: #f59e0b; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.theme-btn { background: var(--h-card); border: 1px solid var(--h-card-border); color: var(--text); width: 38px; height: 38px; border-radius: 12px; font-size: 17px; backdrop-filter: blur(8px); }

.portals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.portal {
  --acc: #8b5cf6; --acc-2: #6d28d9; --acc-soft: rgba(139,92,246,.14);
  position: relative; overflow: hidden; border-radius: 24px; padding: 24px 24px 20px; cursor: pointer; text-align: left; color: var(--text);
  background: var(--h-card); border: 1px solid var(--h-card-border); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -30px rgba(40,10,90,.45); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  display: flex; flex-direction: column; gap: 16px; min-height: 330px;
}
.portal.wa { --acc: #22c55e; --acc-2: #15803d; --acc-soft: rgba(34,197,94,.14); }
.portal::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--acc-soft), transparent 65%); pointer-events: none; }
.portal::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--acc), transparent); opacity: .8; }
.portal:hover { transform: translateY(-4px); border-color: var(--acc); box-shadow: 0 30px 60px -28px var(--acc); }
.portal:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.p-head { display: flex; align-items: center; gap: 14px; position: relative; }
.p-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #fff; box-shadow: 0 10px 24px -8px var(--acc); flex-shrink: 0; }
.p-icon svg { width: 27px; height: 27px; }
.p-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.p-sub { color: var(--muted); font-size: 13px; }
.p-tag { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--acc); border: 1px solid var(--acc); border-radius: 999px; padding: 2px 9px; opacity: .85; white-space: nowrap; }
.p-big { display: flex; align-items: baseline; gap: 10px; position: relative; }
.p-big b { font-family: var(--mono); font-size: 52px; font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.p-big span { color: var(--muted); font-weight: 600; }
.p-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; position: relative; }
.p-stat { border: 1px solid var(--h-line); border-radius: 14px; padding: 10px 12px; background: rgba(127,127,160,.04); }
.p-stat .v { font-family: var(--mono); font-size: 22px; font-weight: 500; line-height: 1.1; }
.p-stat .k { color: var(--muted); font-size: 12px; font-weight: 600; }
.p-stat.alert-on { border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.08); }
.p-stat.alert-on .v { color: var(--danger); }
.seg { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--h-line); gap: 2px; }
.seg i { display: block; height: 100%; min-width: 3px; }
.seg-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.seg-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--dot); }
.p-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--h-line); position: relative; }
.p-foot .cta { font-weight: 800; color: var(--acc); display: inline-flex; align-items: center; gap: 6px; }
.portal:hover .cta .arr { transform: translateX(4px); }
.cta .arr { transition: transform .18s; }
.p-foot small { color: var(--muted); }
.mini-boards { display: flex; flex-direction: column; gap: 8px; position: relative; }
.mini-board { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mini-board .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.mini-board .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mini-board .bar { width: 90px; height: 6px; border-radius: 999px; background: var(--h-line); overflow: hidden; flex-shrink: 0; }
.mini-board .bar i { display: block; height: 100%; background: var(--acc); }
.mini-board small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; width: 34px; text-align: right; }

.lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.panel-h { background: var(--h-card); border: 1px solid var(--h-card-border); border-radius: 20px; padding: 18px 18px 12px; backdrop-filter: blur(12px); }
.panel-h h3 { margin: 0 0 10px; font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.panel-h h3 .kicker { margin: 0 0 0 auto; }
.row-h { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; cursor: pointer; }
.row-h:hover { background: var(--hover); }
.row-h .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-h .grow small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-h .when { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.row-h .when.late { color: var(--danger); }
.dot-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); flex-shrink: 0; font-size: 14px; }
.empty-h { color: var(--muted); padding: 10px 8px 14px; font-size: 13px; }

/* Tarefas: galeria de quadros */
.tasks-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.tasks-head .back { background: var(--h-card); border: 1px solid var(--h-card-border); color: var(--text); border-radius: 12px; padding: 8px 12px; font-weight: 700; backdrop-filter: blur(8px); }
.tasks-head h1 { margin: 0; font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.03em; }
.tasks-head .sub { color: var(--muted); margin: 4px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile {
  position: relative; overflow: hidden; border-radius: 20px; padding: 18px 18px 14px; cursor: pointer; color: var(--text); text-align: left;
  background: var(--h-card); border: 1px solid var(--h-card-border); backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 12px; min-height: 200px;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tc, var(--c-roxo)); }
.tile::after { content: ""; position: absolute; right: -30%; top: -50%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tc, #8b5cf6) 22%, transparent), transparent 65%); pointer-events: none; }
.tile:hover { transform: translateY(-3px); border-color: var(--tc); box-shadow: 0 24px 50px -30px var(--tc); }
.tile .t-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; padding-right: 30px; word-break: break-word; }
.tile .t-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.tile .chip { font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--h-line); color: var(--muted); }
.tile .chip.late { color: var(--danger); border-color: rgba(239,68,68,.45); }
.tile .lists-mini { display: flex; flex-direction: column; gap: 5px; }
.tile .lm { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.tile .lm .nm { width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .lm .bar { flex: 1; height: 5px; border-radius: 999px; background: var(--h-line); overflow: hidden; }
.tile .lm .bar i { display: block; height: 100%; background: var(--tc); opacity: .85; }
.tile .lm b { font-family: var(--mono); font-weight: 500; width: 22px; text-align: right; color: var(--text); }
.tile .t-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.tile .t-foot .open { color: var(--tc); font-weight: 800; }
.tile.leads { --tc: #22c55e; }
.tile.new { border-style: dashed; align-items: stretch; justify-content: center; cursor: default; }
.tile.new::before, .tile.new::after { display: none; }
.tile.new:hover { transform: none; box-shadow: none; }
.tile.new input { margin-top: 4px; }
.tasks-foot { margin-top: 18px; }
.tasks-foot button { background: none; color: var(--muted); font-weight: 600; padding: 6px 0; }
.tasks-foot button:hover { color: var(--text); }
@media (max-width: 860px) {
  .portals, .lower { grid-template-columns: minmax(0, 1fr); }
  .portal { min-height: 0; }
}
@media (max-width: 760px) {
  .home-in { padding: 20px 14px 50px; }
  .hero { align-items: flex-start; }
  .hero-side { text-align: left; width: 100%; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .hero-clock { align-items: flex-start; }
  .clock { font-size: 26px; }
  .clock-date { margin-top: 0; }
  .pill { margin-top: 0; }
  .p-big b { font-size: 42px; }
  .portal { padding: 20px 18px 16px; border-radius: 20px; }
  .p-tag { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
}

.pop .opt.danger { color: var(--danger); }

.bb-select { width: auto; max-width: 190px; padding: 7px 10px; border-radius: 10px; font-weight: 600; font-size: 13px; }
.composer .for-who { width: 100%; margin-top: 6px; padding: 6px 8px; font-size: 13px; border-radius: 8px; }
