/* Anvicom License Admin — brand-cyan theme matching the user manual.
   Brand palette pulled from Anvicom-Connect-User-Manual.html. */

:root {
  --brand: #09A5D3;
  --brand-dark: #0785aa;
  --brand-light: #2bbde8;
  --brand-tint: #e6f7fd;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --border: #e2e8f0;

  --nav: #0f172a;
  --nav-2: #1e293b;

  --text: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }

.muted { color: var(--text-muted); }
.center { text-align: center; }
.error { color: var(--bad); }
.success {
  color: #065f46; background: #d1fae5; border: 1px solid #6ee7b7;
  border-radius: 8px; padding: 8px 12px; font-size: 13px; line-height: 1.5;
}
.success code { background: rgba(255,255,255,.55); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
.success b { color: #064e3b; }

/* ─── Boot loader ─────────────────────────────────────── */
.full-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(135deg, #0a4a63 0%, var(--brand-dark) 45%, var(--brand) 100%);
  position: relative;
  overflow: hidden;
}
.full-center::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  opacity: .55;
}
.full-center > * { position: relative; z-index: 1; }
.full-center .muted { color: rgba(255, 255, 255, .85); }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Login card ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .15);
  padding: 36px 32px;
}
.login-card {
  width: min(440px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 16px;
}
.brand-title {
  margin: 0;
  font-size: 24px; font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}
.brand-title b {
  background: linear-gradient(180deg, var(--brand-light), var(--brand-dark));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  margin: -8px 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.login-card input {
  padding: 11px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  transition: border .15s, box-shadow .15s, background .15s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(9, 165, 211, .18);
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn-primary, .btn-ghost, .btn-danger, .btn-warn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  font-size: 14px; font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all .12s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(9, 165, 211, .25), 0 1px 0 rgba(255, 255, 255, .25) inset;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(9, 165, 211, .32); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: #cbd5e1; }
.btn-danger {
  background: var(--bad); color: #fff; border-color: #b91c1c;
  padding: 8px 14px; font-size: 13px;
}
.btn-danger:hover { background: #b91c1c; }
.btn-warn {
  background: var(--warn); color: #fff; border-color: #b45309;
  padding: 8px 14px; font-size: 13px;
}
.btn-warn:hover { background: #b45309; }

/* ─── App shell + header ──────────────────────────────── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: 60px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.brand-logo { height: 26px; width: auto; flex: 0 0 auto; display: block; }
.brand strong { color: var(--text); font-weight: 800; letter-spacing: -.2px; }
.brand strong b {
  background: linear-gradient(180deg, var(--brand-light), var(--brand-dark));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand .muted { font-size: 12px; padding-left: 8px; border-left: 1px solid var(--border); margin-left: 4px; }
.login-logo { height: 38px; width: auto; margin: 0 auto 10px; display: block; }

.tabs { display: flex; gap: 4px; justify-content: center; }
.tab-btn {
  background: transparent;
  border: none;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  font-family: inherit;
  transition: all .12s;
}
.tab-btn:hover { background: var(--surface-2); color: var(--text); }
.tab-btn.active {
  background: rgba(9, 165, 211, .12);
  color: var(--brand-dark);
  font-weight: 700;
}
.user-info { display: flex; align-items: center; gap: 14px; }

main { padding: 28px; max-width: 1400px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Dashboard ───────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-light), var(--brand));
}
.stat-card.good::before { background: linear-gradient(90deg, #34d399, var(--ok)); }
.stat-card.warn::before { background: linear-gradient(90deg, #fbbf24, var(--warn)); }
.stat-card.bad::before { background: linear-gradient(90deg, #f87171, var(--bad)); }

.stat-card .stat-icon {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand-tint);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.stat-card.good .stat-icon { background: #ecfdf5; color: var(--ok); }
.stat-card.warn .stat-icon { background: #fffbeb; color: var(--warn); }
.stat-card.bad .stat-icon { background: #fee2e2; color: var(--bad); }
.stat-card h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tab-btn iconify-icon { font-size: 16px; vertical-align: middle; margin-right: 2px; }
.btn-primary iconify-icon, .btn-ghost iconify-icon, .btn-warn iconify-icon, .btn-danger iconify-icon {
  font-size: 16px; vertical-align: middle;
}
.stat-card .stat-num {
  font-size: 30px; font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-num.small { font-size: 15px; font-weight: 600; }
.stat-card.good .stat-num { color: var(--ok); }
.stat-card.warn .stat-num { color: var(--warn); }
.stat-card.bad .stat-num { color: var(--bad); }

.recent-activity h2 {
  margin: 0 0 14px;
  font-size: 16px; font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.recent-activity h2::before {
  content: "";
  width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
}

/* ─── Toolbar ─────────────────────────────────────────── */
.toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar input[type=search], .toolbar select {
  padding: 9px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
}
.toolbar input[type=search] { flex: 1; max-width: 420px; }
.toolbar input:focus, .toolbar select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(9, 165, 211, .15);
}

/* ─── Tables ──────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13.5px;
}
thead {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-bottom: 1px solid #d8e0ea;
}
th {
  text-align: left;
  font-weight: 700;
  padding: 11px 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #334155;
}
td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: var(--surface-2); }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover td { background: #f0fbff !important; }
td.lic-id {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Sort headers */
th[data-sort] { cursor: pointer; user-select: none; transition: color .12s; }
th[data-sort]:hover { color: var(--brand); }
th[data-sort].active { color: var(--brand-dark); }
th .sort-arrow { font-size: 9px; margin-left: 4px; opacity: .7; }

/* License row enhancements */
td.customer-cell strong { font-weight: 700; color: var(--text); display: block; }
td.customer-cell .site-sub {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}
tbody tr.row-stale td { background: #fffbeb; }
tbody tr.row-stale:hover td { background: #fef3c7 !important; }
tbody tr.row-warn td.customer-cell strong { color: var(--bad); }

/* Last-seen indicator */
.last-seen {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
}
.last-seen .pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .2);
  animation: live-pulse-admin 1.8s ease-in-out infinite;
}
.last-seen .pulse-dot.off {
  background: var(--text-dim);
  box-shadow: none;
  animation: none;
}
.last-seen.fresh { color: var(--ok); font-weight: 600; }
.last-seen.normal { color: var(--text-muted); }
.last-seen.stale { color: var(--warn); font-weight: 600; }
.last-seen.stale .pulse-dot { background: var(--warn); box-shadow: none; }
@keyframes live-pulse-admin {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, .05); }
}

/* Inline action buttons in table */
td.actions-cell {
  white-space: nowrap;
  text-align: right;
  padding: 8px 12px;
}
.actions-col { width: 220px; text-align: right; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  margin-left: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all .12s;
  text-decoration: none;
}
.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--brand-light);
  color: var(--brand-dark);
  transform: translateY(-1px);
}
.icon-btn.dl { color: var(--brand); }
.icon-btn.dl:hover { background: var(--brand-tint); color: var(--brand-dark); }
.icon-btn.warn:hover { background: #fef3c7; border-color: var(--warn); color: var(--warn); }
.icon-btn.ok { color: var(--ok); }
.icon-btn.ok:hover { background: #ecfdf5; border-color: var(--ok); color: var(--ok); }
.icon-btn.danger { color: var(--bad); }
.icon-btn.danger:hover { background: #fef2f2; border-color: var(--bad); color: var(--bad); }
.icon-btn iconify-icon { font-size: 15px; }
/* Text-label variant for customer-row actions (Re-send, Delete). The base
   .icon-btn is a fixed 30×30 square sized for an icon — putting "Re-send"
   inside it line-wrapped to two lines and overlapped the next button.
   This modifier widens the box, switches to nowrap, and lets multiple
   text buttons sit side-by-side cleanly. */
.icon-btn.text {
  width: auto; min-width: 80px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap; gap: 4px;
}
.icon-btn.text + .icon-btn.text { margin-left: 6px; }

/* Orphan license — empty customer_email. Yellow tint + warning chip so the
   vendor can spot rows that need an email reassignment to bind to a portal
   account. Click row → Edit details to fix. */
tr.row-orphan td { background: #fffbeb; }
tr.row-orphan:hover td { background: #fef3c7; }
.orphan-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  color: #92400e; background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 1px 8px;
  margin-top: 3px;
  letter-spacing: .2px;
}
.customer-cell .site-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Inline filter chip — orphan checkbox in the licenses toolbar */
.cb-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; padding: 4px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px;
}
.cb-inline:hover { border-color: var(--brand-light); color: var(--brand-dark); }
.cb-inline input[type=checkbox] { accent-color: var(--brand); cursor: pointer; }

tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: #f8fafc; }

/* Inline list inside customer-detail modal */
.inline-list { list-style: none; padding: 0; margin: 4px 0; }
.inline-list li {
  padding: 7px 10px; margin: 4px 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px;
  transition: background .12s ease;
}
.inline-list li:hover { background: #ecfeff; border-color: var(--brand-light); }

td .feature-pill {
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: .3px;
  padding: 1px 6px;
}
td .small { font-size: 11px; }

/* ─── Status badges + pills ──────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.badge.active { background: #ecfdf5; color: var(--ok); border: 1px solid #a7f3d0; }
.badge.pending { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }
.badge.suspended { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge.revoked { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge.unknown { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge.sent   { background: #ecfdf5; color: var(--ok);   border: 1px solid #a7f3d0; }
.badge.queued { background: #ecfeff; color: #0e7490;     border: 1px solid #a5f3fc; }
.badge.failed { background: #fee2e2; color: #b91c1c;     border: 1px solid #fca5a5; }

.feature-pill {
  display: inline-block;
  background: var(--brand-tint);
  border: 1px solid #bae6fd;
  color: var(--brand-dark);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}
.fp-short {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* ─── Audit list ──────────────────────────────────────── */
.audit-list {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.audit-list.compact { max-height: 380px; overflow: auto; }
.audit-row {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 90px 200px 1fr 90px;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  transition: background .1s;
}
.audit-row:hover { background: var(--surface-2); }
.audit-row > * { min-width: 0; }
.audit-row > *:not(.detail) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-row:last-child { border-bottom: none; }
.audit-row .action {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .7px;
}
.audit-row .action.create { color: var(--ok); }
.audit-row .action.revoke { color: var(--bad); }
.audit-row .action.suspend { color: var(--warn); }
.audit-row .action.reactivate { color: var(--ok); }
.audit-row .action.activate { color: var(--brand); }
.audit-row .action.issue_lic { color: var(--brand-dark); }
.audit-row .action.reset_fingerprint { color: var(--warn); }
.audit-row .actor { color: var(--text-muted); font-size: 12px; }
.audit-row .detail { line-height: 1.4; word-break: break-word; color: var(--text); }
.audit-row .ts { color: var(--text-dim); font-size: 12px; text-align: right; }

/* ─── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border-radius: 14px;
  max-width: 540px; width: 100%;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.modal.big-modal { max-width: 920px; }
.modal header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}
.modal header h2 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none;
  font-size: 16px; color: var(--text-muted); cursor: pointer;
  padding: 0; width: 30px; height: 30px;
  border-radius: 6px;
  font-family: inherit;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body {
  padding: 24px;
  overflow: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-body label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; color: var(--text-muted);
}
.modal-body input, .modal-body textarea, .modal-body select {
  padding: 9px 13px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-family: inherit;
}
.modal-body input:focus, .modal-body textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(9, 165, 211, .15);
}
.modal-body fieldset {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px;
}
.modal-body fieldset legend { color: var(--text-muted); padding: 0 6px; font-size: 12.5px; font-weight: 600; }
.modal-body label.cb { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; cursor: pointer; }
.modal-body label small.muted { font-size: 11.5px; margin-top: 4px; display: block; }

/* Mode fieldset radio rows */
.mode-fieldset .radio-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 0;
}
.mode-fieldset .radio-row label.cb {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all .12s;
}
.mode-fieldset .radio-row label.cb:hover {
  background: var(--brand-tint);
  border-color: var(--brand-light);
}
.mode-fieldset .radio-row label.cb:has(input:checked) {
  background: var(--brand-tint);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(9, 165, 211, .12);
}
.mode-fieldset .radio-row strong { color: var(--text); font-weight: 700; }

.callout-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #78350f;
  margin-top: 8px;
  display: flex; gap: 10px; align-items: flex-start;
}
.callout-warn iconify-icon { font-size: 18px; color: var(--warn); flex-shrink: 0; margin-top: 1px; }
.callout-warn code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.badge.warn { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 8px;
}

/* ─── Detail panels ───────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-field {
  background: var(--surface-2);
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.detail-field strong {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: .7px;
  font-weight: 700;
}
.detail-field code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11.5px;
  word-break: break-all;
  color: var(--text);
}
.detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px dashed var(--border);
}
.detail-actions-spacer {
  flex: 1 1 0;
  min-width: 12px;
  border-left: 1px dashed var(--border);
  margin: 0 4px 0 8px;
  align-self: stretch;
}
.detail-actions .btn-danger {
  background: #fff;
  color: var(--bad);
  border: 1px solid #fecaca;
}
.detail-actions .btn-danger:hover {
  background: var(--bad);
  color: #fff;
  border-color: var(--bad);
}

/* Force-revoke button — visually stronger than ordinary Revoke */
.btn-kill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, #f59e0b 0%, var(--bad) 100%);
  color: #fff;
  border: 1px solid #b91c1c;
  box-shadow: 0 3px 8px rgba(220, 38, 38, .25);
  transition: all .12s;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.btn-kill:hover {
  background: linear-gradient(135deg, var(--bad) 0%, #991b1b 100%);
  box-shadow: 0 5px 14px rgba(220, 38, 38, .35);
  transform: translateY(-1px);
}
.btn-kill iconify-icon { font-size: 14px; }

/* Inline kill flag pip next to status badge */
.badge.kill {
  background: linear-gradient(135deg, #f59e0b 0%, var(--bad) 100%);
  color: #fff;
  border: 1px solid #b91c1c;
  padding: 2px 6px;
  margin-left: 4px;
}
.badge.kill iconify-icon { font-size: 12px; vertical-align: middle; }

/* Banner shown in detail modal when force-kill is set */
.force-kill-banner {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, .10) 0%, rgba(220, 38, 38, .10) 100%);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: var(--bad);
  font-size: 12.5px;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.force-kill-banner iconify-icon { font-size: 16px; }

/* Audit row colour for force_revoke action */
.audit-row .action.force_revoke { color: var(--bad); }
.audit-row .action.delete { color: var(--bad); }
.audit-row .action.bulk_delete { color: var(--bad); }
.detail-section { margin-top: 22px; }
.detail-section h3 {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  display: flex; align-items: center; gap: 8px;
}
.detail-section h3::before {
  content: "";
  width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
}
.detail-section .audit-list, .detail-section .heartbeat-list {
  max-height: 260px; overflow: auto;
}
.heartbeat-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 100px 1fr 1fr 130px;
  gap: 14px;
  font-size: 12px;
  align-items: center;
}
.heartbeat-row:last-child { border-bottom: none; }
.heartbeat-row .status-cell {
  font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .5px;
}
.heartbeat-row .status-cell.active { color: var(--ok); }
.heartbeat-row .status-cell.revoked, .heartbeat-row .status-cell.unknown { color: var(--bad); }
.heartbeat-row .status-cell.fingerprint_mismatch { color: var(--bad); }

/* ─── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--nav);
  color: white;
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  z-index: 200;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: var(--bad); }
.toast.toast-success { background: linear-gradient(135deg, #34d399, var(--ok)); }

/* ─── Downloads tab ────────────────────────────────────── */
.dl-upload-box {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 24px;
  background: var(--surface);
}
.dl-upload-box:hover { border-color: var(--accent); }

/* ─── Remote Support panel ─────────────────────────────── */
.rs-status { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 4px; }
.rs-active  { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.35); }
.rs-pending { background: rgba(251,191,36,.10);  border: 1px solid rgba(251,191,36,.35); }
.rs-cmd-wrap { margin-top: 8px; }
.rs-cmd {
  display: block; font-family: monospace; font-size: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; cursor: pointer; user-select: all;
  white-space: pre; overflow-x: auto;
}
.rs-cmd:hover { border-color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

@media (max-width: 720px) {
  .app-header { grid-template-columns: 1fr; height: auto; padding: 12px 16px; gap: 8px; }
  .tabs { justify-content: flex-start; flex-wrap: wrap; }
  main { padding: 16px; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
  .audit-row .ts { text-align: left; }
  .detail-grid { grid-template-columns: 1fr; }
  .heartbeat-row { grid-template-columns: 1fr 1fr; }
}
