:root {
  --navy: #15233f;
  --navy-2: #1e3157;
  --accent: #a8834b;
  --accent-soft: #f4ede2;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #667085;
  --line: #e4e7ec;
  --ok: #1f7a4d;
  --ok-bg: #e7f5ee;
  --warn: #9a6200;
  --warn-bg: #fff4dc;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --info: #1d4ed8;
  --info-bg: #e8efff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
a { color: var(--navy-2); }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; color: var(--navy); margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
small, .muted { color: var(--muted); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--navy); color: #cfd6e4;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: block; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { display: block; width: 100%; max-width: 200px; height: auto; }
.topbar-logo img { display: block; height: 30px; width: auto; }
.login-logo { display: block; width: 100%; max-width: 360px; height: auto; }
.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav .sec { font-size: .7rem; text-transform: uppercase; letter-spacing: 1.2px; color: #7d89a3; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #d6dcea; text-decoration: none; font-size: .93rem;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.ativo { background: rgba(168,131,75,.18); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.nav .pill { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 7px; }
.sidebar .user { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.sidebar .user b { color: #fff; display: block; }
.sidebar .user a { color: #aab4c8; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: none; background: var(--navy); color: #fff; padding: 12px 16px;
  align-items: center; justify-content: space-between;
}
.topbar button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 1rem; }
.content { padding: 28px 32px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }

/* ---------- cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; border-top: 3px solid var(--line);
}
a.stat:hover { border-color: var(--accent); }
.stat .n { font-size: 1.9rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .86rem; }
.stat.danger { border-top-color: var(--danger); } .stat.danger .n { color: var(--danger); }
.stat.warn { border-top-color: #e0a100; } .stat.warn .n { color: var(--warn); }
.stat.ok { border-top-color: var(--ok); }
.stat.accent { border-top-color: var(--accent); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafbfd; }
tbody td:first-child { min-width: 240px; }
td .t { font-weight: 600; color: var(--navy); text-decoration: none; }
td .t:hover { text-decoration: underline; }
.proto { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st-recebida { background: var(--info-bg); color: var(--info); }
.st-em_analise { background: var(--accent-soft); color: #7a5a26; }
.st-aguardando_cliente { background: var(--warn-bg); color: var(--warn); }
.st-concluida { background: var(--ok-bg); color: var(--ok); }
.st-cancelada { background: #f0f1f3; color: #667085; }
.u-baixa { background: #f0f1f3; color: #475467; }
.u-normal { background: var(--info-bg); color: var(--info); }
.u-alta { background: var(--warn-bg); color: var(--warn); }
.u-urgente { background: var(--danger-bg); color: var(--danger); }
.pz { font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pz-ok { color: var(--ok); } .pz-alerta { color: var(--warn); } .pz-hoje { color: #c2410c; }
.pz-atrasado { color: var(--danger); } .pz-neutro { color: var(--muted); }
.area { font-size: .78rem; color: var(--navy-2); background: #eef1f6; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .86rem; margin: 0 0 5px; color: #344054; }
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,131,75,.18); }
input[type=file] { font-size: .88rem; width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--navy-2); }
.btn.acc { background: var(--accent); border-color: var(--accent); }
.btn.acc:hover { background: #94723f; }
.btn.sec { background: #fff; color: var(--navy); border-color: #d0d5dd; }
.btn.sec:hover { background: #f8f9fb; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f1b8b2; }
.btn.sm { padding: 5px 10px; font-size: .8rem; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filters .field { margin: 0; }
.filters label { font-size: .76rem; }
.filters input, .filters select { padding: 8px 10px; font-size: .88rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chips a { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); font-size: .85rem; }
.chips a.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- radio cards (urgência) ---------- */
.radio-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.radio-cards label { border: 1px solid #d0d5dd; border-radius: 8px; padding: 10px; cursor: pointer; font-weight: 600; margin: 0; text-align: center; }
.radio-cards label small { display: block; font-weight: 400; }
.radio-cards input { display: none; }
.radio-cards input:checked + label { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(168,131,75,.25); }

/* ---------- flash ---------- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; font-size: .92rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #b7e1c9; }
.flash.erro { background: var(--danger-bg); color: var(--danger); border-color: #f5c2bc; }
.flash.aviso { background: var(--warn-bg); color: var(--warn); border-color: #f3d48d; }

/* ---------- solicitação ---------- */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 14px 0 4px; }
.meta div span { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.descricao { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-width: 88%; }
.msg.cliente { align-self: flex-start; background: #fff; }
.msg.equipe { align-self: flex-end; background: #f3f6fb; border-color: #dbe3f0; }
.msg.interna { align-self: stretch; max-width: 100%; background: #fff9ec; border: 1px dashed #e7c77b; }
.msg .h { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.msg .h b { color: var(--navy); }
.msg .txt { white-space: pre-wrap; }
.files { list-style: none; padding: 0; margin: 8px 0 0; }
.files li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.files li:last-child { border-bottom: 0; }
.files a { text-decoration: none; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; font-size: .86rem; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.int::before { background: #e0a100; }
.timeline small { display: block; }
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars input { display: none; }
.stars label { font-size: 1.8rem; color: #d0d5dd; cursor: pointer; margin: 0; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--accent); }
.progress { display: flex; gap: 4px; margin: 14px 0 4px; }
.progress div { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); }
.progress div::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 5px; }
.progress div.feito::before { background: var(--accent); }
.progress div.atual { color: var(--navy); font-weight: 700; }

/* ---------- barras ---------- */
.bar-row { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .86rem; }
.bar { height: 10px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: linear-gradient(160deg, var(--navy) 0%, #0d172c 100%); color: #cfd6e4; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-art ul { list-style: none; padding: 0; margin: 28px 0 0; }
.login-art li { padding: 8px 0 8px 26px; position: relative; }
.login-art li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-form form { width: 100%; max-width: 380px; }
.login-form .btn { width: 100%; justify-content: center; padding: 12px; }
.lgpd { font-size: .76rem; color: var(--muted); margin-top: 22px; }
.copybox { font-family: ui-monospace, Menlo, monospace; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 14px; white-space: pre-wrap; font-size: .85rem; }
.senha-grande { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: 2px; color: var(--navy); background: var(--accent-soft); padding: 10px 16px; border-radius: 8px; display: inline-block; }

/* ---------- responsivo ---------- */
@media (max-width: 1000px) {
  .g-side, .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; }
  .login-art ul { display: none; }
}
@media (max-width: 800px) {
  .app { display: block; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; }
  .sidebar { display: none; position: fixed; inset: 52px 0 0 0; width: 100%; height: auto; z-index: 30; }
  .sidebar.aberto { display: flex; }
  .sidebar .brand { display: none; }
  .content { padding: 18px 16px 50px; }
  .radio-cards { grid-template-columns: repeat(2, 1fr); }
  .msg { max-width: 100%; }
  .bar-row { grid-template-columns: 110px 1fr 32px; }
  .hide-sm { display: none; }
}
