/* =============================================================================
   Accounts — the signed-out screens, the header identity strip, and the user
   management console.

   Kept out of theme.css deliberately: theme.css is the brand (colours, bands,
   buttons, tiles) and is loaded by every feature. This file is the one area
   that is not a feature — signing in and administering who may sign in — and
   separating it keeps a change here from repainting the Workbook.

   Every colour comes from a theme.css token, except the two avatar tints,
   which are decorative and belong to that one component.
   ========================================================================== */

/* --- Shared form controls -------------------------------------------------
   Ported from the reference's Input and Label cvas: an h-8 field with an
   --input border on a transparent ground, a text-sm muted label 0.5rem above
   it, and a blue focus ring — which is deliberately not the brand orange
   there, so it reads as "focus" rather than as an accent. */

.var-field {
  margin-bottom: 1.25rem;
}

.var-field > label {
  display: block;
  color: var(--var-grey-muted);
  font-size: 0.875rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.var-input,
.var-select {
  width: 100%;
  height: 2rem;
  background-color: transparent;
  border: 1px solid var(--var-line-strong);
  color: var(--var-fg);
  padding: 0.25rem 0.75rem;
  font-family: var(--var-font);
  font-size: 0.875rem;
  border-radius: 0;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.var-input::placeholder {
  color: var(--var-grey-muted);
}

.var-input:focus,
.var-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2.5px rgba(59, 130, 246, 0.4);
}

.var-select {
  appearance: none;
  height: auto;
  min-height: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--var-grey-muted) 50%),
                    linear-gradient(135deg, var(--var-grey-muted) 50%, transparent 50%);
  background-position: right 1rem center, right 0.72rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.var-select:disabled,
.var-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.var-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Password fields carry a reveal button inside the box (pr-10, right-3). */
.var-field-reveal {
  position: relative;
}

.var-field-reveal .var-input {
  padding-right: 2.5rem;
}

