/* Organisations — table + grid */

/* ── Org avatar ───────────────────────────────────────────────────── */
.aq-org-avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  font-family: var(--aq-ff-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ── Toggle (Show test orgs) ──────────────────────────────────────── */
.aq-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--aq-text-dim);
  cursor: pointer;
  user-select: none;
  margin-right: 4px;
}
.aq-toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--aq-line-bright);
  border-radius: 3px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  position: relative;
}
.aq-toggle input:checked {
  background: var(--aq-accent);
  border-color: var(--aq-accent);
}
.aq-toggle input:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12l5 5L20 7'/></svg>") center / 10px no-repeat;
}

/* ── Status text (inline, no pill) ────────────────────────────────── */
.aq-status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--aq-text-dim);
  font-weight: 500;
}
.aq-status-text .aq-status-dot-inline {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.aq-status-text.is-success { color: var(--aq-success); }
.aq-status-text.is-warn { color: var(--aq-warn); }
.aq-status-text.is-danger { color: var(--aq-danger); }
.aq-status-text.is-neutral { color: var(--aq-text-dim); }

/* ── Row open button + icon button shared with library ────────────── */
.aq-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--aq-line);
  border-radius: 5px;
  color: var(--aq-text-dim);
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--aq-d-1) var(--aq-ease), color var(--aq-d-1) var(--aq-ease), border-color var(--aq-d-1) var(--aq-ease);
}
.aq-row-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--aq-text);
  border-color: var(--aq-line-bright);
}

/* ── Table ────────────────────────────────────────────────────────── */
.aq-table {
  width: 100%;
  font-size: 13px;
}
.aq-tr {
  display: grid;
  grid-template-columns: minmax(280px, 2.4fr) 70px 70px 90px 130px 110px 120px;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  height: 44px;
  border-bottom: 1px solid var(--aq-line);
  transition: background var(--aq-d-1) var(--aq-ease);
}
.aq-tr:hover:not(.aq-tr-head) { background: var(--aq-surface-2); }

.aq-tr-head {
  height: 32px;
  border-bottom: 1px solid var(--aq-line);
  background: transparent;
}
.aq-th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.085em;
  color: var(--aq-text-faint);
  font-weight: 500;
}
.aq-th-num { text-align: right; }
.aq-th-action { text-align: right; }

.aq-td {
  font-size: 13px;
  color: var(--aq-text-muted);
  min-width: 0;
}
.aq-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--aq-text);
}
.aq-td-meta { color: var(--aq-text-dim); font-size: 12px; }

.aq-td-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.aq-td-name-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.aq-td-name-main {
  color: var(--aq-text);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aq-td-name-sub {
  color: var(--aq-text-faint);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aq-td-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

/* ── Card grid ────────────────────────────────────────────────────── */
.aq-orgs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .aq-orgs-grid { grid-template-columns: repeat(2, 1fr); } }

.aq-org-card {
  background: var(--aq-surface-grad), var(--aq-surface);
  border: 1px solid var(--aq-line);
  border-radius: var(--aq-r-lg);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--aq-shadow-1), var(--aq-edge-top);
  transition: border-color var(--aq-d-1) var(--aq-ease),
              transform     var(--aq-d-1) var(--aq-ease),
              box-shadow    var(--aq-d-1) var(--aq-ease);
  cursor: pointer;
}
.aq-org-card:hover {
  border-color: var(--aq-line-bright);
  transform: translateY(-1px);
  box-shadow: var(--aq-shadow-2), var(--aq-edge-top);
}

.aq-org-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.aq-org-card-id {
  flex: 1;
  min-width: 0;
}
.aq-org-card-name {
  font-family: var(--aq-ff-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--aq-text);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.aq-org-card-note {
  font-size: 11.5px;
  color: var(--aq-text-faint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aq-org-card-stats {
  display: flex;
  gap: 18px;
  /* No sandwiching rules — the card's own gap spacing separates the
     head, stats and footer. */
  padding: 2px 0;
}
.aq-org-card-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aq-org-card-v {
  font-family: var(--aq-ff-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--aq-text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.aq-org-card-k {
  font-size: 10.5px;
  color: var(--aq-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.aq-org-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.aq-org-card-meta {
  font-size: 11.5px;
  color: var(--aq-text-faint);
}
