/* Snowshare — Support Center · Dark premium streaming UI */

:root {
  /* Surfaces */
  --bg-0: #0a0a0d;
  --bg-1: #101015;
  --bg-2: #16161c;
  --bg-3: #1d1d25;
  --bg-4: #26262f;
  --elev: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px -12px rgba(0,0,0,.7);

  /* Borders */
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.12);
  --line-3: rgba(255,255,255,.20);

  /* Text */
  --tx-hi: #f4f4f7;
  --tx: #c8c8d2;
  --tx-mid: #9a9aa6;
  --tx-lo: #6c6c78;

  /* Brand */
  --red: #ff3b46;
  --red-2: #e21d2b;
  --red-soft: rgba(255,59,70,.14);
  --red-line: rgba(255,59,70,.35);

  /* States */
  --blue: #5b9dff;
  --amber: #ffb020;
  --pink: #ff5c7a;
  --green: #2ed47a;
  --gray: #8a8a98;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --font: "Manrope", -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-0);
  color: var(--tx);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--red-soft); }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #2a2a33; border-radius: 99px; border: 2px solid var(--bg-0); }
*::-webkit-scrollbar-thumb:hover { background: #3a3a45; }

/* ── App shell ─────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  min-height: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 18px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(150deg, #ff5560, var(--red-2));
  display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px rgba(255,59,70,.7);
  flex-shrink: 0;
}
.brand-name { font-weight: 800; font-size: 17px; color: var(--tx-hi); letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--tx-lo); font-weight: 600; letter-spacing: .02em; margin-top: -2px; }

.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--tx-lo);
  padding: 14px 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--tx-mid); font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: .14s; position: relative;
  user-select: none;
}
.nav-item:hover { background: var(--bg-2); color: var(--tx); }
.nav-item.active { background: var(--bg-3); color: var(--tx-hi); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--red);
}
.nav-item .nav-ico { color: inherit; opacity: .85; flex-shrink: 0; }
.nav-item.active .nav-ico { color: var(--red); opacity: 1; }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--red); color: #fff; border-radius: 99px;
  min-width: 19px; height: 19px; padding: 0 6px;
  display: grid; place-items: center;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.16); }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 12px; cursor: pointer; transition: .14s;
}
.user-chip:hover { background: var(--bg-2); }
.user-chip .uc-name { font-weight: 700; font-size: 13px; color: var(--tx-hi); line-height: 1.2; }
.user-chip .uc-meta { font-size: 11px; color: var(--tx-lo); }

/* ── Main ─────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  height: 62px; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: rgba(16,16,21,.7);
  backdrop-filter: blur(12px);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx-lo); font-weight: 600; }
.crumb b { color: var(--tx-hi); font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 30px 36px 64px;
}
.content-inner { max-width: 1180px; margin: 0 auto; }

/* glow header backdrop */
.glow-top { position: relative; }
.glow-top::before {
  content: ""; position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 680px; height: 280px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,59,70,.16), transparent 70%);
  filter: blur(8px); z-index: 0;
}

/* ── Type ─────────────────────────────────────────────── */
.eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); display: inline-flex; align-items: center; gap: 7px;
}
h1.page { font-size: 30px; font-weight: 800; color: var(--tx-hi); letter-spacing: -.025em; margin: 8px 0 0; line-height: 1.1; }
.page-sub { color: var(--tx-mid); font-size: 14.5px; margin-top: 8px; max-width: 560px; }
.sec-title { font-size: 13px; font-weight: 700; color: var(--tx-hi); letter-spacing: -.01em; }
.muted { color: var(--tx-mid); }
.dim { color: var(--tx-lo); }
.mono { font-family: var(--mono); font-variant-ligatures: none; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 11px;
  font-family: var(--font); font-weight: 700; font-size: 13.5px;
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--tx-hi);
  cursor: pointer; transition: .14s; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--bg-4); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(160deg, #ff4d57, var(--red-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px -8px rgba(255,59,70,.65);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(160deg, #ff4d57, var(--red-2)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--tx-mid); }
.btn-ghost:hover { background: var(--bg-2); color: var(--tx-hi); }
.btn-sm { height: 33px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer; transition: .14s;
  background: transparent; border: 1px solid transparent; color: var(--tx-mid); position: relative;
}
.icon-btn:hover { background: var(--bg-3); color: var(--tx-hi); }
.dot-badge::after {
  content: ""; position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 99px; background: var(--red);
  border: 2px solid var(--bg-1);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--elev);
}
.card-pad { padding: 22px; }