.var-field-reveal button {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 0;
  color: var(--var-grey-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.var-field-reveal button:hover {
  color: var(--var-fg);
}

.var-field-error {
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0.5rem 0 0;
}

/* --- Signed-out shell ------------------------------------------------------
   min-h-screen flex on --background; the form half centres, the pitch half is
   pinned to the top with p-24 (it is not vertically centred there). */

.var-auth-body {
  margin: 0;
  background-color: var(--var-dark);
}

.var-auth {
  display: flex;
  min-height: 100vh;
}

.var-auth-form {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

@media (min-width: 640px) { .var-auth-form { padding: 0 1.5rem; } }
@media (min-width: 1024px) {
  .var-auth-form { width: 50%; padding: 0 5rem; }
}
@media (min-width: 1280px) {
  .var-auth-form { padding: 0 6rem; }
}

.var-auth-inner {
  width: 100%;
  max-width: 28rem;
}

.var-auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.var-auth-brand img {
  height: 3.5rem;
  width: auto;
}

.var-auth-inner h1 {
  text-align: center;
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-transform: none;
  color: var(--var-white);
  margin: 0 0 0.5rem;
}

.var-auth-sub {
  text-align: center;
  color: var(--var-grey-muted);
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 2rem;
}

.var-auth-aside {
  display: flex;
  justify-content: flex-end;
  margin: -0.5rem 0 1.25rem;
  font-size: 0.75rem;
}

.var-auth-aside a {
  color: var(--var-grey-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.var-auth-aside a:hover {
  color: var(--var-orange-alt);
}

/* Button, default variant: bg-primary at h-9, filling to #e04e00 on hover. */
.var-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.25rem;
  background-color: var(--var-orange);
  border: 0;
  border-radius: 0;
  color: var(--var-white);
  font-family: var(--var-font);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 0 1rem;
  cursor: pointer;
  transition: background-color 0.1s ease-in-out;
}

.var-auth-submit:hover {
  background-color: #e04e00;
  color: var(--var-white);
}

.var-auth-submit:active {
  transform: scale(0.98);
}

.var-auth-foot {
  text-align: center;
  color: var(--var-grey-muted);
  font-size: 0.875rem;
  margin-top: 2rem;
}

.var-auth-foot a {
  color: var(--var-orange-alt);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.var-auth-foot a:hover {
  color: var(--var-orange);
}

.var-auth-alert {
  border-left: 3px solid var(--var-orange);
  background: rgba(245, 87, 2, 0.08);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.var-auth-alert p:last-child {
  margin-bottom: 0;
}

.var-auth-note {
  color: var(--var-grey-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* The pitch half: hidden below lg, --sidebar ground, content at the top under
   p-24 rather than centred. */
.var-auth-pitch {
  display: none;
}

@media (min-width: 1024px) {
  .var-auth-pitch {
    display: flex;
    width: 50%;
    align-items: flex-start;
    background-color: var(--var-black);
    padding: 6rem;
  }
}

.var-auth-pitch-inner {
  max-width: 36rem;
}

.var-auth-pitch h2 {
  color: var(--var-white);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-transform: none;
  margin: 0 0 2rem;
}

.var-auth-pitch ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.var-auth-pitch li {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.125rem;
  line-height: 1.75rem;
  margin-bottom: 1.25rem;
}

.var-auth-pitch li:last-child {
  margin-bottom: 0;
}

.var-auth-pitch li .var-icon {
  color: var(--var-orange);
  margin-right: 0.75rem;
  flex: 0 0 auto;
}

/* --- Header identity strip ------------------------------------------------- */

.var-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
}

.var-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- The bell -------------------------------------------------------------
   Ported from the reference's NotificationBell: a ghost icon button (h-8 w-8
   holding a size-4 bell) with the count pinned to its top-right corner, over
   a w-80 popover that scrolls at max-h-80. */

.var-bell-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--var-fg);
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

.var-bell-button:hover,
.var-bell-button[aria-expanded="true"] {
  background-color: var(--var-orange-alt);
  color: var(--var-white);
}

.var-bell-button:active {
  transform: scale(0.98);
}

.var-bell-count {
  position: absolute;
  top: -0.125rem;
  right: -0.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1rem;
  min-width: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background-color: var(--var-orange);
  color: var(--var-white);
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1;
  /* The bar's own colour, so the ring is invisible at rest and only appears
     when the button fills with orange underneath and the count would
     otherwise vanish into it. */
  box-shadow: 0 0 0 2px var(--var-black);
}

/* Bootstrap's dropdown does the opening, the outside click and the Escape;
   everything it draws is overridden back to the reference's popover. */
.var-bell-menu.dropdown-menu {
  width: 20rem;
  padding: 0;
  background-color: var(--var-surface);
  border: 1px solid var(--var-line);
  border-radius: 0;
  color: var(--var-fg);
}

.var-bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--var-line);
}

.var-bell-head h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.var-bell-list {
  max-height: 20rem;
  overflow-y: auto;
}

/* Every notification the portal has is unread by definition — it is a job
   waiting to be done — so the item always carries the reference's unread
   tint, and clicking it goes to the only place it can be cleared. */
.var-bell-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  border-bottom: 1px solid var(--var-line);
  background-color: rgba(245, 87, 2, 0.05);
  text-decoration: none;
  transition: background-color 0.1s ease-in-out;
}

.var-bell-item:last-child {
  border-bottom: 0;
}

.var-bell-item:hover {
  background-color: rgba(245, 87, 2, 0.1);
  text-decoration: none;
}

.var-bell-title {
  font-size: 0.875rem;
  line-height: 1.25;
  font-weight: 500;
  color: var(--var-fg);
}

.var-bell-message {
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--var-grey-muted);
}

.var-bell-time {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  line-height: 1rem;
  color: rgba(163, 163, 163, 0.6);
}

.var-bell-empty {
  padding: 1.5rem;
  text-align: center;
}

.var-bell-empty-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.5rem;
  color: rgba(163, 163, 163, 0.3);
}

.var-bell-empty p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--var-grey-muted);
}

/* Everything in the bar is text-xs; it was reading a size and a half too big. */
.var-clocks {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  line-height: 1rem;
  white-space: nowrap;
}

