/* Inter Variable — self-hosted, no external requests (2026-07-28 rebrand).
   font-weight: 100 900 covers the whole variable axis, so every existing
   font-weight rule (400/600/700 etc.) already used across the app "just
   works" against this one file — no other CSS needed to change. */
@font-face {
  font-family: 'Inter Variable';
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Variable';
  src: url('/static/fonts/InterVariable-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Ember — refined Zed BPO brand: warm near-black + precise logo orange
     (matches Zed Payroll's identical refresh), a raised surface tone for
     hover/elevation, and a muted semantic green. */
  --bg: #0b0f17;
  --panel: #17140f;
  --panel-2: #1e1a14;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5efe6;
  --muted: #948a7c;
  --accent: #2f7df6;
  --accent-soft: rgba(47, 125, 246, 0.16);
  --ok: #4caf7d;
  --bad: #e2685f;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  /* Renders native widget internals (select arrow + popup list, date picker)
     dark — CSS can style the control box but not those parts. */
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; }
.brand-logo { height: 24px; width: auto; display: block; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 6px 12px; border-radius: 8px; transition: color .15s ease, background .15s ease; }
.topbar nav a:hover { color: var(--text); background: var(--panel-2); }
.who { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.who button { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px; transition: border-color .15s ease, color .15s ease; }
.who button:hover { border-color: var(--accent); color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 20px; box-shadow: 0 20px 45px -32px rgba(0, 0, 0, 0.7);
}
.card h2 { margin-top: 0; font-size: 16px; }

.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-form .full { grid-column: 1 / -1; }
.grid-form label, .inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.grid-form input, .grid-form select,
.inline-form input, .inline-form select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 14px; margin-top: 2px;
}
.inline-form { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 12px; }

button, .btn-secondary {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-block; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(47, 125, 246, 0.5); }
button:active { transform: translateY(0); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
td { transition: background .15s ease; }
tr:hover td { background: var(--panel-2); }

.pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--border); color: var(--text); text-transform: capitalize; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); font-size: 13px; }

/* login page */
.login-wrap { max-width: 360px; margin: 100px auto; padding: 0 20px; }
.login-wrap .card { text-align: center; }
.login-logo { height: 46px; width: auto; display: block; margin: 0 auto 12px; }

/* chat layout */
.chat-shell { display: grid; grid-template-columns: 260px 1fr; gap: 0; height: calc(100vh - 65px); }
.contacts { border-right: 1px solid var(--border); overflow-y: auto; padding: 12px; }
.contacts a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14px; margin-bottom: 2px;
  transition: background .15s ease;
}
.contacts a:hover { background: var(--panel-2); }
.contacts a.active { background: var(--panel-2); border: 1px solid var(--border); }
.contacts a .cname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  /* Neutral background (not --accent-soft) — this file is shared by the
     Zednex (violet) and Medical instances too, which override --accent per
     view but have no matching "soft" tint; a neutral chip + accent-colored
     initials looks right under any of the three brand colors. */
  width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.unread-badge { background: var(--bad); color: #fff; flex-shrink: 0; }
.conversation { display: flex; flex-direction: column; height: 100%; }
.thread-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.thread-name { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; }
.thread-header .btn-secondary {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 12.5px; margin-left: 0;
}
.thread-header .btn-secondary:disabled { opacity: .6; cursor: default; }
.refresh-icon { display: inline-block; font-size: 14px; line-height: 1; }
.btn-secondary.spinning .refresh-icon { animation: spin .6s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg {
  max-width: 60%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4;
  opacity: 0; animation: msg-in .28s ease forwards;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.theirs { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.msg-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.msg-time { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg.mine .msg-time { color: rgba(255, 255, 255, 0.75); }
/* Read receipts — WhatsApp-style double check. Gray = sent, not yet read;
   blue = read. Blue is a fixed hex (not --accent) so it reads correctly and
   consistently regardless of which of the 3 brand accents this instance uses. */
.ticks { display: inline-flex; color: rgba(255, 255, 255, 0.55); flex-shrink: 0; transition: color .2s ease; }
.ticks.read { color: #53bdeb; }
.ticks svg { display: block; }
.composer { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--border); }
.composer input { flex: 1; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 14px; transition: border-color .15s ease; }
.composer input:focus { border-color: var(--accent); outline: none; }
.empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
