/* ============================================================
   Bakery app shell — the portal chrome (topbar, page background)
   plus the few widgets relay-theme.css doesn't ship. Mirrors the
   Cloud Gateway app.css so the two tools look like siblings; shell
   values come from the admin portal's shadcn tokens (background
   #f7f9fa/#040c13, border #e0e5e9/#27353e, 56px topbar).
   Everything page-specific lives here, never in relay-theme.css,
   and never inline: the CSP has no style-src 'unsafe-inline'.
   ============================================================ */

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f9fa;
}
.dark body { background: #040c13; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: rgba(247, 249, 250, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e0e5e9;
}
.dark .topbar {
  background: rgba(4, 12, 19, 0.9);
  border-bottom-color: #27353e;
}
.topbar .logo { height: 28px; width: auto; display: block; }
.topbar .logo-dark { display: none; }
.dark .topbar .logo-light { display: none; }
.dark .topbar .logo-dark { display: block; }
.topbar-app-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  border-left: 1px solid var(--ink-200);
  padding-left: 12px;
}
.dark .topbar-app-name {
  color: rgba(207, 238, 250, 0.55);
  border-left-color: rgba(255, 255, 255, 0.1);
}
.topbar-spacer { flex: 1; }
.topbar-user {
  font-size: 13px;
  color: var(--ink-600);
  font-family: var(--relay-font-mono);
}
.dark .topbar-user { color: rgba(207, 238, 250, 0.7); }
.topbar form { margin: 0; }
#themeToggle { font-size: 15px; }
#themeToggle .icon-sun { display: none; }
.dark #themeToggle .icon-sun { display: inline; }
.dark #themeToggle .icon-moon { display: none; }

/* relay-theme sizes .card-title and .page-header-title for divs;
   reset the heading margins we add for document structure. */
h1.page-header-title, h2.card-title { margin: 0; }
.dark .btn-ghost { color: #cfeefa; }
.dark .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* relay-theme buttons are <button>s in the portal; ours include links */
a.btn { text-decoration: none; }

/* ---------- Inline code (device ids) ---------- */
code {
  font-family: var(--relay-font-mono);
  font-size: 0.92em;
}

/* ---------- Form field spacing ---------- */
.field { margin-bottom: 16px; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; }

/* ---------- Pairing code entry ---------- */
.pairing-code {
  font-family: var(--relay-font-mono);
  font-size: 28px;
  letter-spacing: 0.4em;
  text-align: center;
  max-width: 260px;
  padding: 12px 16px 12px 24px; /* trailing letter-spacing shifts the digits left */
}

/* ---------- Banners (portal semantic colors) ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}
.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.dark .alert-error {
  background: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.35);
}
.alert-success {
  background: var(--mint-50);
  color: var(--mint-700);
  border: 1px solid var(--mint-100);
}
.dark .alert-success {
  background: rgba(57, 181, 74, 0.12);
  color: var(--mint-300);
  border-color: rgba(57, 181, 74, 0.35);
}

/* ---------- Sign-in page ---------- */
.signin {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.signin .card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  padding: 40px 32px;
}
.signin .logo { height: 32px; width: auto; margin: 0 auto 24px; display: block; }
.signin .logo-dark { display: none; }
.dark .signin .logo-light { display: none; }
.dark .signin .logo-dark { display: block; }
.signin h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--ink-900);
}
.dark .signin h1 { color: #fff; }
.signin p { margin: 0 0 28px; font-size: 13px; }

/* ---------- Topbar section links ---------- */
.topbar-nav { display: flex; gap: 4px; margin-left: 8px; }
.topbar-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-600);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}
.topbar-nav a:hover { background: var(--ink-100); color: var(--ink-900); }
.dark .topbar-nav a { color: rgba(207, 238, 250, 0.7); }
.dark .topbar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* ---------- VPN certificates ---------- */
.cert-id { font-size: 12px; word-break: break-all; }
.chip-tag.newest {
  background: var(--mint-50);
  color: var(--mint-700);
  box-shadow: inset 0 0 0 1px var(--mint-100);
  margin-left: 6px;
  font-family: var(--relay-font-sans, inherit);
}
.dark .chip-tag.newest {
  background: rgba(57, 181, 74, 0.12);
  color: var(--mint-300);
  box-shadow: inset 0 0 0 1px rgba(57, 181, 74, 0.35);
}
/* The revoked list is a <details> so a mistaken revocation is one click from
   being reversed without cluttering the page on the common path. */
details.revoked-certs > summary { list-style: none; cursor: pointer; }
details.revoked-certs > summary::-webkit-details-marker { display: none; }
details.revoked-certs > summary .card-title::before {
  content: "\25B8";
  display: inline-block;
  width: 1.1em;
  color: var(--ink-400);
}
details.revoked-certs[open] > summary .card-title::before { content: "\25BE"; }

/* ---------- Enrollment kind (dashboard) ---------- */
.chip-tag.enroll-gce {
  background: var(--mint-50);
  color: var(--mint-700);
  box-shadow: inset 0 0 0 1px var(--mint-100);
  font-family: var(--relay-font-sans, inherit);
}
.dark .chip-tag.enroll-gce {
  background: rgba(57, 181, 74, 0.12);
  color: var(--mint-300);
  box-shadow: inset 0 0 0 1px rgba(57, 181, 74, 0.35);
}
.card-note { margin: 0 0 12px; font-size: 13px; }

/* ---------- Bulk approval ---------- */
.bulk-pairs { resize: vertical; min-height: 200px; }
.bulk-errors { margin: 8px 0 0; padding-left: 20px; }
.card-header-action { margin-left: auto; }