.var-clock b {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* The reference's LiveClock: the label carries an mr-1 and nothing else. */
.var-clock-label {
  margin-right: 0.25rem;
}

/* One bar, between the two clocks — the reference draws no others. */
.var-clock-sep {
  color: var(--var-line);
}

@media (max-width: 767.98px) {
  .var-clocks { display: none; }
}

@media (max-width: 575.98px) {
  .var-header .var-version { display: none; }
}

.var-whoami {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  line-height: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

a.var-whoami:hover {
  color: var(--var-white);
}

.var-whoami-static {
  cursor: default;
}

.var-verified {
  color: var(--var-green);
  font-size: 0.8rem;
  vertical-align: middle;
}

/* The reference's Button, variant="outline" size="sm", as .feature-open is:
   an --input border over --background — a shade lighter than the bar it sits
   on, which is what makes it read as a control — filling with --accent on
   hover and pressing to 98%. */
.var-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--var-dark);
  border: 1px solid var(--var-line-strong);
  color: var(--var-fg);
  height: 2rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

/* The mark carries an mr-1.5 of its own, on top of the button's gap-2 — so
   14px between it and the word, not 8. */
.var-logout .var-icon {
  margin-right: 0.375rem;
}

.var-logout:hover,
.var-logout:focus {
  background-color: var(--var-orange-alt);
  border-color: var(--var-orange-alt);
  color: var(--var-white);
  text-decoration: none;
}

.var-logout:active {
  transform: scale(0.98);
}

/* The reference hides the identity at lg, not sm: below 1024px the clocks and
   the version still fit, but the name and role do not. */
@media (max-width: 1023.98px) {
  .var-whoami { display: none; }
}

/* --- User management console -----------------------------------------------
   Ported from admin-users-page.tsx and users-table.tsx: a max-w-3xl column,
   a text-2xl/500 title that is NOT uppercased, and the shadcn Table's own
   metrics — h-12 heads, p-4 cells, a row that tints to --muted/50 on hover. */

.var-users {
  max-width: 48rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 1rem 6rem;
}

@media (min-width: 640px) { .var-users { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .var-users { padding-left: 2rem; padding-right: 2rem; } }

.var-users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.var-users-head h1 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-transform: none;
  color: var(--var-fg);
  margin: 0;
}

.var-users-count {
  display: flex;
  align-items: center;
  height: 1.25rem;
  margin: 0.25rem 0 0;
  color: var(--var-grey-muted);
  font-size: 0.875rem;
}

.var-pending-hint {
  color: var(--var-orange-alt);
  text-decoration: none;
  margin-left: 0.35rem;
}

/* Button variant="outline" size="icon", size-8. */
.var-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1px solid var(--var-line-strong);
  background: var(--var-dark);
  color: var(--var-fg);
  text-decoration: none;
  transition: all 0.1s ease-in-out;
}

.var-icon-btn:hover {
  background: var(--var-orange-alt);
  border-color: var(--var-orange-alt);
  color: var(--var-white);
}

/* TabsList: a 32px trough in --muted, with the *active* tab sitting on
   --background — darker than the strip it sits in, not lighter. */
.var-tabs {
  display: inline-flex;
  /* The column that holds it stretches its children; TabsList hugs its own
     content, so it has to opt out. */
  align-self: flex-start;
  height: 2rem;
  align-items: center;
  background: var(--var-surface-2);
  padding: 0.125rem;
  color: var(--var-grey-muted);
}

.var-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
}

.var-tab.is-on {
  background: var(--var-dark);
  color: var(--var-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.var-users-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.var-search {
  position: relative;
  flex: 1 1 auto;
}

.var-search .var-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  color: var(--var-grey-muted);
  pointer-events: none;
}

.var-search input {
  width: 100%;
  height: 2rem;
  background-color: transparent;
  border: 1px solid var(--var-line-strong);
  color: var(--var-fg);
  padding: 0.25rem 0.75rem 0.25rem 2rem;
  font-family: var(--var-font);
  font-size: 0.875rem;
}

.var-search input::placeholder { color: var(--var-grey-muted); }

.var-search input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2.5px rgba(59, 130, 246, 0.4);
}

.var-users-filters .var-select {
  width: 8rem;
  flex: 0 0 auto;
  height: 2rem;
  font-size: 0.875rem;
}

/* --- The table ------------------------------------------------------------- */

.var-users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.var-users-table th {
  height: 3rem;
  padding: 0 1rem;
  text-align: left;
  vertical-align: middle;
  font-weight: 500;
  color: var(--var-grey-muted);
  border-bottom: 1px solid var(--var-line);
}

