:root {
  /* Identidade Prysmo: navy + cyan sobre claro, tipografia Roboto */
  --paper:    #eef2f7;
  --surface:  #ffffff;
  --surface-2:#eef2f7;
  --navy:     #1F2B4A;
  --ink:      #1F2B4A;
  --muted:    #69748b;
  --line:     #e1e7f0;
  --accent:   #0F9FBC;
  --accent-d: #0B7E96;
  --accent-soft: #def1f6;
  --cyan:     #00B3CC;
  --blue:     #0B82E6;
  --blue-soft:#e2eefd;
  --amber:    #9a6b14;
  --amber-soft:#f6ecd2;
  --red:      #b3392a;
  --red-soft: #fbe7e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,43,74,.05), 0 10px 28px -14px rgba(31,43,74,.22);
  font-size: 15.5px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Roboto", system-ui, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1100px 520px at 88% -10%, #e3eef5 0%, transparent 60%);
}
h1, h2, h3 { font-family: "Roboto", sans-serif; font-weight: 700; letter-spacing: -.01em; color: var(--navy); margin: 0; }
.muted { color: var(--muted); }
.logo { height: 24px; display: block; }
.login-brand .logo { height: 34px; margin: 0 auto; }

/* ---------- login ---------- */
.login-bg { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--surface); padding: 2.6rem 2.4rem; border-radius: 18px;
  width: 374px; border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
.login-brand { margin-bottom: 1.4rem; }
.login-card h1 { margin: .4rem 0 .1rem; font-size: 1.55rem; }
.login-card .muted { margin-top: 0; }
.login-card label { display: block; margin: 1.05rem 0 .25rem; font-size: .8rem;
  color: var(--muted); font-weight: 600; text-align: left; }
