/* InJest admin dashboard — same black-and-green design system as the
   desktop app (src/renderer/styles.css), not the plain functional look
   this started with. Tokens, gradients, and button/panel treatments are
   copied 1:1 from there so this reads as the same product. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("fonts/PlusJakartaSans-Variable.woff2") format("woff2");
}

:root {
  --bg: #10140f;
  --panel: rgba(13, 18, 13, 0.82);
  --panel-border: rgba(184, 230, 191, 0.10);
  --field: rgba(255, 255, 255, 0.04);
  --field-border: rgba(184, 230, 191, 0.16);
  --text: #e9f6ea;
  --muted: #9cb8a1;
  --accent: #35e06f;
  --accent-soft: #9ff7bc;
  --accent-hover: #5aef8d;
  --accent-dim: rgba(53, 224, 111, 0.12);
  --accent-grad: linear-gradient(135deg, #7cf7a3 0%, #35e06f 55%, #1fb659 100%);
  --ok: #6df29a;
  --bad: #ff7b70;
  --glow: rgba(53, 224, 111, 0.45);
  --glow-gray: rgba(210, 214, 210, 0.25);
  --warn: #f5c96a;
  --radius: 16px;
  --scrollbar-thumb: rgba(53, 224, 111, 0.35);
  --scrollbar-thumb-hover: rgba(53, 224, 111, 0.65);
}

* { box-sizing: border-box; }

/* Scrollbars: slim, translucent green pills that sit on the page
   background instead of the OS default gutter — same as the desktop app
   (src/renderer/styles.css), not the plain browser default this had. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(74, 222, 128, 0.20) 0%, rgba(34, 110, 60, 0.10) 42%, transparent 70%),
    radial-gradient(900px 500px at 12% 108%, rgba(120, 220, 150, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, #131a13 0%, #0d110d 55%, #17201618 100%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

a { color: var(--accent-soft); }
.hidden { display: none !important; }

h1, h2, h3 {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  margin: 0;
}

/* ---------- brand ---------- */
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-row svg { flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(53, 224, 111, 0.15)); }
.brand-row .brand-title {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(180deg, #f2fff4 20%, #a9dcb2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-row .brand-sub {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ---------- buttons ---------- */
button {
  font: inherit;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 8px 15px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s, opacity 0.2s;
}
button:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  transform: translateY(-1px);
}
button:active:not(:disabled) { transform: translateY(1px) scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:focus { outline: none; }
button:focus-visible { box-shadow: 0 0 0 2px rgba(53, 224, 111, 0.4); }

.btn-primary {
  background: var(--accent-grad);
  border-color: rgba(53, 224, 111, 0.45);
  color: var(--bg);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  border-color: rgba(53, 224, 111, 0.85);
  color: var(--bg);
  box-shadow: 0 0 18px var(--glow);
}
.btn-danger { color: var(--bad); border-color: rgba(255, 123, 112, 0.4); background: transparent; }
.btn-danger:hover:not(:disabled) { border-color: var(--bad); box-shadow: 0 0 12px rgba(255, 123, 112, 0.35); }
.btn-small { padding: 4px 11px; font-size: 12px; border-radius: 8px; }

/* ---------- form fields ---------- */
input, select, textarea {
  font: inherit;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 13px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }

/* ---------- custom dropdown (ui-select.js) ----------
   Every <select> is progressively enhanced into one of these — see
   ui-select.js for why: a native select's open popup can't be reliably
   restyled at all (OS/browser-rendered, outside the page's paint path).
   Ported verbatim from the desktop app's own .ui-select* rules. */
.ui-native {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.ui-select { position: relative; display: inline-flex; }
.ui-select-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--field-border); border-radius: 9px;
  padding: 8px 11px; font-size: 13px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.ui-select-trigger:hover { border-color: rgba(184, 230, 191, 0.30); }
.ui-select-trigger:focus-visible, .ui-select-trigger.open {
  outline: none; border-color: var(--accent); box-shadow: 0 0 10px var(--glow);
}
.ui-select-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.ui-select-label { flex: 1; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.ui-chevron {
  display: inline-flex; color: var(--muted); font-size: 10px; line-height: 1;
  transition: transform 0.15s, color 0.15s;
}
.ui-select-trigger.open .ui-chevron { transform: rotate(180deg); color: var(--accent-soft); }

.ui-select-menu {
  position: fixed; z-index: 500;
  background: #0e130e; border: 1px solid var(--panel-border); border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 24px rgba(53, 224, 111, 0.08);
  opacity: 0; transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  padding: 6px; max-height: 280px; overflow-y: auto;
  transition: opacity 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.ui-select-menu.ui-pop-up { transform: translateY(4px) scale(0.98); }
.ui-select-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.ui-select-option {
  padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--text);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ui-select-option:hover { background: var(--field); }
.ui-select-option.selected { background: var(--accent-dim); color: var(--accent-soft); font-weight: 600; }
/* Form fields (e.g. "Send as") want the dropdown to fill the field's
   width, same as the plain <select> it replaces did via .field's
   flex-stretch; toolbar filters (tier/status) stay content-sized. */
.field .ui-select { display: flex; width: 100%; }
.field .ui-select-trigger { width: 100%; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--glow);
}
label { color: var(--muted); font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-weight: 700; }
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; padding-right: 38px; }
.password-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  background: none; border: none; padding: 6px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.password-toggle:hover, .password-toggle:active { color: var(--text); box-shadow: none; transform: translateY(-50%) !important; }
.password-toggle.showing { color: var(--accent-soft); }

/* ---------- login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 360px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(53, 224, 111, 0.06);
}
.login-card .brand-row { margin-bottom: 22px; }
.login-card p.sub {
  color: var(--muted);
  font-size: 12.5px;
  margin: -14px 0 20px;
}
.error-text { color: var(--bad); font-size: 12.5px; margin: 10px 0 0; }
.status-text { color: var(--ok); font-size: 12.5px; margin: 10px 0 0; }
.auth-link-plain {
  display: block; width: 100%; margin-top: 14px; padding: 0;
  background: none; border: none; color: var(--muted);
  font-size: 12px; text-decoration: underline; cursor: pointer; text-align: center;
}
.auth-link-plain:hover { color: var(--accent-soft); box-shadow: none; transform: none; }

/* ---------- dashboard shell ----------
   Left sidebar (brand + nav + log out), same idea as the desktop app's own
   #sidebar, rather than a horizontal tab strip — keeps vertical space free
   for the actual content, which matters most on the Inbox tab. */
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 14px;
  border-right: 1px solid var(--panel-border);
}
.sidebar .brand-row { padding: 0 8px; }
.sidebar .brand-row .brand-title { font-size: 20px; }
.sidebar .brand-row .brand-sub { font-size: 12px; letter-spacing: 2px; }
.sidebar-tabs { display: flex; flex-direction: column; gap: 2px; }
.sidebar-logout-group { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.sidebar-logout-group #logout-all-btn { color: var(--bad); border-color: rgba(255, 123, 112, 0.35); }
.sidebar-logout-group #logout-all-btn:hover { background: rgba(255, 123, 112, 0.1); }

/* Mirrors .settings-tab-btn from the desktop app's Settings menu 1:1
   (src/renderer/styles.css) — same active-pill treatment, same hover glow,
   so the admin sidebar reads as the same product. */
.tab-btn {
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transform: none;
  transition: background-color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1),
              color 0.2s cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 0.2s cubic-bezier(0.25, 0.8, 0.25, 1),
              transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.sidebar-tabs .tab-btn { width: 100%; }
.tab-btn:hover:not(.on) {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-shadow: 0 0 6px var(--glow-gray);
  transform: translateY(-1px);
}
.tab-btn:active { transform: translateY(1px) scale(0.98); }
.tab-btn.on {
  background: var(--accent-grad);
  color: var(--bg);
  box-shadow: 0 0 14px var(--glow);
}

main {
  flex: 1;
  min-width: 0;
  max-width: 1120px;
  padding: 26px;
}
/* Toggled on <body> only while the Inbox tab is open (see dashboard.js
   showTab) — every other tab keeps the normal capped layout. */
body.wide-main main { max-width: none; padding: 20px 26px; }
.panel { display: none; }
.panel.on { display: block; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.panel-head h2 { font-size: 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- stat tiles ---------- */
.stat-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-tile {
  flex: 1;
  min-width: 150px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-tile .stat-label { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-tile .stat-value { font-size: 28px; font-weight: 800; margin-top: 6px; color: var(--text); font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
.stat-tile .stat-trend { font-size: 12px; font-weight: 700; margin-top: 4px; }
.stat-trend.up { color: var(--ok); }
.stat-trend.down { color: var(--bad); }
.stat-trend.flat { color: var(--muted); }

/* ---------- Stats page (all-time totals) — ported 1:1 from the desktop
   app's own Settings > Stats tab (src/renderer/styles.css) so this reads as
   the same product instead of the plain .stat-tile row every other panel
   uses. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.stat-box {
  --stat-color: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 14px;
  padding: 18px 20px;
}
.stat-box .stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklch, var(--stat-color) 16%, transparent);
  color: var(--stat-color);
}
.stat-box .stat-icon svg { width: 18px; height: 18px; }
.stat-box .stat-value {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.stat-box .stat-label { font-size: 13px; color: var(--muted); }
.stat-box .stat-sub { font-size: 12px; color: var(--muted); margin-top: -4px; }
.stat-ingest { --stat-color: var(--accent); }
.stat-import { --stat-color: #b48cff; }
.stat-projects { --stat-color: #6cd0ff; }
.stat-encode { --stat-color: var(--warn); }
.stat-transfer { --stat-color: #ff7ac2; }
.stat-devices { --stat-color: #17e0a0; }
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- activity feed (Overview) ---------- */
.activity-feed { display: flex; flex-direction: column; }
.activity-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--panel-border); font-size: 13px; }
.activity-row:last-child { border-bottom: none; }
.activity-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.activity-icon.signup { background: var(--accent-dim); color: var(--accent-soft); }
.activity-icon.purchase { background: rgba(109, 242, 154, 0.14); color: var(--ok); }
.activity-icon.revoked { background: rgba(255, 123, 112, 0.14); color: var(--bad); }
.activity-icon.granted { background: rgba(245, 201, 106, 0.14); color: var(--warn); }
.activity-icon-img { width: 100%; height: 100%; object-fit: cover; }
.activity-text { flex: 1; color: var(--text); }
.activity-text .muted { margin-left: 4px; }
.activity-time { color: var(--muted); font-size: 11.5px; flex-shrink: 0; white-space: nowrap; }

/* ---------- table ---------- */
.table-card {
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--panel-border); font-size: 13px; }
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.02);
}
tr:last-child td { border-bottom: none; }
/* Device activations table: no line between two devices on the same
   license (a Duo's pair, say) — see renderUserDetail() in dashboard.js. */
tr.device-row-grouped td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: rgba(255, 255, 255, 0.04); }
td.num, th.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, monospace; font-size: 12px; color: var(--accent-soft); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.pill-active { background: rgba(109, 242, 154, 0.14); color: var(--ok); }
.pill-revoked { background: rgba(255, 123, 112, 0.14); color: var(--bad); }
.pill-neutral { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.pill-warn { background: rgba(245, 201, 106, 0.14); color: var(--warn); }

/* Tier badges (Solo/Duo/Trial) only - same filled, glowing, uppercase look
   as the app's own account-tier pill (PC/src/renderer/styles.css), kept
   separate from the plain translucent .pill-* variants above since those
   are shared by subscription/coupon status badges that don't use this
   look. */
.tier-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  white-space: nowrap;
}
.tier-pill-solo  { background: var(--warn); color: #2a2005; box-shadow: 0 0 10px rgba(245, 201, 106, 0.25); }
.tier-pill-duo   { background: #ff6b1a;     color: #ffffff; box-shadow: 0 0 10px rgba(255, 107, 26, 0.30); }
.tier-pill-trial { background: var(--accent-dim); color: var(--accent-soft); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.empty-note { color: var(--muted); font-style: italic; padding: 26px; text-align: center; }

/* inline magnitude bar inside a table cell */
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.bar-track { flex: 1; height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent-grad); border-radius: 4px; }

/* ---------- simple column bar chart ---------- */
.chart-card {
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.chart-card h3 { font-size: 11.5px; color: var(--muted); margin: 0 0 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.column-chart { display: flex; align-items: flex-end; gap: 5px; height: 150px; border-bottom: 1px solid var(--panel-border); padding-bottom: 2px; }
.column-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.column-chart .col-bar { width: 100%; max-width: 24px; background: var(--accent-grad); border-radius: 4px 4px 0 0; box-shadow: 0 0 10px rgba(53, 224, 111, 0.15); }
.column-chart .col-label { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 5, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  width: 400px;
  max-width: 92vw;
  background: #0e130e;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(53, 224, 111, 0.06);
}
.modal-card h3 { margin: 0 0 16px; font-size: 16px; }
.modal-card.wide { width: 680px; max-height: 85vh; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-card p.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 14px; }

/* ---------- emails tab ---------- */
.email-layout { display: grid; grid-template-columns: 240px 1fr 260px; gap: 20px; align-items: start; }
.email-user-list {
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.email-user-list input[type="text"] { width: 100%; }
.email-users-scroll {
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.email-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.email-user-row:hover { background: rgba(255, 255, 255, 0.04); }
.email-user-row.selected { background: var(--accent-dim); border-color: rgba(53, 224, 111, 0.35); }
.email-user-row-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--field);
}
.email-user-row-avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent-soft);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.email-user-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.email-user-row .email-user-row-name { font-size: 12.5px; color: var(--text); font-weight: 600; }
.email-user-row .email-user-row-email { font-size: 11.5px; color: var(--muted); word-break: break-all; }
.email-user-row .email-user-row-meta { font-size: 10.5px; color: var(--muted); }
.email-users-scroll .empty-note { padding: 16px 4px; font-size: 12.5px; }

/* Same avatar + name/email pattern as .email-user-row above, reused in the
   Users tab's table so a person reads as the same identity everywhere in
   the dashboard, not just the Emails tab. */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--field);
}
.user-cell-avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent-soft);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.user-cell-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.user-cell-name { font-size: 13px; color: var(--text); font-weight: 600; cursor: default; }
.user-cell-email { font-size: 11.5px; color: var(--muted); word-break: break-all; }

/* Shared hover tooltip (currently just the Users table: hover a name to
   see the account's email) — same solid dark popover treatment as the
   desktop app's #info-popover, ported since a native title="" tooltip is
   OS-styled and can't be reskinned. */
.admin-tooltip {
  position: fixed;
  z-index: 10000;
  display: none;
  max-width: 280px;
  padding: 7px 10px;
  background: #0e130e;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.admin-tooltip.show { display: block; }
.email-compose {
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
}
.email-sidebar {
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.email-sidebar strong { color: var(--text); }
textarea#email-body { width: 100%; min-height: 220px; font-family: Consolas, monospace; font-size: 12.5px; resize: vertical; }
.audience-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.audience-options label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.audience-options input[type="radio"] { accent-color: var(--accent); }
.recipient-count { color: var(--accent-soft); font-weight: 700; }

/* ---------- Inbox ---------- */
/* One flat panel, not three stacked cards: a single background/border
   wraps all three columns, with hairline dividers between them instead of
   each column being its own bordered/blurred box with a gap around it.
   140px accounts for main's own top/bottom padding + this panel's head
   above this grid — not pixel-perfect, just enough that the columns fill
   essentially the whole rest of the window. */
.inbox-layout {
  display: grid; grid-template-columns: 130px 1fr;
  height: calc(100vh - 140px);
  background: var(--panel); backdrop-filter: blur(6px);
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  overflow: hidden;
}

.inbox-folders {
  display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto;
  border-right: 1px solid var(--panel-border);
  padding: 10px 6px;
}
.inbox-folder-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: transparent; border: none; border-radius: 8px;
  padding: 8px 10px; color: var(--muted); font-weight: 700; font-size: 12.5px;
  text-align: left; white-space: nowrap;
}
.inbox-folder-btn:hover:not(.on) { color: var(--text); box-shadow: none; transform: none; background: rgba(255, 255, 255, 0.04); }
.inbox-folder-btn.on { color: var(--accent-soft); background: var(--accent-dim); }
.inbox-folder-count { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.inbox-folder-divider { height: 1px; background: var(--panel-border); margin: 6px 8px; flex-shrink: 0; }

/* One column that shows either the message/contact list or the open
   message/contact — never both. Matches a single-pane webmail (Gmail's
   list view vs. reading view), rather than a permanent split where the
   right side sits empty until something's selected. */
.inbox-main { display: flex; flex-direction: column; min-height: 0; }
.inbox-main > .inbox-list-col, .inbox-main > .inbox-reader { flex: 1; min-height: 0; }
.inbox-main .inbox-reader { display: none; }
.inbox-main.reading .inbox-list-col { display: none; }
.inbox-main.reading .inbox-reader { display: flex; }

.inbox-list-col {
  display: flex; flex-direction: column; min-height: 0;
  height: 100%;
}
.inbox-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 10px 0; }
.inbox-filter-tabs .tab-btn { border-radius: 999px; padding: 6px 12px; font-size: 11.5px; }
.inbox-list-toolbar { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 10px 0; }
#inbox-search { width: 220px; }

.inbox-list {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px 4px;
}
.inbox-list-col .pagination { padding: 0 10px 10px; margin-top: 4px; }
.inbox-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; cursor: pointer;
  border-bottom: 1px solid var(--panel-border);
}
.inbox-row:hover { background: rgba(255, 255, 255, 0.04); }
.inbox-row:hover .inbox-row-delete { display: flex; }
.inbox-row.selected { background: var(--accent-dim); }
.inbox-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.inbox-row-top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-row-from { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row.unread .inbox-row-from, .inbox-row.unread .inbox-row-subject { font-weight: 700; color: var(--text); }
.inbox-row-date { font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.inbox-row-subject { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row.unread::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  display: inline-block; margin-right: 6px;
}
.inbox-row-star, .inbox-row-delete {
  background: none; border: none; padding: 3px; color: var(--muted);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.inbox-row-star:hover, .inbox-row-delete:hover { color: var(--text); box-shadow: none; transform: none; }
.inbox-row-star.starred { color: #f5c96a; }
.inbox-row-delete { display: none; }
.inbox-row-delete:hover { color: var(--bad); }

.inbox-reader {
  min-height: 0; padding: 18px;
  display: flex; flex-direction: column;
}
.inbox-reader-head { flex-shrink: 0; border-bottom: 1px solid var(--panel-border); padding-bottom: 12px; margin-bottom: 12px; }
.inbox-reader-back-btn { margin-bottom: 12px; }
.inbox-reader-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.inbox-reader-subject { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.inbox-reader-meta { font-size: 12.5px; color: var(--muted); }
.inbox-reader-actions { display: flex; gap: 6px; flex-shrink: 0; }
.inbox-reader-frame { flex: 1; min-height: 0; width: 100%; border: none; border-radius: 8px; background: #fff; }
.inbox-reader-text { flex: 1; min-height: 0; overflow-y: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: var(--text); }

/* ---------- Changelog ---------- */
.changelog-tag-add { color: var(--ok); font-weight: 800; }
.changelog-tag-change { color: var(--muted); font-weight: 800; }
.changelog-tag-removed { color: var(--bad); font-weight: 800; }
.changelog-feature { color: var(--ok); font-weight: 700; }
.changelog-item-actions { display: inline-flex; gap: 4px; opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }

/* ---------- changelog table view ----------
   Replaced the old date-heading-plus-nested-list layout: a single busy day
   could stack a dozen items under one heading and read as a wall of text,
   so fixed columns keep it scannable no matter how many land on the same
   date. The .changelog-entry/.changelog-items/.changelog-date rules that
   drove the old layout were removed with it; the tag, feature and action
   classes above are still used, by the table rows. */
.changelog-table { table-layout: fixed; }
.changelog-cell-date { width: 104px; white-space: nowrap; vertical-align: top; color: var(--accent-soft); font-weight: 800; font-size: 12.5px; }
.changelog-cell-type { width: 92px; vertical-align: top; }
.changelog-cell-text { line-height: 1.55; word-break: break-word; }
.changelog-cell-actions { width: 54px; vertical-align: top; text-align: right; }
/* Only the first row of each date carries a border, so one day reads as a
   single block rather than every row looking equally separated. */
.changelog-row td { border-bottom: none; }
.changelog-row-daystart td { border-top: 1px solid var(--panel-border); }
.changelog-table tbody tr:first-child td { border-top: none; }
.changelog-row:hover .changelog-item-actions { opacity: 1; }
.changelog-table .changelog-tag { font-size: 11px; letter-spacing: 0.3px; text-transform: uppercase; }
.changelog-count { margin: 12px 0 0; font-size: 12px; }
.changelog-edit-btn, .changelog-delete-btn {
  border: none; background: none; cursor: pointer; font-size: 12px; line-height: 1;
  color: var(--muted); padding: 2px 4px; border-radius: 4px;
}
.changelog-edit-btn:hover { color: var(--accent-soft); }
.changelog-delete-btn:hover { color: var(--bad); }
