/* Central de Chamados de TI — Grupo ICF
   Para trocar as cores da marca, altere --brand e --brand-ink abaixo. */
:root {
  --brand: #0b3b6e;
  --brand-600: #0f4c8a;
  --brand-ink: #ffffff;
  --brand-soft: #e8f0fa;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e7ee;
  --border-strong: #cfd7e2;
  --text: #17212e;
  --text-2: #4b5868;
  --text-3: #7a8696;
  --focus: #2f7de1;

  --blue: #1d64c9;   --blue-bg: #e7f0fd;
  --amber: #a15c00;  --amber-bg: #fff3dc;
  --violet: #6a3fc3; --violet-bg: #f1ebfd;
  --green: #18794e;  --green-bg: #e3f5ec;
  --gray: #5b6675;   --gray-bg: #eef1f5;
  --red: #c4291c;    --red-bg: #fde9e7;
  --orange: #b54708; --orange-bg: #fff0e3;
  --note-bg: #fff8e1; --note-border: #f1d58a;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: .86rem; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-3); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255,255,255,.14); font-size: .78rem; letter-spacing: .02em;
}
.brand small { display: block; font-weight: 500; opacity: .75; font-size: .74rem; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a {
  color: rgba(255,255,255,.82); padding: 8px 12px; border-radius: 7px; font-weight: 550; font-size: .92rem; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.18); color: #fff; }
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; background: transparent; border: 0; color: inherit;
  padding: 6px 8px; border-radius: 8px; cursor: pointer; font: inherit;
}
.user-btn:hover { background: rgba(255,255,255,.1); }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .78rem;
}
.topbar .avatar { background: rgba(255,255,255,.2); color: #fff; }
.user-btn .who { text-align: left; line-height: 1.15; font-size: .86rem; }
.user-btn .who small { display: block; opacity: .7; font-size: .74rem; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
}
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px; color: var(--text);
  background: none; border: 0; font: inherit; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Página ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 20px 64px; }