.stat {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; position: relative; overflow: hidden;
}
.stat .stat-label { font-size: 11.5px; font-weight: 700; color: var(--tx-mid); letter-spacing: .01em; }
.stat .stat-value { font-size: 27px; font-weight: 800; color: var(--tx-hi); letter-spacing: -.03em; margin-top: 6px; line-height: 1; }
.stat .stat-foot { font-size: 11.5px; color: var(--tx-lo); margin-top: 7px; font-weight: 600; display: flex; align-items: center; gap: 5px; }

/* ── Pills / tags ─────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: -.01em;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 7px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 700; color: var(--tx);
}
.tag-red { background: var(--red-soft); border-color: var(--red-line); color: #ff8088; }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.prio .ptri { font-size: 9px; }

/* ── Avatar ─────────────────────────────────────────────── */
.avatar {
  border-radius: 99px; display: grid; place-items: center;
  font-weight: 800; color: #fff; flex-shrink: 0; letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

/* ── Inputs ─────────────────────────────────────────────── */
.input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 11px;
  color: var(--tx-hi); font-family: var(--font); font-size: 14px; font-weight: 500;
  transition: .14s; outline: none;
}
.input::placeholder { color: var(--tx-lo); font-weight: 500; }
.input:focus { border-color: var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); background: var(--bg-2); }
textarea.input { height: auto; padding: 13px 14px; resize: vertical; line-height: 1.6; min-height: 120px; }

.field-label { font-size: 12px; font-weight: 700; color: var(--tx); margin-bottom: 7px; display: block; }
.field-hint { font-size: 11.5px; color: var(--tx-lo); margin-top: 6px; }

.search {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px; flex: 1; min-width: 200px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 11px;
  transition: .14s;
}
.search:focus-within { border-color: var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); }
.search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--tx-hi); font-family: var(--font); font-size: 14px; font-weight: 500;
}
.search input::placeholder { color: var(--tx-lo); }

/* segmented */
.segmented { display: inline-flex; background: var(--bg-1); border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 2px; }
.seg {
  height: 32px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--tx-mid); display: inline-flex; align-items: center; gap: 7px;
  transition: .14s; white-space: nowrap; border: none; background: none; font-family: var(--font);
}
.seg:hover { color: var(--tx-hi); }
.seg.on { background: var(--bg-3); color: var(--tx-hi); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.seg .seg-count { font-size: 11px; opacity: .7; }
.seg.on .seg-count { opacity: 1; }

/* ── Ticket rows ─────────────────────────────────────────────── */
.t-list { display: flex; flex-direction: column; gap: 10px; }
.t-row {
  display: grid;
  grid-template-columns: 4px 1fr 150px 96px 132px 96px 22px;
  align-items: center; gap: 16px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px 16px 0; cursor: pointer;
  transition: .15s; position: relative; overflow: hidden;
}
.t-row:hover { border-color: var(--line-3); background: var(--bg-3); transform: translateY(-1px); }
.t-row .t-bar { align-self: stretch; border-radius: 2px 0 0 2px; }
.t-row .t-main { min-width: 0; }
.t-row .t-subj { font-size: 15px; font-weight: 700; color: var(--tx-hi); letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; overflow: hidden; }
.t-row .t-id { font-size: 11px; font-weight: 700; font-family: var(--mono); color: var(--tx-mid); background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; flex-shrink: 0; }
.t-row .t-subj-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.t-row .t-meta { font-size: 12px; color: var(--tx-lo); margin-top: 4px; overflow: hidden; white-space: nowrap; }
.t-row .t-preview { overflow: hidden; text-overflow: ellipsis; }
.t-row .t-meta .sep { width: 3px; height: 3px; border-radius: 99px; background: var(--tx-lo); opacity: .5; }
.unread-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--red); flex-shrink: 0; box-shadow: 0 0 0 4px var(--red-soft); }
.col-hide { color: var(--tx-mid); font-size: 12.5px; font-weight: 600; }

