:root {
  --brand: #13315C;
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --text: #0F1E36;
  --muted: #5B6779;
  --link: #1F4E99;
  --amber: #F5A524;
  --line: #E2E7EF;
  --ok: #0F7B4B;
  --info: #1F4E99;
  --warn: #B45309;
  --err: #B42318;
  --gray: #6B7280;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
h1, h2, h3 { font-family: 'Space Grotesk', Inter, system-ui, sans-serif; margin: 0; line-height: 1.2; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 48px; }
.top { background: var(--brand); color: #fff; padding: 18px 0 22px; margin-bottom: 18px; }
.top .wrap { padding-bottom: 0; display: flex; gap: 12px; align-items: center; }
.top h1 { font-size: 22px; }
.top p { margin: 2px 0 0; opacity: .85; font-size: 13px; }
.top .grow { flex: 1; min-width: 0; }
.back { background: rgba(255,255,255,.14); border: 0; color: #fff; border-radius: 10px; min-width: 44px; min-height: 44px; cursor: pointer; font-size: 18px; }
.chip { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; padding: 8px 12px; min-height: 44px; cursor: pointer; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; min-height: 110px; }
.tile:hover { border-color: var(--brand); }
.tile .n { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 700; }
.tile .t { font-weight: 600; }
.tile .s { color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid #C9D2DF; border-radius: 10px; padding: 11px 12px; background: #fff; min-height: 44px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(31,78,153,.35); outline-offset: 1px; }
.btn { border: 0; border-radius: 10px; padding: 11px 16px; min-height: 44px; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; }
.btn.sec { background: #fff; color: var(--brand); border: 1px solid #C9D2DF; }
.btn.amber { background: var(--amber); color: #1F1300; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.msg { border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.msg.err { background: #FDECEA; color: var(--err); }
.msg.ok { background: #E7F6EE; color: var(--ok); }
.msg.info { background: #EAF1FB; color: var(--info); }
.muted { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.b-aberto { background: #FEF3E2; color: var(--warn); }
.b-em_atendimento { background: #EAF1FB; color: var(--info); }
.b-aguardando_cliente { background: #F1ECFB; color: #5B3BA8; }
.b-resolvido { background: #E7F6EE; color: var(--ok); }
.b-fechado { background: #EEF0F3; color: var(--gray); }
.b-cancelado { background: #FDECEA; color: var(--err); }
.b-urgente { background: #FDECEA; color: var(--err); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; flex-direction: column; gap: 4px; cursor: pointer; text-align: left; }
.item .top-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proto { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--brand); }
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { border-radius: 12px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; white-space: pre-wrap; word-break: break-word; }
.bubble.me { background: #EAF1FB; border-color: #CFE0F7; }
.bubble.sys { background: #F6F7F9; color: var(--muted); font-size: 13px; }
.bubble .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { border: 1px dashed #C9D2DF; border-radius: 10px; padding: 8px 10px; background: #fff; cursor: pointer; min-height: 44px; }
.auth { max-width: 420px; margin: 40px auto; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.terms { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #FAFBFC; font-size: 13px; white-space: pre-wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; min-height: 22px; height: 22px; margin-top: 2px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { border: 1px solid #C9D2DF; background: #fff; border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.foot { margin-top: 28px; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 560px) {
  .top h1 { font-size: 19px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { min-height: 100px; }
}
