/* vibeship admin — staff tool.
 *
 * Self-contained on purpose: served from admin.vibeship.eu out of its own
 * ConfigMap, sharing no stylesheet with the customer site. The duplication of a
 * few colour values is the price of the admin app never being able to break
 * because a marketing page changed a token. */

:root {
  --bg:        #0a0a0c;
  --bg-elev:   #111114;
  --bg-card:   #16161a;
  --border:    #232328;
  --border-2:  #2e2e36;
  --text:      #e7e7ea;
  --text-dim:  #9a9aa3;
  --text-mute: #6b6b75;
  --accent:    #7c5cff;
  --accent-text: #a78bff;
  --green:     #4ade80;
  --amber:     #f59e0b;
  --red:       #ef4444;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

.top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.brand { font-weight: 600; }
.brand-dim { color: var(--accent-text); font-weight: 400; }
.who { margin-left: auto; color: var(--text-dim); font-size: 0.85rem; }
.linkish {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 0.85rem;
  color: var(--accent-text); cursor: pointer;
}

.gate { max-width: 30rem; margin: 12vh auto; padding: 0 1.5rem; text-align: center; }
.gate h1 { font-size: 1.4rem; }
.gate p { color: var(--text-dim); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: default; }

.filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 0;
  flex-wrap: wrap;
}
.filter {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.filter.on { border-color: var(--accent); color: var(--text); }

/* Two columns on a desk, stacked on a phone. Staff answer from both. */
.cols {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
}

.queue { display: flex; flex-direction: column; gap: 0.5rem; }
.row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.row:hover { border-color: var(--border-2); }
.row-on { border-color: var(--accent); }
.row-top { display: flex; align-items: center; gap: 0.5rem; }
.row-when { color: var(--text-mute); font-size: 0.75rem; margin-left: auto; }
.row-subject { font-size: 0.9rem; }
.row-who { color: var(--text-dim); font-size: 0.78rem; }

.pill {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
}
.pill-open     { color: var(--amber); }
.pill-answered { color: var(--green); }

/* The reference: what the customer was looking at. Given room rather than
 * truncated, because it is the difference between a readable queue and a list
 * of "something is wrong". */
.ref {
  display: block;
  color: var(--accent-text);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.thread {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  min-height: 12rem;
}
.thead h2 { font-size: 1.05rem; margin: 0 0 0.35rem; }
.thead-meta, .thead-ref { margin: 0 0 0.3rem; font-size: 0.82rem; color: var(--text-dim); }

.msgs { margin: 1rem 0; display: flex; flex-direction: column; gap: 0.75rem; }
.msg-who {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  margin-bottom: 0.15rem;
}
.msg-when { text-transform: none; letter-spacing: 0; }
.msg-body {
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Ours is marked so a long conversation is scannable at a glance. */
.msg-team .msg-body { border-left: 2px solid var(--accent); }

textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

.actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.7rem; }
.muted { color: var(--text-mute); font-size: 0.85rem; }
.err { color: var(--red); font-size: 0.85rem; }
