/* Nyrve in the Spektra theme (from requests.brvos.com, 2026-10-31). Black, flat gold, white, stone. Manrope.
   Light and dark: every color below comes from the palette variables, so a theme is one variable block.
   <html data-theme="auto|light|dark">: auto follows the computer's setting. */
:root {
  color-scheme: light;
  --black: #0B0B0D; --black-2: #16161A; --black-line: #2C2C33; --on-black: #FFFFFF; --on-black-muted: #A9A9B3;
  --gold: #D4A73E; --gold-text: #8A6516; --gold-tint: #FBF3DF; --gold-line: #EEDDB0;
  --stone: #F2F1EE; --stone-2: #F7F6F3; --card: #FFFFFF; --surface: #FFFFFF; --line-2: #ECEAE5;
  --ok: #0B6B3A; --ok-bg: #E8F5EC; --ok-line: #CDE9D6; --bad-bg: #FEF3F2;
  --btn-bg: #0B0B0D; --btn-ink: #FFFFFF; --btn-hover: #26262C;
  --bubble: #E9E9EB; --bubble-ink: #111114;
  --radius: 22px; --radius-sm: 14px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  /* the names Nyrve's pages already use, mapped onto the palette */
  --bg: var(--stone); --panel: var(--card); --line: #E4E2DD; --ink: #111114; --mut: #62626C;
  --accent: var(--gold); --good: var(--ok); --warn: #9A6700; --bad: #B42318;
  --field: var(--stone-2);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --gold-text: #E2BC5E; --gold-tint: #2A2312; --gold-line: #4A3B17;
  --stone: #0B0B0D; --stone-2: #1C1C21; --card: #16161A; --surface: #16161A; --line-2: #24242A;
  --ok: #6FD39A; --ok-bg: #10261A; --ok-line: #1E4A31; --bad-bg: #2A1414;
  --btn-bg: #F2F1EE; --btn-ink: #0B0B0D; --btn-hover: #FFFFFF;
  --bubble: #2C2C33; --bubble-ink: #F2F1EE;
  --line: #2C2C33; --ink: #F2F1EE; --mut: #A9A9B3; --warn: #E2BC5E; --bad: #F2877E;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --gold-text: #E2BC5E; --gold-tint: #2A2312; --gold-line: #4A3B17;
    --stone: #0B0B0D; --stone-2: #1C1C21; --card: #16161A; --surface: #16161A; --line-2: #24242A;
    --ok: #6FD39A; --ok-bg: #10261A; --ok-line: #1E4A31; --bad-bg: #2A1414;
    --btn-bg: #F2F1EE; --btn-ink: #0B0B0D; --btn-hover: #FFFFFF;
    --bubble: #2C2C33; --bubble-ink: #F2F1EE;
    --line: #2C2C33; --ink: #F2F1EE; --mut: #A9A9B3; --warn: #E2BC5E; --bad: #F2877E;
  }
}
* { box-sizing: border-box; }
html, body { background: var(--stone); }
body { margin: 0; color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--gold-text); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
.mut { color: var(--mut); } .sm { font-size: 13px; } .right { text-align: right; }