.var-users-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--var-line);
}

.var-users-table tbody tr:last-child td { border-bottom: 0; }

.var-user-row { cursor: pointer; transition: background-color 0.15s; }

.var-user-row:hover td,
.var-user-row:focus-visible td { background: rgba(46, 46, 46, 0.5); }

.var-col-user { width: 45%; }
.var-col-role { width: 20%; }
.var-col-status { width: 17%; }
.var-col-joined { width: 18%; text-align: right; color: var(--var-grey-muted); }

.var-user-id {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.var-user-name { min-width: 0; }

.var-user-id b {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-user-id small {
  display: block;
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-users-empty {
  color: var(--var-grey-muted);
  text-align: center;
  padding: 3rem 0;
}

/* RoleBadge is text, not a pill: the admin tier is set in the foreground
   weight and everyone else stays muted. */
.var-role {
  font-size: 0.875rem;
  color: var(--var-grey-muted);
}

.var-role-admin {
  color: var(--var-fg);
  font-weight: 500;
}

/* UserStatus: a 6px dot and *muted* text. The colour is carried by the dot
   alone, which is why Active does not read as a green label. */
.var-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--var-grey-muted);
  white-space: nowrap;
}

.var-status::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.var-status-active::before { background: #10b981; }
.var-status-pending::before { background: var(--var-warn); }
.var-status-off::before { background: var(--var-grey-muted); }
.var-status-deleted { color: var(--var-danger); }

/* Avatar: size-8 with a per-person tint, initials at text-sm/500 in white. */
.var-avatar {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--var-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--var-white);
  background: #3f6f5f;
}

.var-avatar-b { background: #6f3f55; }

.var-avatar-lg {
  width: 4rem;
  height: 4rem;
  font-size: 1.25rem;
}

@media (max-width: 575.98px) {
  .var-col-joined, .var-col-status { display: none; }
}

/* --- The detail dialog -----------------------------------------------------
   DialogContent sm:max-w-4xl p-6 on --background, a 480px body split into a
   380px column and the rest, divided by a 1px --border rule. */

.var-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.var-modal[hidden] { display: none; }

.var-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.var-modal-card {
  position: relative;
  width: 100%;
  max-width: 56rem;
  max-height: 90vh;
  overflow: auto;
  background: var(--var-dark);
  border: 1px solid var(--var-line);
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.var-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 0;
  color: var(--var-fg);
  opacity: 0.7;
  padding: 0;
  cursor: pointer;
  z-index: 1;
  transition: opacity 0.15s;
}

.var-modal-close:hover { opacity: 1; }

.var-panel-loading {
  color: var(--var-grey-muted);
  padding: 3rem;
  text-align: center;
  margin: 0;
}

.var-panel {
  display: flex;
  min-height: 30rem;
  gap: 0;
}

@media (max-width: 767.98px) {
  .var-panel { flex-direction: column; min-height: 0; }
}

.var-panel-side {
  display: flex;
  width: 380px;
  flex-shrink: 0;
  flex-direction: column;
  padding-right: 1.5rem;
  border-right: 1px solid var(--var-line);
}

@media (max-width: 767.98px) {
  .var-panel-side {
    width: 100%;
    padding-right: 0;
    padding-bottom: 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--var-line);
  }
}

.var-panel-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.var-panel-identity h2 {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-transform: none;
  margin: 0 0 0.15rem;
}

.var-panel-identity p {
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  margin: 0;
  word-break: break-all;
}

/* The facts grid is text-xs — a step smaller than the panel around it. */
.var-panel-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
  font-size: 0.75rem;
  margin: 0;
}

.var-panel-facts .var-panel-wide { grid-column: 1 / -1; }

.var-panel-facts dt {
  color: var(--var-grey-muted);
  font-weight: 400;
  margin: 0;
}

.var-panel-facts dd {
  margin: 0.25rem 0 0;
  font-weight: 500;
}

