:root {
  --bg: #0d0d0f; --card: #16161a; --card2: #1c1c22; --border: #26262e;
  --text: #ececf0; --muted: #8a8a96; --accent: #f97316; --accent-soft: rgba(249,115,22,.12);
  --ok: #22c55e; --bad: #ef4444; --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; min-height: 100vh; }
.glow { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 40% at 50% -5%, rgba(249,115,22,.16), transparent 70%); }
.wrap { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 28px 20px 60px; }

.brand { font-family: "Comic Sans MS", cursive; color: var(--accent); font-size: 30px; font-weight: 700; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.top__user { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 12px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 16px; }
.card__title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 16px; font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text); border-radius: 10px; padding: 11px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.btn--primary:hover { background: #fb8b3d; }
.btn--sm { padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { color: var(--muted); font-size: 13px; }
.field input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 13px; font-size: 15px; font-family: inherit; }
.field input:focus { outline: none; border-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.msg { font-size: 13px; margin-top: 8px; min-height: 18px; }
.msg.ok { color: var(--ok); } .msg.bad { color: var(--bad); }
.msg a { color: var(--accent); word-break: break-all; }

.hero { max-width: 440px; margin: 8vh auto 0; }
.hero__logo { height: 56px; width: auto; max-width: 70%; display: block; margin-bottom: 8px; }
.hero__sub { color: var(--muted); margin: 6px 0 22px; }
.muted { color: var(--muted); }

/* ---- app shell (drawer nav + content) ---- */
.app-shell { max-width: none; margin: 0; padding: 0; }
.sidebar { position: fixed; left: 0; top: 0; z-index: 70; height: 100%; width: 262px; max-width: 86vw;
  background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .26s ease; will-change: transform; overflow-y: auto; }
.sidebar.is-open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.5); }
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 18px; }
.sidebar__logo { height: 30px; width: auto; }
.sidebar__close { background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; }
.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav__item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; color: var(--text);
  background: none; border: 0; font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: left; }
.nav__item:hover { background: var(--card2); }
.nav__item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav__ic { width: 22px; text-align: center; flex: 0 0 auto; }
.sidebar__foot { padding: 14px; border-top: 1px solid var(--border); }
.account__row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.account__ic { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.account__email { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .btn { width: 100%; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); }
.sidebar-backdrop[hidden] { display: none; }

.content { min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); z-index: 20; }
.topbar__logo { height: 28px; width: auto; }
.topbar__title { font-size: 20px; font-weight: 700; }
.burger { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 42px; height: 42px; align-items: center;
  background: var(--card2); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; padding: 0; }
.burger:hover { border-color: var(--accent); }
.burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
.page { padding: 24px 20px 48px; max-width: 900px; margin: 0 auto; }

.ov { margin-top: 14px; }
.ov__stat { display: flex; align-items: baseline; gap: 10px; }
.ov__num { font-size: 34px; font-weight: 800; color: var(--accent); }
.ov__lbl { color: var(--muted); }

.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--border); }

/* ---- support tickets ---- */
.support-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tickets { display: flex; flex-direction: column; gap: 6px; }
.ticket-item { text-align: left; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; cursor: pointer; font: inherit; color: var(--text); }
.ticket-item:hover { border-color: var(--accent); }
.ticket-item__subj { font-weight: 600; font-size: 14px; }
.ticket-item__meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; padding: 4px 2px 12px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; word-wrap: break-word; }
.msg--op { align-self: flex-start; background: var(--card2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg--client { align-self: flex-end; background: var(--accent-soft); border: 1px solid rgba(249,115,22,.35); border-bottom-right-radius: 4px; }
.msg__time { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.chat-form { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.chat-form input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 9px 11px; font: inherit; }
.chat-form input:focus { outline: none; border-color: var(--accent); }
.field textarea { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 13px; font: inherit; }
.field textarea:focus { outline: none; border-color: var(--accent); }

.nodes { display: grid; gap: 12px; }
.node { display: flex; align-items: center; gap: 14px; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.node__ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: 0 0 auto; }
.node__body { flex: 1; min-width: 0; }
.node__name { font-weight: 600; }
.node__meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.empty { color: var(--muted); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot--ok { background: var(--ok); }
