/* ═══════════════════════════════════════════════════════
   Mirror2  ·  style.css
   Palette: matte black / graphite / antique gold / brass
   ══════════════════════════════════════════════════════ */

:root {
  --bg:      #08080a;
  --panel:   #101012;
  --panel2:  #161619;
  --line:    #1c1a16;
  --line-g:  #2c2710;
  --text:    #ede8dc;
  --muted:   #887e70;
  --dim:     #4c4840;
  --gold:    #c2a050;
  --gold-l:  #dcbc6c;
  --gold-d:  #685020;
  --gold-bg: #181408;
  --bad:     #b04040;
  --bad-bg:  #160808;
  --ok:      #488c5c;
  --ok-bg:   #081210;
  --warn:    #a07830;
  --warn-bg: #160e04;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 50% 0px, #1a1408 0%, transparent 52%);
  color: var(--text);
  font: 15px/1.52 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-l); text-decoration: underline; }

/* ─── Shell ─────────────────────────────────────────── */
.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px;
}

/* ─── Hero / header bar ──────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line-g);
  margin-bottom: 22px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-d);
  font-weight: 700;
  margin-bottom: 5px;
}

.hero h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.1;
}

/* ─── Nav ────────────────────────────────────────────── */
nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  display: inline-block;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
}

nav a:hover {
  background: var(--gold-bg);
  color: var(--gold);
  border-color: var(--line-g);
  text-decoration: none;
}

/* ─── Buttons ────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #1c1808 0%, #120f07 100%);
  border: 1px solid var(--gold-d);
  color: var(--gold-l);
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.1s, background 0.1s;
  white-space: nowrap;
}

button:hover, .btn:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, #281e08 0%, #1a1606 100%);
  text-decoration: none;
}

button:disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.secondary, .btn.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.secondary:hover, .btn.secondary:hover {
  background: var(--panel);
  border-color: var(--line-g);
  color: var(--text);
}

.danger, .btn.danger {
  background: linear-gradient(180deg, #1e0808 0%, #120505 100%);
  border-color: #501818;
  color: #b06868;
}

.danger:hover, .btn.danger:hover {
  border-color: var(--bad);
  background: linear-gradient(180deg, #280a0a 0%, #180707 100%);
}

.mini {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 12px 0;
}

/* ─── Grid ───────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
}

.stats {
  margin-bottom: 4px;
}

/* ─── Metrics ────────────────────────────────────────── */
.metric {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.metric span {
  display: block;
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.metric b {
  display: block;
  color: var(--gold);
  font-size: 30px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.025em;
  line-height: 1;
}

/* ─── Split ──────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ─── Toolbar / Row ──────────────────────────────────── */
.toolbar, .row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  max-width: 300px;
}

/* ─── Pager ──────────────────────────────────────────── */
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

/* ─── Headings ───────────────────────────────────────── */
h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ─── Form labels ────────────────────────────────────── */
label {
  display: block;
  margin: 13px 0 5px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

/* ─── Inputs ─────────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.1s, box-shadow 0.1s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--gold-d);
  box-shadow: 0 0 0 3px rgba(194, 160, 80, 0.08);
}

textarea {
  min-height: 180px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  resize: vertical;
}

.htmlbox { min-height: 320px; }

/* ─── Helpers ────────────────────────────────────────── */
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ─── Console / pre output ───────────────────────────── */
.console {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px 14px;
  min-height: 68px;
  overflow: auto;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.55;
}

/* ─── Flash messages ─────────────────────────────────── */
.flash {
  padding: 11px 14px;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px solid;
  font-size: 14px;
}

.flash.ok   { background: var(--ok-bg);   border-color: #1a4a28; color: #70c888; }
.flash.bad  { background: var(--bad-bg);  border-color: #401818; color: #c07070; }
.flash.warn { background: var(--warn-bg); border-color: #402808; color: #c09040; }

/* ─── Tables ─────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  border-bottom: 1px solid var(--line-g);
}

tbody tr:hover { background: rgba(255, 255, 255, 0.014); }

.tableBox { overflow: auto; }

.recipientTable input,
.recipientTable select {
  min-width: 110px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.recipientTable .r-email { min-width: 220px; }

.recipientTable tr.saved {
  animation: rowsaved 0.85s ease;
}

@keyframes rowsaved {
  0%   { background: rgba(72, 140, 92, 0.18); }
  100% { background: transparent; }
}

/* ─── Status pills ───────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill.sent, .pill.complete {
  background: var(--ok-bg);
  color: #70c888;
  border-color: #1a4a28;
}

.pill.failed, .pill.invalid {
  background: var(--bad-bg);
  color: #c07070;
  border-color: #401818;
}

.pill.pending, .pill.queued, .pill.sending {
  background: #0e0c1c;
  color: #8878c0;
  border-color: #281c4c;
}

.pill.paused, .pill.retry {
  background: var(--warn-bg);
  color: #c09040;
  border-color: #402808;
}

.pill.active {
  background: #081210;
  color: #60b878;
  border-color: #184828;
}

/* ─── Progress bar ───────────────────────────────────── */
.progress {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin: 14px 0;
}

.progress div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-d) 0%, var(--gold) 100%);
  transition: width 0.2s ease;
}

/* ─── Action groups ──────────────────────────────────── */
.actions, .rowActions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Inline code ────────────────────────────────────── */
code {
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--gold);
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

/* ─── Footer ─────────────────────────────────────────── */
footer {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 28px 0 16px;
  text-align: center;
  border-top: 1px solid var(--line-g);
  margin-top: 16px;
}

/* ─── Login page (public / pg-login body class) ──────── */
.pg-login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.pg-login .shell {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pg-login .hero { display: none; }

.pg-login main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.pg-login footer {
  margin-top: 0;
  padding: 16px 0;
}

/* Login wordmark + rule */
.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-wordmark {
  display: block;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-d);
  font-weight: 700;
  margin-bottom: 14px;
}

.login-rule {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-d), transparent);
  margin: 0 auto;
}

