@font-face { font-family: "Libre Franklin"; src: url("/fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/libre-franklin-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/libre-franklin-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/libre-franklin-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Parkinsans; src: url("/fonts/parkinsans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Parkinsans; src: url("/fonts/parkinsans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f4f7f8; --panel: #ffffff; --ink: #12262e; --muted: #4d626b; --line: #dbe4e7; --line-strong: #b9c8ce;
  --nav: #17373f; --nav-on: #2a5560; --nav-ink: #dcebf0; --brand: #17373f; --brand-soft: #e2f3f9;
  --warn: #9a3f07; --warn-soft: #fdebdc; --badge: #45b0d3; --badge-ink: #0d2a32;
  --ok: #0f6480; --ok-soft: #dcf0f7; --idle-soft: #e8edef; --idle: #4b5e66;
  --demo-bg: #fff4cf; --demo: #5e4600;
  --display: Parkinsans, "Libre Franklin", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Libre Franklin", "Segoe UI", system-ui, sans-serif; }
h1, h2, h3, p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font: inherit; }
h1 { font: 700 28px/1.2 var(--display); }
.sub { color: var(--muted); }
.from, .fine, .when { color: var(--muted); font-size: 14px; }
:focus-visible { outline: 3px solid #e36414; outline-offset: 2px; }

.btn { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.big { min-height: 52px; padding: 0 24px; }
.btn.wide { width: 100%; }
.btn:hover { filter: brightness(1.08); }
.link-btn { min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.shell { display: flex; min-height: 100vh; }
.side { flex: none; width: 232px; padding: 22px 14px; background: var(--nav); color: #fff; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.side-brand .mark { width: 34px; height: 34px; flex: none; }
.side-brand .word { width: 136px; height: auto; display: block; }
.login-logo { display: grid; justify-items: center; gap: 16px; margin-bottom: 6px; }
.login-logo .mark { width: 84px; height: 84px; }
.login-logo .word { width: 216px; height: auto; }
.tab-btn { min-height: 46px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--nav-ink); cursor: pointer; }
.tab-btn.on { background: var(--nav-on); color: #fff; font-weight: 600; }
.badge { min-width: 24px; padding: 0 8px; border-radius: 12px; background: var(--badge); color: var(--badge-ink); font-size: 13px; font-weight: 700; text-align: center; }
.side-foot { margin-top: auto; padding: 0 12px; color: var(--nav-ink); font-size: 14px; display: grid; gap: 2px; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.phone-top { display: none; }
.demo { padding: 8px 24px; background: var(--demo-bg); color: var(--demo); font-size: 14px; }
.tab { flex: 1; min-height: 0; }

.needs { display: flex; }
.queue-pane { flex: none; width: 400px; padding: 26px 20px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.queue { display: grid; gap: 8px; margin-top: 8px; }
.row-btn { width: 100%; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); cursor: pointer; display: grid; gap: 4px; }
.row-btn.on { border-color: var(--brand); background: var(--brand-soft); }
.row-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.row-title { font-weight: 600; }
.row-tag { font-size: 13px; font-weight: 600; color: var(--ok); }
.row-tag.urgent { color: var(--warn); }

.detail { flex: 1; min-width: 0; padding: 34px 44px; display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.detail h2 { font: 700 36px/1.15 var(--display); }
.detail h2.done { font-size: 52px; }
.lead { font-size: 18px; line-height: 1.5; }
.detail-bar { display: none; justify-content: space-between; align-items: center; color: var(--muted); }
.progress { font-weight: 600; }
.box { padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.box h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.steps { list-style: decimal; padding-left: 20px; display: grid; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.needs.focus .queue-pane { display: none; }
.needs.focus .detail { margin: 0 auto; width: 100%; }
.needs.focus .detail-bar { display: flex; }

.agents { display: flex; gap: 20px; padding: 26px 24px; align-items: flex-start; }
.agents-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.room { width: 100%; height: 100%; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); cursor: pointer; display: grid; gap: 4px; align-content: start; }
.room.on { border-color: var(--brand); background: var(--brand-soft); }
.room-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.mono { width: 52px; height: 52px; margin: 10px 0 8px; border-radius: 50%; display: grid; place-items: center; background: var(--nav); color: #fff; font-weight: 700; }
.room-name { font-weight: 600; font-size: 17px; }
.room-task { color: var(--muted); font-size: 14px; }
.pill { flex: none; padding: 1px 9px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.pill.working { background: var(--ok-soft); color: var(--ok); }
.pill.waiting { background: var(--warn-soft); color: var(--warn); }
.pill.idle, .pill.offline { background: var(--idle-soft); color: var(--idle); }
.agent-panel { flex: none; width: 320px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 10px; position: sticky; top: 20px; }
.agent-panel h2 { font: 700 22px var(--display); }
.agent-panel h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.log { display: grid; gap: 6px; margin-bottom: 8px; }

.messages { padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; max-width: 860px; width: 100%; }
.thread { flex: 1; display: grid; gap: 10px; align-content: start; min-height: 200px; max-height: calc(100vh - 340px); overflow-y: auto; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg.self { justify-self: end; background: var(--brand-soft); border-color: #bcdbe1; }
.file { font-size: 14px; font-weight: 600; }
.composer { display: grid; gap: 8px; }
.drop { padding: 12px; border: 2px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; cursor: pointer; }
.drop.over { border-color: var(--brand); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 14px; background: var(--idle-soft); font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.chip-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
.row { display: flex; gap: 8px; align-items: stretch; }
textarea { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); color: inherit; font: inherit; resize: vertical; }

.activity { padding: 26px 24px; max-width: 760px; width: 100%; display: grid; gap: 6px; align-content: start; }
.feed { margin-top: 12px; }
.feed li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: var(--nav); color: #fff; font-weight: 600; z-index: 10; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.login-card form { width: 100%; }
.login-card h1 { font-size: 24px; }
.fine { color: var(--muted); font-size: 13px; }

@media (max-width: 1080px) {
  .agents { flex-direction: column; }
  .agent-panel { width: 100%; position: static; }
  .queue-pane { width: 320px; }
  .detail { padding: 28px; }
}
@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 68px; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: auto; padding: 0; flex-direction: row; gap: 0; z-index: 5; }
  .side > .side-brand, .side-foot { display: none; }
  .tab-btn { flex: 1 1 auto; min-width: 0; min-height: 64px; justify-content: center; gap: 4px; padding: 0 4px; border-radius: 0; font-size: 13px; white-space: nowrap; }
  .badge { min-width: 20px; padding: 0 5px; }
  .phone-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; background: var(--nav); color: #fff; }
  .phone-top .side-brand { padding: 0; }
  .phone-top .mark { width: 30px; height: 30px; }
  .phone-top .word { width: 118px; }
  .demo { padding: 8px 16px; }
  .needs { display: block; }
  .queue-pane { width: 100%; padding: 20px 16px; border-right: 0; background: transparent; }
  .detail { display: none; padding: 16px; max-width: none; }
  .detail h2 { font-size: 28px; }
  .detail h2.done { font-size: 44px; }
  .detail-bar { display: flex; }
  .needs:not(.open) .detail:has(.done) { display: flex; }
  .needs.open .queue-pane { display: none; }
  .needs.open .detail { display: flex; }
  .actions .btn { flex: 1 1 100%; }
  .agents, .messages, .activity { padding: 20px 16px; }
  .rooms { grid-template-columns: minmax(0, 1fr); }
  .thread { max-height: calc(100vh - 420px); }
  .msg { max-width: 92%; }
  .feed li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .toast { bottom: 80px; }
}
