:root {
  --bg: #0b1220;
  --panel: #111827;
  --line: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --green: #22c55e;
  --bad: #fca5a5;
  --ok: #86efac;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--green); }
button, input, select, textarea { font: inherit; }
.hidden { display: none; }
.shell { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
header { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #0d1526; }
header strong { margin-inline-end: auto; }
#menu { display: none; }
aside { border-left: 1px solid var(--line); background: #0d1526; padding: 12px; }
.nav-link { display: block; color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.nav-link.active, .nav-link:hover { background: #1f2937; }
.short { display: none; }
main, #auth-root { padding: 20px; }
h1 { margin: 0 0 16px; font-size: 28px; }
h2 { margin: 0 0 8px; font-size: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi strong { display: block; margin-top: 8px; font-size: 22px; }
.narrow { max-width: 460px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; background: #0b1220; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
textarea { min-height: 90px; }
.primary { background: var(--green); color: #052e16; border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.link { display: inline-block; text-decoration: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.row > * { flex: 1 1 140px; }
.muted { color: var(--muted); }
.warn { color: #fde68a; }
.banner { padding: 10px 12px; border-radius: 8px; }
.banner.ok { background: #052e16; color: var(--ok); }
.banner.bad { background: #450a0a; color: var(--bad); }
.form-error, .field-error { color: var(--bad); min-height: 1.2em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: right; vertical-align: top; }
.empty { padding: 28px; text-align: center; }
.steps { list-style: none; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.step { padding: 8px 10px; border-radius: 999px; background: #1f2937; }
.step.completed { color: var(--ok); }
.step.current { outline: 1px solid var(--green); }
.step.blocked { color: var(--muted); }
.check-list { padding-inline-start: 18px; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: min(70%, 520px); padding: 10px 12px; border-radius: 14px; line-height: 1.7; }
.bubble header { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.bubble.customer { margin-inline-end: auto; background: #1e3a2f; }
.bubble.agent { margin-inline-start: auto; background: #1f2937; }
.bar { height: 10px; background: #1f2937; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green); }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
code, pre { background: #0b1220; border-radius: 8px; padding: 8px; white-space: pre-wrap; word-break: break-all; }
.totals { list-style: none; padding: 0; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 88px 1fr; }
  .full { display: none; }
  .short { display: inline; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  #menu { display: inline-block; }
  aside { position: fixed; inset: 0 0 0 auto; width: min(280px, 86vw); transform: translateX(110%); z-index: 5; }
  aside.open { transform: none; }
  .full { display: inline; }
  .short { display: none; }
  .bubble { max-width: 90%; }
}