.var-panel-actions {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.var-panel-actions form {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.var-panel-selfnote {
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--var-line);
  padding-top: 1rem;
  margin: 0;
}

/* Button variant="outline" size="sm", w-full justify-start. */
.var-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  height: 2.25rem;
  background: var(--var-dark);
  border: 1px solid var(--var-line-strong);
  color: var(--var-fg);
  font-family: var(--var-font);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 0.75rem;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

.var-btn:hover {
  background: var(--var-orange-alt);
  border-color: var(--var-orange-alt);
  color: var(--var-white);
}

.var-btn:active { transform: scale(0.98); }

.var-btn-primary {
  background: var(--var-orange);
  border-color: var(--var-orange);
  color: var(--var-white);
}

.var-btn-primary:hover {
  background: #e04e00;
  border-color: #e04e00;
}

.var-btn-danger { color: var(--var-danger); }

.var-btn-danger:hover {
  background: var(--var-danger);
  border-color: var(--var-danger);
  color: var(--var-white);
}

.var-panel-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding-left: 1.5rem;
}

@media (max-width: 767.98px) {
  .var-panel-main { padding-left: 0; padding-top: 1.5rem; }
}

.var-panel-tabs {
  display: inline-flex;
  width: 100%;
  height: 2rem;
  align-items: center;
  justify-content: flex-start;
  background: var(--var-surface-2);
  padding: 0.125rem;
}

.var-panel-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--var-grey-muted);
  font-family: var(--var-font);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}

.var-panel-tabs button.is-on {
  background: var(--var-dark);
  color: var(--var-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.var-panel-note {
  color: #10b981;
  font-size: 0.75rem;
  min-height: 1rem;
  margin: 0.75rem 0 0;
}

.var-pane-label {
  color: var(--var-grey-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.75rem 0;
}

.var-pane-label span {
  color: var(--var-fg);
  margin-left: 0.35rem;
}

.var-pane-empty,
.var-pane-hint {
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.var-pane-hint { margin-top: 1rem; }

/* --- Sessions -------------------------------------------------------------- */

.var-session-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 22rem;
  overflow-y: auto;
}

.var-session {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--var-line);
  padding: 0.75rem;
}

.var-session.is-revoked { opacity: 0.5; }

.var-session-icon {
  color: var(--var-grey-muted);
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.var-session-body { min-width: 0; flex: 1 1 auto; }

.var-session-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.var-session-plat {
  color: var(--var-grey-muted);
  font-weight: 400;
  font-size: 0.75rem;
}

/* Badge variant="secondary": a --secondary ground at text-xs/500. */
.var-badge {
  background: var(--var-surface-2);
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.05rem 0.5rem;
  border: 1px solid transparent;
}

.var-badge-off {
  color: var(--var-danger);
  border-color: var(--var-danger-line);
}

.var-session-meta {
  color: var(--var-grey-muted);
  font-size: 0.75rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.var-session-meta .var-icon {
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.4rem;
}

.var-session-meta .var-icon:first-child { margin-left: 0; }

.var-revoke {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--var-line-strong);
  color: var(--var-danger);
  font-family: var(--var-font);
  font-size: 0.75rem;
  font-weight: 500;
  height: 2rem;
  padding: 0 0.75rem;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

.var-revoke:hover {
  background: var(--var-danger);
  border-color: var(--var-danger);
  color: var(--var-white);
}

/* --- Module access ---------------------------------------------------------
   space-y-3 rows, an icon beside a font-normal label, and a Switch that turns
   emerald rather than brand orange — it reports state, it is not branding. */

.var-module-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.var-module {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  margin: 0;
  cursor: pointer;
}

.var-module > span:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.var-module .var-icon-sm {
  width: 1rem;
  height: 1rem;
  color: var(--var-grey-muted);
  flex: 0 0 auto;
}

.var-module-label {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--var-fg);
}

.var-module:has(input:disabled) { cursor: default; }

/* A checkbox drawn as the reference Switch: h-6 w-11, a 5-unit thumb on
   --background, --input when off. Still a checkbox to the keyboard. */
.var-switch {
  appearance: none;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 1.5rem;
  background: var(--var-line-strong);
  border: 2px solid transparent;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  margin: 0;
}

.var-switch::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--var-dark);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

.var-switch:checked { background: #10b981; }

.var-switch:checked::after { transform: translateX(1.25rem); }

.var-switch:focus-visible {
  outline: 2px solid var(--var-orange-alt);
  outline-offset: 2px;
}

.var-switch:disabled { opacity: 0.5; cursor: not-allowed; }