.page-narrow { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .9rem; margin-bottom: 12px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-600); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #136640; }
.btn-danger-ghost { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: .85rem; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 1rem; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: .88rem; color: var(--text); }
.field .hint { font-size: .82rem; color: var(--text-3); }
.req { color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
}
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47,125,225,.18); }
select.input { padding-right: 32px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237a8696' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input-sm { height: 36px; font-size: .9rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-error { background: var(--red-bg); color: var(--red); padding: 10px 12px; border-radius: var(--radius-sm); font-size: .9rem; }

/* Prioridade (cartões de escolha) */
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.choice label strong { display: flex; align-items: center; gap: 7px; font-size: .93rem; }
.choice label span { font-size: .8rem; color: var(--text-2); }
.choice label em { font-style: normal; font-size: .76rem; color: var(--text-3); margin-top: 2px; }
.choice input:checked + label { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.choice input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Anexos */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 16px; text-align: center;
  color: var(--text-2); font-size: .9rem; cursor: pointer; background: var(--surface-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 8px 6px 10px; font-size: .84rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
}
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.file-chip small { color: var(--text-3); }
.file-chip button { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 1rem; line-height: 1; padding: 0 2px; }
a.file-chip:hover { border-color: var(--brand); text-decoration: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs a { display: block; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.thumbs img { display: block; max-width: 220px; max-height: 160px; object-fit: cover; }

/* ---------- Selos ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: .78rem; font-weight: 650; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.st-aberto { color: var(--blue); background: var(--blue-bg); }
.st-em_andamento { color: var(--amber); background: var(--amber-bg); }
.st-aguardando { color: var(--violet); background: var(--violet-bg); }
.st-resolvido { color: var(--green); background: var(--green-bg); }
.st-fechado { color: var(--gray); background: var(--gray-bg); }
.st-cancelado { color: var(--gray); background: var(--gray-bg); text-decoration: line-through; }
.pr-baixa { color: var(--gray); background: var(--gray-bg); }
.pr-media { color: var(--blue); background: var(--blue-bg); }
.pr-alta { color: var(--orange); background: var(--orange-bg); }
.pr-urgente { color: #fff; background: var(--red); }
.badge-late { color: var(--red); background: var(--red-bg); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.pr-baixa { background: var(--gray); } .dot.pr-media { background: var(--blue); }
.dot.pr-alta { background: var(--orange); } .dot.pr-urgente { background: var(--red); }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: radial-gradient(circle at 20% 110%, rgba(255,255,255,.12), transparent 50%), radial-gradient(circle at 110% 0%, rgba(255,255,255,.08), transparent 45%);
}
.auth-side h1 { font-size: 2.1rem; max-width: 460px; margin: 18px 0 12px; }
.auth-side p { opacity: .8; max-width: 440px; font-size: 1.02rem; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; opacity: .92; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.16); font-size: .75rem; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 1.4rem; margin-bottom: 6px; }

/* ---------- Painel / KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi {
  display: block; padding: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
a.kpi:hover { border-color: var(--brand); text-decoration: none; }
.kpi .v { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .82rem; color: var(--text-2); margin-top: 4px; }
.kpi.alert .v { color: var(--red); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bars { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 4px 10px; align-items: center; font-size: .86rem; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-row .n { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand-600); border-radius: 4px; }
.metrics { display: grid; gap: 1px; background: var(--border); }
.metric { background: var(--surface); padding: 16px 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.metric .v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.empty { padding: 32px 20px; text-align: center; color: var(--text-3); }
.empty h3 { color: var(--text-2); margin-bottom: 4px; }

/* ---------- Listas de chamados ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--gray-bg); font-size: .76rem; text-align: center; }

.tlist { display: flex; flex-direction: column; }
.titem {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text);
}
.titem:last-child { border-bottom: 0; }
.titem:hover { background: var(--surface-2); text-decoration: none; }
.titem .num { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; font-size: .86rem; }
.titem .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titem .meta { grid-column: 2; font-size: .83rem; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }
.titem .side { grid-row: 1 / span 2; grid-column: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.titem.needs-me { box-shadow: inset 3px 0 0 var(--violet); }
.callout {
  display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
  background: var(--violet-bg); color: #4c2a92; font-size: .92rem;
}
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; margin-bottom: 22px;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-600) 100%); color: #fff; border-radius: 14px;
}
.hero h1 { font-size: 1.45rem; }
.hero p { opacity: .85; margin-top: 4px; }
.hero .btn { background: #fff; color: var(--brand); border-color: #fff; }
.hero .btn:hover { background: var(--brand-soft); }

/* Tabela (fila) */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: center; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover td { background: var(--surface-2); }
.tbl .num { color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .ttl { font-weight: 600; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .nowrap { white-space: nowrap; }
.late { color: var(--red); font-weight: 650; }
.ok-time { color: var(--text-2); }

/* ---------- Detalhe do chamado ---------- */
.t-head { margin-bottom: 20px; }
.t-head .num { color: var(--text-3); font-weight: 600; font-size: .9rem; }
.t-head h1 { margin: 6px 0 10px; font-size: 1.55rem; }
.t-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
.msg .bubble { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.msg .bubble-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: .88rem; }
.msg .bubble-head strong { font-weight: 650; }
.msg .bubble-body { padding: 14px 16px; overflow-wrap: anywhere; }
.msg .bubble-body .text { white-space: pre-wrap; }
.msg.ti .avatar { background: var(--brand); color: #fff; }
.msg.ti .bubble { border-color: #c9d9ee; }
.msg.ti .bubble-head { background: var(--brand-soft); }
.msg.internal .bubble { background: var(--note-bg); border-color: var(--note-border); }
.msg.internal .bubble-head { background: #fff1c4; border-color: var(--note-border); }
.msg.first .bubble { border-color: var(--border-strong); }
.tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; background: var(--brand); color: #fff; }
.tag.note { background: #e0b43c; color: #3d2c00; }
.sys { display: flex; gap: 10px; align-items: flex-start; padding-left: 12px; font-size: .86rem; color: var(--text-2); }
.sys .ico { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gray-bg); font-size: .72rem; margin-top: -2px; }
.sys .when { color: var(--text-3); margin-left: 6px; white-space: nowrap; }
.sys .note { margin-top: 4px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; white-space: pre-wrap; color: var(--text); }
.stars { color: #e0a100; letter-spacing: 2px; }

.composer textarea.input { border: 0; box-shadow: none; min-height: 110px; border-radius: var(--radius) var(--radius) 0 0; }
.composer textarea.input:focus { box-shadow: none; }
.composer-files { padding: 0 14px 10px; }
.composer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.composer.internal { background: var(--note-bg); border-color: var(--note-border); }
.composer.internal textarea.input { background: var(--note-bg); }
.composer-closed { padding: 18px 20px; color: var(--text-2); font-size: .92rem; text-align: center; }

.banner-resolve { border: 1.5px solid #9ed6b8; background: var(--green-bg); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.banner-resolve h2 { color: #0f5132; margin-bottom: 4px; }
.banner-resolve p { color: #24563c; font-size: .92rem; }
.rate { display: flex; gap: 4px; margin: 12px 0 10px; }
.rate button { background: none; border: 0; font-size: 1.7rem; line-height: 1; cursor: pointer; color: #c9ced6; padding: 0 2px; }
.rate button.on { color: #e0a100; }

.details { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 12px; padding: 16px 20px; font-size: .9rem; }
.details dt { color: var(--text-3); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.side-actions { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.side-actions .field > label { font-size: .8rem; color: var(--text-2); font-weight: 600; }

/* ---------- Modal ---------- */
dialog.modal {
  border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text);
}
dialog.modal::backdrop { background: rgba(15, 23, 35, .45); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 200px); overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
.x { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-3); padding: 4px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 12px 16px; border-radius: 9px; background: #17212e; color: #fff;
  font-size: .9rem; box-shadow: var(--shadow-lg); animation: tin .18s ease-out;
}
.toast.error { background: var(--red); }
.toast.ok { background: #136640; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

.pill-role { font-size: .76rem; font-weight: 650; padding: 3px 8px; border-radius: 6px; background: var(--gray-bg); color: var(--gray); white-space: nowrap; }
.pill-role.admin { background: var(--brand-soft); color: var(--brand); }
.pill-role.tecnico { background: var(--green-bg); color: var(--green); }
.inactive td { opacity: .55; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .t-layout, .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 24px; }
  .auth-side ul { display: none; }
  .choices { grid-template-columns: 1fr 1fr; }
  .user-btn .who { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 18px 16px 48px; }
  .topbar-inner { padding: 0 12px; gap: 10px; }
  .brand small { display: none; }
  .brand > span:last-child { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .titem { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .titem .num, .titem .meta, .titem .side { grid-column: 1; grid-row: auto; }
  .titem .side { flex-direction: row; align-items: center; }
  .details { grid-template-columns: 100px minmax(0, 1fr); }
  #toasts { left: 16px; right: 16px; }
  .toast { max-width: none; }
}

/* =====================================================================
   Versão 2 — chamados complexos, esteira, etapas e participantes
   ===================================================================== */
.page-wide { max-width: 1480px; }
.grow { flex: 1; min-width: 0; }
.avatar-sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar-xs { width: 20px; height: 20px; font-size: .6rem; }
.avatar-empty { background: var(--gray-bg); color: var(--text-3); }
.file-chip.uploading { opacity: .7; }
.tabs .spacer { flex: 1; }

/* Tipo do chamado */
.type-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: .72rem; font-weight: 650; background: var(--gray-bg); color: var(--gray); white-space: nowrap;
}
.ty-incidente { background: var(--red-bg); color: var(--red); }
.ty-solicitacao { background: var(--blue-bg); color: var(--blue); }
.ty-projeto { background: var(--violet-bg); color: var(--violet); }

/* Progresso de etapas */
.tprog { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tprog-bar { display: inline-block; width: 44px; height: 6px; border-radius: 3px; background: var(--gray-bg); overflow: hidden; }
.tprog-bar > span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.tprog-lg .tprog-bar { width: 120px; height: 8px; }

/* Formulário em seções */
.form-section { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.step-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .8rem; }
.choices-3 { grid-template-columns: repeat(3, 1fr); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 8px 14px; border: 1.5px solid var(--border-strong); border-radius: 999px; font-size: .88rem; font-weight: 550; background: var(--surface); }
.pill input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.pill input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.task-inputs { display: flex; flex-direction: column; gap: 6px; }
.task-inputs:empty { display: none; }
.task-input { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: .92rem; }
.task-n { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .75rem; }
.role-help { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.6; }

/* Linha do tempo do chamado (stepper) */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 20px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stepper li { position: relative; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: .88rem; font-weight: 600; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--border); margin: 0 12px; }
.stepper li.done:not(:last-child)::after { background: var(--green); }
.stepper .sdot { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); font-size: .8rem; }
.stepper li.done { color: var(--text-2); }
.stepper li.done .sdot { background: var(--green); border-color: var(--green); color: #fff; }
.stepper li.current { color: var(--brand); }
.stepper li.current .sdot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.stepper .slabel { white-space: nowrap; }
.stepper .slabel small { display: block; font-weight: 600; font-size: .74rem; color: var(--violet); }
.stepper-cancel { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius); background: var(--gray-bg); color: var(--gray); font-weight: 600; }

/* Etapas no detalhe */
.tasks { list-style: none; margin: 0; padding: 6px 0; }
.tasks li { display: flex; align-items: center; gap: 10px; padding: 8px 20px; border-bottom: 1px solid var(--border); }
.tasks li:last-child { border-bottom: 0; }
.tasks li .check { flex: 1; min-width: 0; align-items: flex-start; font-size: .93rem; }
.tasks li .check input { margin-top: 2px; flex: none; }
.tasks li.done .check span { color: var(--text-3); text-decoration: line-through; }
.task-add { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.task-add .input { flex: 1; }

/* Participantes */
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.people li { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.people small { display: block; color: var(--text-3); font-size: .78rem; }

/* Painel com 4 gráficos */
.dash-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Esteira (kanban) */
.board-filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: #eaeef3; border-radius: 12px; display: flex; flex-direction: column; min-height: 200px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 10px; font-weight: 700; font-size: .88rem; border-top: 4px solid var(--gray); border-radius: 12px 12px 0 0; }
.kcol-head .count { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--surface); font-size: .78rem; text-align: center; color: var(--text-2); }
.st-line-aberto { border-top-color: var(--blue); }
.st-line-em_andamento { border-top-color: #e09b23; }
.st-line-aguardando { border-top-color: var(--violet); }
.st-line-resolvido { border-top-color: var(--green); }
.st-line-fechado { border-top-color: var(--gray); }
.kcol-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 12px; min-height: 120px; max-height: calc(100vh - 260px); overflow-y: auto; border-radius: 0 0 12px 12px; transition: background .12s; }
.kcol-body.over { background: rgba(15, 76, 138, .1); outline: 2px dashed var(--brand-600); outline-offset: -4px; }
.kempty { padding: 18px 8px; text-align: center; color: var(--text-3); font-size: .84rem; }
.kcard {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--gray); border-radius: 9px; box-shadow: var(--shadow); cursor: pointer;
}
.kcard[draggable=true] { cursor: grab; }
.kcard:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 4px 12px rgba(16,24,40,.1); }
.kcard.dragging { opacity: .45; }
.pr-edge-baixa { border-left-color: var(--gray); }
.pr-edge-media { border-left-color: var(--blue); }
.pr-edge-alta { border-left-color: var(--orange); }
.pr-edge-urgente { border-left-color: var(--red); }
.kcard-top { display: flex; align-items: center; gap: 6px; }
.kcard-top .num { color: var(--text-3); font-weight: 650; font-size: .8rem; font-variant-numeric: tabular-nums; }
.kcard-top .spacer { flex: 1; }
.kcard-title { font-weight: 600; font-size: .92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard-meta { font-size: .8rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard-foot { display: flex; align-items: center; gap: 8px; font-size: .78rem; flex-wrap: wrap; }
.kcard-foot .spacer { flex: 1; }
.kdue { font-weight: 600; }

@media (max-width: 1100px) {
  .dash-grid-4 { grid-template-columns: 1fr 1fr; }
  .board-filters { grid-template-columns: 1fr 1fr; }
  .board-filters input { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .stepper { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
  .stepper li:nth-child(2)::after { display: none; }
}
@media (max-width: 640px) {
  .dash-grid-4, .choices-3 { grid-template-columns: 1fr; }
  .board-filters { grid-template-columns: 1fr; }
  .stepper .slabel { white-space: normal; font-size: .8rem; }
}
