:root {
  /* Identidade Prysmo: navy + cyan sobre claro, tipografia Roboto */
  --paper:    #eef2f7;   /* fundo            */
  --surface:  #ffffff;   /* cartões          */
  --surface-2:#eef2f7;   /* campos / chips   */
  --navy:     #1F2B4A;   /* marca / texto    */
  --ink:      #1F2B4A;
  --muted:    #69748b;
  --line:     #e1e7f0;
  --accent:   #0F9FBC;   /* cyan Prysmo (legível no branco) */
  --accent-d: #0B7E96;
  --accent-soft: #def1f6;
  --cyan:     #00B3CC;   /* cyan do logo     */
  --blue:     #0B82E6;   /* azul Prysmo (IA) */
  --blue-soft:#e2eefd;
  --amber:    #9a6b14;
  --amber-soft:#f6ecd2;
  --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); }
.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.7rem; }
.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: #fbe7e2; color: #9a3320; padding: .6rem .8rem; border-radius: 10px;
  border: 1px solid #f0c9bf; font-size: .9rem; margin-top: 1rem; text-align: left; }

/* ---------- inputs ---------- */
input, select, textarea, button { font: inherit; color: var(--ink); }
input, select, textarea {
  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, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; line-height: 1.6; }
select { appearance: none; background-image:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2369748b' stroke-width='1.6'><path d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2rem; }

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; }
/* CTA primária estilo Prysmo: pílula azul→cyan com chevron */
.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); box-shadow: 0 10px 22px -9px var(--blue); }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-block { width: 100%; margin-top: 1.4rem; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }
.btn-ia { background: var(--blue-soft); color: var(--blue); border-color: #cfe2fb; }
.btn-ia:hover { background: #d4e6fc; }
.btn-mini { padding: .42rem .95rem; font-size: .86rem; }

/* ---------- 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; }
.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; }
.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: 1200px; margin: 1.8rem auto; padding: 0 1.6rem; }
.panel { display: none; animation: fade .35s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: 1fr 1.18fr; gap: 1.4rem; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.field { display: block; margin-bottom: 1rem; color: var(--muted); font-size: .82rem; font-weight: 600; }
.field > * { margin-top: .4rem; font-weight: 400; }
.row { display: flex; gap: .65rem; align-items: center; }
.status { margin: .8rem 0 0; font-size: .85rem; color: var(--muted); min-height: 1.2em; }

/* empty state */
.empty { display: grid; place-items: center; min-height: 320px; text-align: center; }
.empty-art { font-size: 3.4rem; color: var(--accent-soft); line-height: .7; margin-bottom: .6rem; font-weight: 700; }

/* ---------- result ---------- */
.block { margin-bottom: 1.4rem; }
.block:last-child { margin-bottom: 0; }
.block h3 { margin: 0 0 .6rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.resumo { color: var(--ink); background: var(--surface-2);
  border-left: 3px solid var(--accent); padding: .7rem .9rem; border-radius: 0 10px 10px 0; font-size: .94rem; }

.issue-hero { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #f7fcfd, var(--surface)); }
.issue-hero.ia { background: linear-gradient(180deg, #f1f7fe, var(--surface)); border-color: #d3e4fb; }
.issue-hero .ih-text { font-size: 1.15rem; font-weight: 600; line-height: 1.35; color: var(--navy); }
.issue-hero .ih-meta { display: flex; align-items: center; gap: .7rem; margin-top: .6rem; flex-wrap: wrap; }

.note { display: flex; gap: .6rem; align-items: flex-start; background: var(--amber-soft);
  border: 1px solid #ecd9ad; border-radius: 11px; padding: .7rem .9rem; color: #6f4e0e; font-size: .9rem; }
.note b { font-weight: 700; }

.tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: .16rem .55rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.tag.base { background: var(--accent-soft); color: var(--accent-d); }
.tag.ia { background: var(--blue-soft); color: var(--blue); }

/* confidence */
.conf { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .8rem; }
.conf-bar { width: 64px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.conf-fill { height: 100%; background: var(--accent); border-radius: 4px; }

.similar { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.similar:last-child { border-bottom: none; }
.similar .s-issue { flex: 1; font-size: .92rem; }
.similar .s-rank { font-weight: 700; color: var(--accent); width: 1.2rem; }

.issue-item { background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: .8rem .95rem; margin-bottom: .6rem; transition: border-color .15s; }
.issue-item:hover { border-color: var(--accent); }
.issue-item .it-issue { font-weight: 600; color: var(--navy); }
.it-meta { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; color: var(--muted); font-size: .78rem; flex-wrap: wrap; }
.it-trecho { color: var(--muted); font-size: .82rem; margin-top: .35rem; font-style: italic;
  border-left: 2px solid var(--line); padding-left: .6rem; }
.it-none { color: var(--muted); font-weight: 600; font-style: italic; }
.it-foot { margin-top: .55rem; }
.gen-link { background: none; border: none; padding: 0; font-size: .8rem; font-weight: 600;
  color: var(--blue); opacity: .85; cursor: pointer; }
.gen-link:hover { opacity: 1; text-decoration: underline; }
.gen-link:disabled { cursor: progress; }
.gen-result { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; flex-wrap: wrap; }
.gen-text { font-weight: 600; color: var(--blue); }
.count-pill { background: var(--accent-soft); color: var(--accent-d); font-weight: 700;
  border-radius: 999px; padding: .05rem .5rem; font-size: .72rem; }

/* busca */
.busca-controls { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.grow { flex: 1 1 240px; margin-bottom: 0; }
.ou { color: var(--muted); padding-bottom: .65rem; font-style: italic; }
.busca-card .status { margin-bottom: .4rem; }

.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); } }