/* Login card */
.login {
  width: 100%;
  max-width: 360px;
  margin: 0;
}

.login form {
  display: flex;
  flex-direction: column;
}

.login label { margin-top: 0; }

button.login-submit {
  width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Unsubscribe centred message */
.unsub-msg {
  text-align: center;
  margin: 4px 0 0;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  .hero { display: block; }
  nav { margin-top: 14px; justify-content: flex-start; }
  .split { grid-template-columns: 1fr; }
  .shell { padding: 14px 16px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 18px; }
  .metric b { font-size: 26px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .login { max-width: 100%; }
}


/* Mirror2 final login simplification and red-shadow enter button */
.pg-login main { padding: 44px 0; }
.pg-login .login-header { margin-bottom: 26px; }
.pg-login .login-wordmark {
  font-size: clamp(26px, 7vw, 46px);
  letter-spacing: 0.08em;
  color: var(--text);
  text-shadow: 0 0 22px rgba(194, 160, 80, 0.22), 0 0 2px rgba(255,255,255,0.16);
  font-weight: 760;
  text-transform: uppercase;
}
.pg-login .login-rule {
  width: 92px;
  margin-top: 16px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .72;
}
.pg-login .login,
.pg-login .card.login {
  max-width: 390px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(16,16,18,.96), rgba(7,7,8,.98));
  border-color: rgba(194,160,80,.22);
  box-shadow: 0 24px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.035);
}
.pg-login .login h2,
.pg-login .login p,
.pg-login .login .pill,
.pg-login .landing-subtitle,
.pg-login .login-pills,
.pg-login .login-copy { display: none !important; }
button.login-submit,
.pg-login button.login-submit {
  background: radial-gradient(circle at 50% 0%, #261111 0%, #080808 58%, #020202 100%);
  border-color: #3a0c0c;
  color: #fff;
  box-shadow: 0 0 24px rgba(142, 22, 22, 0.38), 0 10px 32px rgba(0,0,0,.55);
  text-shadow: 0 1px 0 rgba(0,0,0,.65);
}
button.login-submit:hover,
.pg-login button.login-submit:hover {
  background: radial-gradient(circle at 50% 0%, #3a1414 0%, #0b0b0b 60%, #020202 100%);
  border-color: #741d1d;
  box-shadow: 0 0 34px rgba(175, 30, 30, 0.48), 0 14px 36px rgba(0,0,0,.62);
  color: #fff;
}
.recipientStatusLine { color: var(--muted); font-size: 12px; margin-top: 8px; }
tr.error { animation: rowerror .9s ease; }
@keyframes rowerror { 0% { background: rgba(176,64,64,.20); } 100% { background: transparent; } }

/* final recipient intake repair */
.fallbackBox {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.012);
  padding: 10px 12px;
}
.fallbackBox summary {
  cursor: pointer;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.classicAdd { margin: 12px 0 8px; }
.classicImport { margin-top: 12px; }
.classicImport textarea { min-height: 120px; }
.console.compact { min-height: 44px; }
.recipientTable tr.error { animation: rowerror 0.9s ease; }
@keyframes rowerror { 0% { background: rgba(176,64,64,.2); } 100% { background: transparent; } }
@media (max-width: 720px) {
  .inlineAdd, .classicAdd { display: grid; grid-template-columns: 1fr; }
  .inlineAdd input, .classicAdd input, .inlineAdd button, .classicAdd button { width: 100%; max-width: none; }
}


/* Classic recipient overlay, no Ajax dependency */
.login-wordmark { font-size: clamp(22px, 5vw, 42px); letter-spacing: .16em; color: var(--text); text-shadow: 0 0 22px rgba(194,160,80,.18); }
.login-submit { background: linear-gradient(180deg, #171111 0%, #050505 100%) !important; border-color: #4b1116 !important; color: #fff !important; box-shadow: 0 0 28px rgba(150, 20, 32, .34), inset 0 1px 0 rgba(255,255,255,.05); }
.login-submit:hover { border-color: #8a222d !important; box-shadow: 0 0 36px rgba(180, 28, 42, .46), inset 0 1px 0 rgba(255,255,255,.07); }
.classicAddPanel { background: linear-gradient(180deg, rgba(194,160,80,.055), rgba(0,0,0,0)); border: 1px solid var(--line-g); border-radius: 12px; padding: 16px; margin: 14px 0; }
.classicAddPanel h2 { margin-bottom: 10px; }
.classicAddRow input { flex: 1 1 210px; }
.classicImport textarea { min-height: 180px; }
.dangerZone { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.012); }
.dangerZone form { margin: 0; }
.listSummary { margin: 18px 0 10px; color: var(--muted); font-size: 13px; }
.listSummary span { color: var(--gold-l); font-weight: 800; font-size: 18px; }
.recipientClassicList { display: grid; gap: 10px; margin-top: 10px; }
.recipientEditor { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #0b0b0d; }
.recipientEditor.active { border-color: rgba(72,140,92,.35); }
.recipientEditor.invalid { border-color: rgba(176,64,64,.35); }
.recipientEditor.suppressed { opacity: .82; border-color: rgba(160,120,48,.28); }
.recipientMeta { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.recipientGrid { display: grid; grid-template-columns: minmax(240px, 1.6fr) minmax(160px, .9fr) minmax(120px, .6fr) minmax(150px, .7fr) minmax(180px, 1fr); gap: 10px; align-items: end; }
.recipientGrid label { margin: 0; }
.recipientGrid input, .recipientGrid select { margin-top: 5px; }
.recipientHistory { padding: 8px 0 0; }
.recipientActions { margin: 12px 0 0; }
.reasonInput { max-width: 240px; }
.classicImportPage textarea { min-height: 320px; }
@media (max-width: 900px) {
  .dangerZone { grid-template-columns: 1fr; }
  .recipientGrid { grid-template-columns: 1fr; }
  .recipientMeta { align-items: flex-start; flex-direction: column; }
  .reasonInput { max-width: none; }
}

/* final no-ajax recipient repair */
.recipientCommand { border-color: var(--line-g); }
.directAddForm button { margin-top: 12px; }
.compactSplit { grid-template-columns: 1fr 1fr; gap: 12px; }
.miniStats { margin: 10px 0 18px; }
.classicImportPage button:first-of-type { margin-bottom: 14px; }
.recipientClassicList { display: grid; gap: 10px; margin-top: 12px; }
.recipientEditor { border: 1px solid var(--line); background: rgba(255,255,255,0.012); border-radius: 12px; padding: 14px; }
.recipientEditor.active { border-color: rgba(72,140,92,.28); }
.recipientEditor.invalid { border-color: rgba(176,64,64,.25); }
.recipientEditor.suppressed { border-color: rgba(176,64,64,.35); }
.recipientMeta { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.recipientGrid { display:grid; grid-template-columns: minmax(220px,2fr) 1fr 150px 1fr 1.2fr; gap:10px; align-items:end; }
.recipientGrid label { margin:0; }
.recipientHistory { margin: 10px 0; }
.reasonInput { max-width: 220px; }
.dangerZone { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; display:grid; gap:8px; }
.listSummary { color: var(--muted); margin: 16px 0 8px; font-size:13px; }
.listSummary span { color: var(--gold); font-weight:700; }
@media (max-width: 860px) {
  .compactSplit { grid-template-columns: 1fr; }
  .recipientGrid { grid-template-columns: 1fr; }
  .recipientActions { align-items: stretch; }
  .recipientActions button, .recipientActions input { width: 100%; max-width: none; }
}
