/* DuesNexa admin dashboard */
:root { --navy: #0a1630; --navy-2: #102244; --teal: #14b8a6; --teal-d: #0d9488; --ink: #0b1f45; --text: #1c2b48; --muted: #5b6b85; --line: #e1e7f0; --bg: #f4f7fb; --ok: #0f9d6b; --err: #c43c3c; --warn: #b7791f; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--teal-d); }
h1, h2, h3 { font-family: "Sora", "Segoe UI", sans-serif; color: var(--ink); margin: 0 0 .6em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d4e8; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; font-family: "Sora", sans-serif; font-weight: 700; padding: 4px 8px 18px; }
.side .brand img { width: 30px; height: 30px; border-radius: 7px; }
.side nav a { display: flex; justify-content: space-between; color: #c9d4e8; text-decoration: none; padding: 9px 10px; border-radius: 8px; margin-bottom: 2px; }
.side nav a:hover, .side nav a.active { background: rgba(255, 255, 255, .08); color: #fff; }
.side .who { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 16px; padding: 14px 10px 0; font-size: .85rem; }
.side .who button { margin-top: 8px; }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: rgba(20, 184, 166, .18); color: #5eead4; text-align: center; }
main { padding: 24px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-family: "Sora", sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat .s { color: var(--muted); font-size: .78rem; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfd; }
tr:hover td { background: #fafcff; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.muted { color: var(--muted); }
.trunc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--teal); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #04221f; }
.btn-primary:hover { background: #2dd4bf; }
.btn-danger { color: var(--err); border-color: #f0c8c8; }
.btn-ghost { background: transparent; color: #c9d4e8; border-color: rgba(255, 255, 255, .2); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
form.inline { display: inline; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #cdd6e3; border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, .18); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; color: var(--ink); }
.field { margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 3px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: #e8f8f1; color: #0b5e40; border-color: #b6e8d2; }
.flash-error { background: #fdecec; color: #8a2020; border-color: #f3c2c2; }
.flash-warn { background: #fff7e6; color: #7a4b00; border-color: #f2c46b; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #eef2f7; color: #43536e; white-space: nowrap; }
.tag.bot { background: #e7f6f4; color: #0b6b62; }
.tag.pending_human { background: #fff1d6; color: #7a4b00; }
.tag.human { background: #e3efff; color: #1f4f9a; }
.tag.resolved { background: #eef2f7; color: #5b6b85; }
.tag.demo { background: #fff3cd; color: #7a4b00; }
.tag.failed, .tag.err { background: #fdecec; color: #8a2020; }
.tag.sent, .tag.delivered, .tag.read, .tag.ok { background: #e8f8f1; color: #0b5e40; }
.tag.queued { background: #eef2f7; color: #43536e; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #9aa7bd; }
.dot.connected { background: var(--ok); } .dot.error { background: var(--err); } .dot.disconnected { background: #9aa7bd; }
.thread { max-height: 62vh; overflow-y: auto; padding: 8px 4px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 12px; margin: 8px 0; word-wrap: break-word; }
.msg .txt { white-space: pre-wrap; }
.msg.in { background: #fff; border: 1px solid var(--line); }
.msg.out { margin-left: auto; background: #e7f6f4; border: 1px solid #c4ebe5; }
.msg.out.agent { background: #e3efff; border-color: #c9ddfa; }
.msg .meta { display: block; font-size: .72rem; color: var(--muted); margin-top: 4px; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff7e6; border: 1px solid #f2c46b; color: #7a4b00; margin-bottom: 14px; }
.notice.info { background: #effaf8; border-color: #bfe6e1; color: #0b4b45; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.bars div { flex: 1; background: var(--teal); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--muted); }
.bars-x { display: flex; gap: 6px; font-size: .66rem; color: var(--muted); }
.bars-x span { flex: 1; text-align: center; }
code, .mono { font-family: "IBM Plex Mono", Menlo, monospace; font-size: .85rem; background: #f1f4f9; padding: 1px 5px; border-radius: 4px; word-break: break-all; }
ol.steps li { margin-bottom: 8px; }
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(800px 400px at 80% 0, rgba(61, 169, 255, .2), transparent 60%), var(--navy); padding: 16px; }
.login .card { width: 100%; max-width: 400px; padding: 28px; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { display: none; }
  .side.open nav { display: block; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .side .head { display: flex; align-items: center; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .msg { max-width: 92%; }
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