.login-card input { width: 100%; }
.alert { background: var(--red-soft); color: #9a3320; padding: .6rem .8rem; border-radius: 10px;
  border: 1px solid #f0c9bf; font-size: .9rem; margin-top: 1rem; text-align: left; }

/* ---------- inputs / botões ---------- */
input, select, textarea, button { font: inherit; color: var(--ink); }
input { width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: .65rem .8rem; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button { cursor: pointer; border: 1px solid transparent; border-radius: 999px;
  padding: .6rem 1.3rem; font-weight: 500; transition: filter .15s, background .15s, border-color .15s, box-shadow .15s; }
.btn-primary { background: linear-gradient(135deg, #1f6fd0, var(--blue)); color: #fff;
  box-shadow: 0 8px 18px -9px var(--blue); font-weight: 500; }
.btn-primary::after { content: "›"; font-weight: 700; margin-left: .5rem; opacity: .9; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-block { width: 100%; margin-top: 1.4rem; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 1.2rem; padding: .8rem 1.6rem;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-title { color: var(--muted); font-weight: 600; font-size: .9rem;
  border-left: 1px solid var(--line); padding-left: 1.2rem; }
.user { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.user-name { color: var(--navy); font-weight: 600; font-size: .9rem; }
.logout { color: var(--muted); text-decoration: none; font-size: .85rem; }
.logout:hover { color: var(--accent); }

main { max-width: 1180px; margin: 1.6rem auto; padding: 0 1.6rem; }
.card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.status { margin: .4rem 0; font-size: .85rem; color: var(--muted); min-height: 1.2em; }

/* ---------- seletor de dia ---------- */
.daybar { margin-bottom: 1.1rem; }
.daybar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.daybar-head h2 { font-size: 1.15rem; }
.daybar-head .muted { margin: .25rem 0 0; font-size: .85rem; max-width: 560px; }
.daybar-stats { display: flex; gap: 1.4rem; }
.daybar-stats .ds { text-align: right; }
.daybar-stats .ds b { display: block; font-size: 1.35rem; color: var(--navy); line-height: 1; }
.daybar-stats .ds span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.daychips { display: flex; gap: .55rem; margin-top: 1.1rem; flex-wrap: wrap; }
.daychip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: .55rem .9rem; min-width: 92px; text-align: center; cursor: pointer; transition: all .15s; }
.daychip:hover { border-color: var(--accent); }
.daychip .dc-wd { font-weight: 700; color: var(--navy); font-size: .92rem; }
.daychip .dc-n { font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.daychip.active { background: var(--accent-soft); border-color: var(--accent); }
.daychip.active .dc-wd { color: var(--accent-d); }
.daychip.today::after { content: "hoje"; display: block; font-size: .6rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--blue); font-weight: 700; margin-top: .1rem; }

.demo-note { margin: 1rem 0 0; font-size: .78rem; color: var(--muted);
  background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; }
.demo-note b { color: var(--navy); }

/* ---------- legenda ---------- */
.legend { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; padding: .8rem 1.4rem; margin-bottom: 1.4rem; }
.legend-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.lg { font-size: .85rem; color: var(--ink); display: inline-flex; align-items: center; gap: .45rem; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.red { background: var(--red); } .dot.blue { background: var(--blue); } .dot.amber { background: var(--amber); }

/* ---------- feed ---------- */
.feed { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 880px) { .feed { grid-template-columns: 1fr; } }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.post.removida { border-color: #f0c9bf; }

.post-head { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.2rem .7rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 auto; }
.post-who { line-height: 1.2; flex: 1; min-width: 0; }
.post-who .name { font-weight: 700; color: var(--navy); font-size: .92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-who .meta { font-size: .76rem; color: var(--muted); }
.net { font-size: .68rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.post-text { padding: 0 1.2rem .9rem; color: var(--ink); font-size: .94rem; white-space: pre-wrap; }
.post.removida .post-text { color: var(--muted); }
.post-foot { padding: 0 1.2rem 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.theme-pill { font-size: .74rem; background: var(--accent-soft); color: var(--accent-d);
  border-radius: 999px; padding: .15rem .6rem; font-weight: 600; }

.badge-remove { display: inline-flex; align-items: center; gap: .4rem; background: var(--red-soft);
  color: var(--red); border: 1px solid #f0c9bf; border-radius: 999px; padding: .2rem .65rem;
  font-size: .76rem; font-weight: 700; }

/* ---------- bloco de similares ---------- */
.sim-block { border-top: 1px solid var(--line); background: #fafbfd; padding: .9rem 1.2rem 1.1rem; }
.sim-head { display: flex; align-items: center; gap: .5rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .7rem; }
.count-pill { background: var(--accent-soft); color: var(--accent-d); font-weight: 700;
  border-radius: 999px; padding: .05rem .5rem; font-size: .72rem; letter-spacing: 0; }
.sim-empty { color: var(--muted); font-size: .85rem; font-style: italic; }

.sim { border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px;
  padding: .65rem .8rem; margin-bottom: .6rem; background: var(--surface); }
.sim:last-child { margin-bottom: 0; }
.sim.red   { border-left-color: var(--red); }
.sim.blue  { border-left-color: var(--blue); }
.sim.amber { border-left-color: var(--amber); }

.sim-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; flex-wrap: wrap; }
.etq { font-size: .72rem; font-weight: 700; padding: .13rem .55rem; border-radius: 999px; }
.etq.red   { background: var(--red-soft);    color: var(--red); }
.etq.blue  { background: var(--blue-soft);   color: var(--blue); }
.etq.amber { background: var(--amber-soft);  color: var(--amber); }
.sim-sim { margin-left: auto; font-size: .76rem; color: var(--muted); font-weight: 600; }
.sim-author { font-size: .82rem; color: var(--navy); font-weight: 600; }
.sim-text { font-size: .84rem; color: var(--muted); font-style: italic; margin: .3rem 0;
  border-left: 2px solid var(--line); padding-left: .55rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sim-nota { font-size: .8rem; color: var(--ink); margin-top: .3rem; }
.sim-chips { display: flex; gap: .4rem; margin-top: .45rem; flex-wrap: wrap; }
.chip { font-size: .68rem; color: var(--muted); background: var(--surface-2);
  border-radius: 6px; padding: .08rem .45rem; }
.chip b { color: var(--navy); font-weight: 600; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -2px; margin-right: .4rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- abas (topbar nav) ---------- */
.tabs { display: flex; gap: .25rem; margin-left: 1.2rem; }
.tab { background: transparent; color: var(--muted); border: none; padding: .5rem .95rem;
  border-radius: 8px; font-weight: 500; }
.tab:hover { color: var(--navy); }
.tab.active { background: var(--accent-soft); color: var(--accent-d); font-weight: 600; }
.panel { display: none; animation: fade .3s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- filtros de cenário ---------- */
.dup-filtros { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.fchip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .9rem; font-size: .82rem; color: var(--muted); font-weight: 600; }
.fchip:hover { border-color: var(--accent); color: var(--navy); }
.fchip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-d); }

/* ---------- grupos de duplicatas ---------- */
.dup-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.2rem; margin-bottom: 1.1rem; }
.dg-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem;
  padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.dg-title { font-weight: 700; color: var(--navy); font-size: .98rem; }

.dup-rel { border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px;
  padding: .7rem .85rem; margin-bottom: .6rem; background: #fafbfd; }
.dup-rel:last-child { margin-bottom: 0; }
.dup-rel.red { border-left-color: var(--red); } .dup-rel.blue { border-left-color: var(--blue); }
.dup-rel.amber { border-left-color: var(--amber); }
.dr-top { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .6rem; }
.dr-top .sim-chips { margin-top: 0; margin-left: auto; }
.dr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 760px) { .dr-pair { grid-template-columns: 1fr; } }
.dr-post { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: .55rem .7rem; }
.dr-post.rmv { background: var(--red-soft); border-color: #f0c9bf; }
.dr-meta { font-size: .8rem; color: var(--navy); font-weight: 600; margin-bottom: .3rem; }
.dr-lado { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--surface-2); border-radius: 5px; padding: .05rem .4rem; font-weight: 700; }
.dr-text { font-size: .85rem; color: var(--muted); font-style: italic; }

/* ---------- aba: última execução (singletons) ---------- */
.lr-singletons { margin-top: 1rem; padding: .6rem .9rem; }
.lr-singletons > summary { cursor: pointer; font-weight: 600; color: var(--navy);
  font-size: .85rem; padding: .2rem 0; }
.lr-single { padding: .5rem .2rem; border-top: 1px solid var(--surface-2); font-size: .82rem; }
.lr-single:first-of-type { border-top: none; }
#lr-meta { font-size: .8rem; }
