/*
 * site-app.css — admin / ledger / signals / account / inbox
 * Split from styles-dataviz.css on 2026-05-31 via scripts/codemod/split-dataviz.mjs
 */
.ll-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--ll-border-subtle);
  margin-bottom: 1rem;
}
.ll-tab {
  flex: 0 0 auto;
  padding: 0.5rem 1rem 0.6rem;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ll-text-muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;
  line-height: 1.4;
}
.ll-tab:hover {
  color: var(--ll-text);
  background: rgba(var(--ll-accent-rgb), 0.04);
  border-bottom-color: rgba(var(--ll-accent-rgb), 0.35);
}
.ll-tab.active,
.ll-tab[aria-selected="true"] {
  color: var(--ll-text);
  font-weight: 600;
  background: rgba(var(--ll-accent-rgb), 0.07);
  border-bottom-color: var(--ll-accent);
}
[data-theme="app"] .ll-tabs { border-bottom-color: rgba(0,0,0,0.1); }
[data-theme="app"] .ll-tab { color: #57606a; }
[data-theme="app"] .ll-tab:hover { color: #24292f; background: rgba(9,105,218,0.04); border-bottom-color: rgba(9,105,218,0.35); }
[data-theme="app"] .ll-tab.active,
[data-theme="app"] .ll-tab[aria-selected="true"] { color: #111417; background: rgba(9,105,218,0.07); border-bottom-color: #0969da; }

.entitlement-list {
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-5);
  margin: var(--ll-space-3) 0 var(--ll-space-4);
}

.entitlement-group {
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-2);
}

.entitlement-group__title {
  margin: 0 0 var(--ll-space-1);
  font-size: var(--ll-text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ll-text-muted);
}

.entitlement-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ll-space-4);
  padding: var(--ll-space-3) var(--ll-space-4);
  background: var(--ll-bg);
  border: 1px solid var(--ll-border-subtle);
  border-radius: var(--ll-radius-md);
  cursor: pointer;
  transition: border-color var(--ll-duration-fast), background var(--ll-duration-fast);
}

.entitlement-row:hover {
  border-color: rgba(var(--ll-accent-rgb), 0.35);
  background: var(--ll-surface-elevated);
}

.entitlement-row--readonly {
  cursor: default;
  opacity: 0.85;
}

.entitlement-row--readonly:hover {
  border-color: var(--ll-border-subtle);
  background: var(--ll-bg);
}

.entitlement-row__body {
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-1);
  flex: 1;
  min-width: 0;
}

.entitlement-row__name {
  font-size: var(--ll-text-base);
  font-weight: 600;
  color: var(--ll-text);
  line-height: var(--ll-line-snug);
}

.entitlement-row__desc {
  font-size: var(--ll-text-sm);
  color: var(--ll-text-muted);
  line-height: var(--ll-line-normal);
}

.entitlement-row__key {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--ll-text-xs);
  color: var(--ll-text-muted);
  opacity: 0.65;
  margin-top: 0.1rem;
}

/* Toggle switch — iOS-style, accessible */
.entitlement-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.entitlement-toggle input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.entitlement-toggle__track {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 1.4rem;
  background: var(--ll-surface-elevated);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius-pill);
  transition: background var(--ll-duration-fast), border-color var(--ll-duration-fast);
}

.entitlement-toggle__track::after {
  content: "";
  position: absolute;
  top: 0.13rem;
  left: 0.13rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--ll-text-muted);
  transition: transform var(--ll-duration-base) var(--ll-ease-out), background var(--ll-duration-fast);
}

.entitlement-toggle input[type="checkbox"]:checked + .entitlement-toggle__track {
  background: rgba(var(--ll-accent-rgb), 0.4);
  border-color: rgba(var(--ll-accent-rgb), 0.6);
}

.entitlement-toggle input[type="checkbox"]:checked + .entitlement-toggle__track::after {
  transform: translateX(1.1rem);
  background: var(--ll-accent);
}

.entitlement-toggle input[type="checkbox"]:focus-visible + .entitlement-toggle__track {
  box-shadow: var(--ll-focus-ring);
}

.entitlement-toggle input[type="checkbox"]:disabled + .entitlement-toggle__track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Legacy disclosure */
.entitlement-legacy {
  border: 1px solid var(--ll-border-subtle);
  border-radius: var(--ll-radius-md);
  background: var(--ll-bg);
}

.entitlement-legacy > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--ll-space-2) var(--ll-space-4);
  font-size: var(--ll-text-sm);
  font-weight: 600;
  color: var(--ll-text-muted);
  display: flex;
  align-items: center;
  gap: var(--ll-space-2);
  border-radius: var(--ll-radius-md);
}

.entitlement-legacy > summary::-webkit-details-marker {
  display: none;
}

.entitlement-legacy > summary::before {
  content: "▶";
  font-size: 0.6rem;
  opacity: 0.7;
  transition: transform var(--ll-duration-fast);
}