.t-head {
  display: grid; grid-template-columns: 4px 1fr 150px 96px 132px 96px 22px;
  gap: 16px; padding: 0 18px 0 0; margin-bottom: 2px;
}
.t-head > div { padding-left: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-lo); }
.t-head .th-main { padding-left: 22px; }

/* ── Messages ─────────────────────────────────────────────── */
.thread { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 13px; max-width: 86%; }
.msg.customer { flex-direction: row-reverse; margin-left: auto; }
.msg-body { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 7px; }
.msg.customer .msg-head { flex-direction: row-reverse; }
.msg-name { font-size: 13px; font-weight: 700; color: var(--tx-hi); }
.msg-time { font-size: 11.5px; color: var(--tx-lo); font-weight: 500; }
.bubble {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 16px; border-top-left-radius: 5px;
  padding: 14px 16px; font-size: 14px; line-height: 1.62; color: var(--tx);
}
.msg.customer .bubble {
  background: linear-gradient(165deg, rgba(255,59,70,.16), rgba(255,59,70,.08));
  border-color: var(--red-line); border-top-left-radius: 16px; border-top-right-radius: 5px;
  color: var(--tx-hi);
}
.bubble b { color: var(--tx-hi); font-weight: 700; }
.bubble ul { margin: 8px 0 0; padding-left: 20px; }
.bubble li { margin: 4px 0; }
.bubble code, .bubble .kbd {
  font-family: var(--mono); font-size: 12.5px; background: var(--bg-4);
  padding: 1px 6px; border-radius: 5px; color: #ffd2a8;
}

.sys-line {
  display: flex; align-items: center; gap: 12px; align-self: center;
  font-size: 11.5px; color: var(--tx-lo); font-weight: 600; padding: 2px 0;
}
.sys-line .sys-rule { height: 1px; width: 36px; background: var(--line-2); }

.attach {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--tx);
}
.attach .att-ico { width: 30px; height: 30px; border-radius: 7px; background: var(--bg-4); display: grid; place-items: center; color: var(--tx-mid); flex-shrink: 0; }
.attach .att-size { color: var(--tx-lo); font-size: 11px; font-weight: 500; }

.typing { display: flex; gap: 4px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 99px; background: var(--tx-lo); animation: blink 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: .2s; } .typing i:nth-child(3){ animation-delay: .4s; }
@keyframes blink { 0%,60%,100%{ opacity:.25 } 30%{ opacity:1 } }

/* composer */
.composer { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; transition: .15s; }
.composer:focus-within { border-color: var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); }
.composer-bar { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.composer textarea { width: 100%; border: none; background: none; outline: none; resize: none; color: var(--tx-hi); font-family: var(--font); font-size: 14px; line-height: 1.6; padding: 14px 16px; min-height: 84px; }
.composer textarea::placeholder { color: var(--tx-lo); }
.composer-foot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.mini-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--tx-mid); cursor: pointer; transition: .14s; }
.mini-ico:hover { background: var(--bg-3); color: var(--tx-hi); }