/* header (black in both themes) */
.top { background: var(--black); color: var(--on-black); border-bottom: 2px solid var(--gold); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1440px; margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--on-black); }
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: auto; display: block; }
.brand .word { font-weight: 700; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: #CFCFD6; }
.top nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.top nav a { color: var(--on-black-muted); padding: 7px 11px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.top nav a:hover { color: var(--on-black); text-decoration: none; background: var(--black-2); }
.top nav a.on { color: var(--black); background: var(--gold); }
.who-me { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--on-black-muted); }
.who-me a { color: var(--on-black-muted); font-weight: 600; }
.who-me a:hover { color: var(--on-black); }
.who-me select { background: var(--black-2); border: 1px solid var(--black-line); color: var(--on-black); border-radius: 999px; padding: 7px 12px; font: 600 13px var(--font); width: auto; max-width: 190px; color-scheme: dark; }
.who-me select:focus { outline: 2px solid var(--gold); }
.theme-btn { background: var(--black-2); border: 1px solid var(--black-line); color: var(--on-black-muted); border-radius: 999px; padding: 6px 12px; font: 700 12.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.theme-btn:hover { color: var(--on-black); border-color: #44444C; }
.theme-btn .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(90deg, #F2F1EE 50%, #0B0B0D 50%); border: 1px solid #6E6E78; }

/* layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 20px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 10px; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 12px; margin: 30px 0 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--mut); }
h3 { font-size: 15px; margin: 0 0 10px; font-weight: 800; letter-spacing: -.01em; }
p.mut, .mut.sm { line-height: 1.6; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { padding: 20px 22px; }
.stat .n { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { color: var(--mut); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.flash { border-radius: var(--radius-sm); padding: 13px 18px; margin-bottom: 18px; font-weight: 600; background: var(--gold-tint); color: var(--gold-text); }

/* tables: rows as rounded cards on the page background */
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: -4px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--mut); font-weight: 800; padding: 6px 14px; }
td { padding: 13px 14px; background: var(--surface); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); vertical-align: top; }
td:first-child { border-left: 1px solid var(--line-2); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
td:last-child { border-right: 1px solid var(--line-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
td:only-child { border-radius: var(--radius-sm); }
tr:hover td { background: var(--stone-2); }
td a { color: var(--ink); font-weight: 700; }
td a:hover { color: var(--gold-text); }

/* chips */
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--stone-2); color: var(--mut); border: 1px solid var(--line-2); }
.pill.good { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--gold-tint); color: var(--gold-text); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill.mut { background: var(--stone-2); color: var(--mut); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 14px var(--font); border-radius: 999px; padding: 10px 20px; border: 1px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-ink); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; background: var(--btn-hover); color: var(--btn-ink); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--mut); background: var(--surface); color: var(--ink); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--black); }
.btn.danger { background: var(--surface); color: var(--bad); border: 1.5px solid var(--bad); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn.sm { padding: 6px 13px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: wait; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions form { display: inline; margin: 0; }

/* fields */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel], input:not([type]), textarea, select {
  font: inherit; font-weight: 500; color: var(--ink); background: var(--stone-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px;
}
input::placeholder, textarea::placeholder { color: var(--mut); opacity: .8; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
input[type=file] { font: inherit; font-size: 13px; color: var(--mut); }
input[type=file]::file-selector-button { font: 700 13px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; margin-right: 10px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); width: 16px; height: 16px; }
.search { padding: 10px 16px; border-radius: 999px; width: 300px; }
.form label { display: block; color: var(--mut); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin: 14px 0 6px; }
.form input[type=text], .form input[type=email], .form input[type=date], .form input[type=number], .form select { width: 100%; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label:has(> input[type=checkbox]), .form label:has(> input[type=radio]),
.form .opt, .opt { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.form .chk { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.form .chk input { width: auto; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; }
.edit-form h3 { margin: 0 0 8px; }
.edit-form label { display: block; margin: 12px 0 5px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--mut); }
.edit-form input:not([type=checkbox]) { width: 100%; max-width: 460px; }
.edit-form label.chk { display: inline-block; margin-right: 16px; color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.edit-form label.chk input { margin-right: 6px; }
details summary { cursor: pointer; }

/* agents directory */
.agent-row { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.agent-row.flagged { background: var(--gold-tint); border-radius: 12px; }
.agent-row input, .agent-row select { padding: 7px 10px; border-radius: 10px; }
.agent-row .f-name { width: 175px; } .agent-row .f-phone { width: 135px; } .agent-row .f-email { width: 200px; }

/* inbox + conversation */
.convo { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.convo:hover { background: var(--stone-2); text-decoration: none; }
.convo .snip { color: var(--mut); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 760px; font-weight: 500; }
.thread { display: block; max-height: calc(100vh - 600px); min-height: 220px; overflow-y: auto; padding: 6px 6px 6px 0; }
.msg { max-width: 70%; padding: 10px 14px; border-radius: 16px; margin: 6px 0; background: var(--stone-2); border: 1px solid var(--line-2); }
.msg.out { margin-left: auto; border-bottom-right-radius: 4px; }
.msg.in { margin-right: auto; border-bottom-left-radius: 4px; }
.msg.s-client { background: var(--surface); }
.msg.s-nyrve { background: var(--gold-tint); border-color: var(--gold-line); }
.msg.s-agent { background: var(--ok-bg); border-color: var(--ok-line); }
.msg .who { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; font-weight: 800; }
.msg.s-client .who { color: var(--mut); } .msg.s-nyrve .who { color: var(--gold-text); } .msg.s-agent .who { color: var(--ok); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .t { font-size: 11px; color: var(--mut); margin-top: 4px; }
.msg img.media { display: block; max-width: 220px; border-radius: 10px; margin: 4px 0; }
.legend { display: flex; gap: 8px; margin: 4px 0 10px; font-size: 11px; }
.legend .lg { padding: 3px 10px; border-radius: 999px; font-weight: 800; }
.legend .lg.s-client { background: var(--surface); color: var(--mut); border: 1px solid var(--line); }
.legend .lg.s-nyrve { background: var(--gold-tint); color: var(--gold-text); }
.legend .lg.s-agent { background: var(--ok-bg); color: var(--ok); }
.compose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-top: 10px; }
.compose textarea { width: 100%; min-height: 70px; resize: vertical; }
.compose .row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* sign in (black card in both themes) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 480px; background: var(--black); color: var(--on-black); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--black-line); }
.auth-card .bar { height: 3px; background: var(--gold); }
.auth-card .in { padding: 34px 40px 40px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .logo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.auth-card .logo img { height: 34px; width: auto; }
.auth-card .logo .sep { width: 1px; height: 22px; background: var(--black-line); }
.auth-card .logo span { font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #CFCFD6; }
.auth-card h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.035em; margin: 0; color: #FFFFFF; }
.auth-card h1 em { font-style: normal; color: var(--gold); }
.auth-card p { margin: 0; color: var(--on-black-muted); font-size: 15px; }
.auth-card form { display: grid; gap: 12px; }
.auth-card input { width: 100%; background: var(--black-2) !important; border-color: var(--black-line) !important; color: #FFFFFF !important; font-size: 16px; padding: 14px 16px; color-scheme: dark; }
.auth-card input::placeholder { color: #6E6E78; }
.auth-card .btn { width: 100%; padding: 15px 22px; font-size: 15px; background: var(--gold); border-color: var(--gold); color: var(--black); }
.auth-card .flash { margin: 0; background: #2A1414; color: #F2877E; }
@media (max-width: 760px) { table { display: block; overflow-x: auto; } .top-in { padding: 8px 14px; } .wrap { padding: 20px 14px 32px; } }
@media (max-width: 560px) { .auth-card .in { padding: 26px 22px 28px; } .auth-card h1 { font-size: 32px; } .card { padding: 18px; border-radius: 18px; } h1 { font-size: 24px; } .search { width: 100%; } }