.entitlement-legacy[open] > summary::before {
  transform: rotate(90deg);
}

.entitlement-legacy > summary:hover {
  color: var(--ll-text);
}

.entitlement-legacy[open] > summary {
  border-bottom: 1px solid var(--ll-border-subtle);
  border-radius: var(--ll-radius-md) var(--ll-radius-md) 0 0;
}

.entitlement-legacy > .entitlement-group {
  padding: var(--ll-space-3);
  gap: var(--ll-space-2);
}

/* Audit-note sticky footer of the entitlements card */
.entitlement-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--ll-space-3);
  margin-top: var(--ll-space-4);
  padding-top: var(--ll-space-4);
  border-top: 1px solid var(--ll-border-subtle);
}

.entitlement-footer__note {
  flex: 1;
  min-width: 16rem;
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-1);
}

.entitlement-footer__actions {
  display: flex;
  gap: var(--ll-space-2);
  flex-shrink: 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--ll-space-8) var(--ll-space-4);
  gap: var(--ll-space-3);
  border: 1px dashed var(--ll-border-subtle);
  border-radius: var(--ll-radius-md);
  background: var(--ll-bg);
  color: var(--ll-text-muted);
}

.empty-state__icon {
  width: 3rem;
  height: 3rem;
  color: var(--ll-text-muted);
  opacity: 0.55;
  flex-shrink: 0;
}

.empty-state__title {
  margin: 0;
  font-size: var(--ll-text-lg);
  font-weight: 600;
  color: var(--ll-text);
  line-height: var(--ll-line-snug);
}

.empty-state__body {
  margin: 0;
  max-width: 28rem;
  font-size: var(--ll-text-sm);
  color: var(--ll-text-muted);
  line-height: var(--ll-line-normal);
}

.empty-state__action {
  margin-top: var(--ll-space-2);
}

/* Compact variant — for inside cards/tables where the full padding
   would feel wasteful. Drops to ~half the vertical breathing room. */
.empty-state--compact {
  padding: var(--ll-space-4) var(--ll-space-3);
  gap: var(--ll-space-2);
}

.empty-state--compact .empty-state__icon {
  width: 2rem;
  height: 2rem;
}

.empty-state--compact .empty-state__title {
  font-size: var(--ll-text-base);
}

/* Inline variant — horizontal layout, no dashed border. Useful when
   the empty-state sits inside an already-bordered card. */
.empty-state--inline {
  flex-direction: row;
  text-align: left;
  border: none;
  padding: var(--ll-space-4) 0;
  background: transparent;
  align-items: center;
  justify-content: flex-start;
}

.empty-state--inline .empty-state__body,
.empty-state--inline .empty-state__title {
  text-align: left;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--ll-surface-elevated);
  border-radius: var(--ll-radius-sm);
  display: block;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Two-stop highlight peak (instead of single-stop) makes the shimmer
     read more clearly — the bright band has actual width before it
     fades out, vs. a single peak that looks like a flicker. */
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.6s linear infinite;
  pointer-events: none;
}

[data-theme="app"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(15, 23, 42, 0.04) 40%,
    rgba(15, 23, 42, 0.10) 50%,
    rgba(15, 23, 42, 0.04) 60%,
    transparent 100%
  );
}

.skeleton--line {
  height: 0.9rem;
  width: 100%;
  border-radius: var(--ll-radius-pill);
}

.skeleton--line + .skeleton--line {
  margin-top: var(--ll-space-2);
}

.skeleton--block {
  height: 6rem;
  width: 100%;
  border-radius: var(--ll-radius-md);
}

.skeleton--circle {
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.skeleton--w-25 { width: 25%; }
.skeleton--w-50 { width: 50%; }
.skeleton--w-75 { width: 75%; }

/* Composite row — typical "avatar + 2 lines" layout for result lists */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--ll-space-3);
  padding: var(--ll-space-3);
  border: 1px solid var(--ll-border-subtle);
  border-radius: var(--ll-radius-md);
  background: var(--ll-bg);
}

.skeleton-row + .skeleton-row {
  margin-top: var(--ll-space-2);
}

.skeleton-row__lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-1);
}

/* Container that stacks several skeleton-rows — convenient for loading
   lists of borrowers/lenders/signals while data is fetched. */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-2);
}

/* ─────────────────────────────────────────────────────────────────────
 * Post-Design-System F3 — Tooltip system (2026-05-23)
 *
 * CSS-only tooltips activated by data-ll-tooltip attribute. Shown on
 * hover AND keyboard focus-visible (so they work without a mouse).
 * Polished, themed, accessible. Replaces ugly browser-default title="".
 *
 * Usage:
 *   <button data-ll-tooltip="Click to approve">Approve</button>
 *   <span data-ll-tooltip="Parse confidence" data-ll-tooltip-position="right">85%</span>
 *
 * Positions: top (default), right, bottom, left.
 * For long content, wrap with `data-ll-tooltip-wide` for max-width + wrap.
 * ───────────────────────────────────────────────────────────────────── */