/* ── Category / line pickers ─────────────────────────────────────────────── */
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 13px 14px; cursor: pointer; transition: .14s; text-align: left;
}
.pick:hover { border-color: var(--line-3); background: var(--bg-2); }
.pick.on { border-color: var(--red); background: var(--red-soft); }
.pick .pick-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg-3); display: grid; place-items: center; color: var(--tx-mid); transition: .14s;
}
.pick.on .pick-ico { background: var(--red); color: #fff; }
.pick .pick-title { font-size: 13.5px; font-weight: 700; color: var(--tx-hi); }
.pick .pick-desc { font-size: 11.5px; color: var(--tx-lo); margin-top: 2px; }
.pick .pick-check { margin-left: auto; color: var(--red); opacity: 0; transition: .14s; }
.pick.on .pick-check { opacity: 1; }

.line-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.line-pick {
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 13px; cursor: pointer; transition: .14s;
}
.line-pick:hover { border-color: var(--line-3); }
.line-pick.on { border-color: var(--red); background: var(--red-soft); }

/* dropzone */
.dropzone {
  border: 1.5px dashed var(--line-3); border-radius: 14px; background: var(--bg-1);
  padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; transition: .14s; cursor: pointer;
}
.dropzone:hover { border-color: var(--red-line); background: var(--bg-2); }
.dropzone .dz-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--bg-3); display: grid; place-items: center; color: var(--tx-mid); }

/* steps */
.steps { display: flex; align-items: center; gap: 12px; }
.step { display: flex; align-items: center; gap: 9px; }
.step-num { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 1px solid var(--line-2); color: var(--tx-mid); }
.step.on .step-num { background: var(--red-soft); border-color: var(--red); color: #ff8088; }
.step.done .step-num { background: var(--red); border-color: var(--red); color: #fff; }
.step-label { font-size: 12.5px; font-weight: 700; color: var(--tx-mid); }
.step.on .step-label, .step.done .step-label { color: var(--tx-hi); }
.step-rule { flex: 1; height: 1px; background: var(--line-2); min-width: 18px; }

/* divider */
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 12.5px; }
.kv .k { color: var(--tx-lo); font-weight: 600; }
.kv .v { color: var(--tx-hi); font-weight: 700; }

/* checkbox */
.chk { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-3); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: .14s; color: transparent; background: var(--bg-1); }
.chk.on { background: var(--red); border-color: var(--red); color: #fff; }

/* suggestion link */
.sg-link {
  display: flex; align-items: center; gap: 9px; padding: 9px 0;
  font-size: 13px; font-weight: 600; color: var(--tx); cursor: pointer;
  border-bottom: 1px solid var(--line); transition: .14s;
}
.sg-link:last-child { border-bottom: none; }
.sg-link:hover { color: #ff8088; }
.sg-link .sg-ar { margin-left: auto; color: var(--tx-lo); transition: .14s; }
.sg-link:hover .sg-ar { color: #ff8088; transform: translateX(2px); }

/* agent stack */
.stack { display: flex; }
.stack > * { margin-left: -8px; border: 2px solid var(--bg-2); }
.stack > *:first-child { margin-left: 0; }

/* fade-in — animate transform only; never rest at opacity 0 (stays visible if animations are paused) */
.fade { animation: fade .34s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fade { from { transform: translateY(8px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } }

/* responsive */
@media (max-width: 1080px) {
  .app { grid-template-columns: 72px 1fr; }
  .brand-name, .brand-sub, .nav-item span.lbl, .nav-label, .user-chip .uc-text, .nav-badge { display: none; }
  .brand { justify-content: center; padding: 6px 0 18px; }
  .nav-item { justify-content: center; padding: 11px; }
  .nav-item.active::before { left: -14px; }
  .sidebar { padding: 18px 10px; }
}
@media (max-width: 860px) {
  .t-row, .t-head { grid-template-columns: 4px 1fr 110px 24px; }
  .t-row .col-cat, .t-head .col-cat, .t-row .col-prio, .t-head .col-prio { display: none; }
  .content { padding: 22px 18px 60px; }
}
